ChangeLog-2019-06-05 [plain text]
2019-06-05 Brent Fulgham <bfulgham@apple.com>
[iOS] Update sandboxes to address iokit-get-property errors
https://bugs.webkit.org/show_bug.cgi?id=198494
<rdar://problem/51322072> and <rdar://problem/50602737>
Reviewed by Alexey Proskuryakov.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-06-05 Wenson Hsieh <wenson_hsieh@apple.com>
Upstream content mode support into open source from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=198484
<rdar://problem/51355671>
Reviewed by Andy Estes.
Move code for handling WKContentMode into open source. No change in behavior, for internal builds.
* Shared/API/Cocoa/WebKit.apinotes:
* Shared/WebContentMode.h: Renamed from Source/WebKit/Shared/WebCompatibilityMode.h.
* Shared/WebPreferences.yaml:
* UIProcess/API/APINavigation.h:
(API::Navigation::setEffectiveContentMode):
(API::Navigation::effectiveContentMode const):
(API::Navigation::setEffectiveCompatibilityMode): Deleted.
(API::Navigation::effectiveCompatibilityMode const): Deleted.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::shouldBypassContentModeSafeguards const):
(API::NavigationClient::shouldBypassCompatibilityModeSafeguards const): Deleted.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigation.mm:
(-[WKNavigation effectiveContentMode]):
* UIProcess/API/Cocoa/WKWebpagePreferences.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(WebKit::contentMode):
(WebKit::webContentMode):
(-[WKWebpagePreferences _allowSiteSpecificQuirksToOverrideCompatibilityMode]):
(-[WKWebpagePreferences _setAllowSiteSpecificQuirksToOverrideCompatibilityMode:]):
(-[WKWebpagePreferences setPreferredContentMode:]):
(-[WKWebpagePreferences preferredContentMode]):
* UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::shouldBypassContentModeSafeguards const):
(WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
(WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingSupported):
(WebKit::webViewSizeIsNarrow):
(WebKit::desktopClassBrowsingRecommendedForRequest):
(WebKit::desktopClassBrowsingRecommended):
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
* WebKit.xcodeproj/project.pbxproj:
2019-06-05 Tim Horton <timothy_horton@apple.com>
Remove some unused selection code
https://bugs.webkit.org/show_bug.cgi?id=198451
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/GestureTypes.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toGestureType):
(toUIWKGestureType):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::canShrinkToTextSelection): Deleted.
(WebKit::hasCustomLineHeight): Deleted.
(WebKit::WebPage::rangeForWebSelectionAtPosition): Deleted.
2019-06-05 Chris Dumez <cdumez@apple.com>
Unreviewed assertion fix for macOS after r246097.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
2019-06-01 Antoine Quint <graouts@apple.com>
[Pointer Events] Add support for chorded button interactions
https://bugs.webkit.org/show_bug.cgi?id=198462
Reviewed by Dean Jackson.
Update to use -2 instead of -1 for NoButton.
* Shared/API/c/WKEvent.h:
* Shared/WebEvent.h:
2019-06-05 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r245796): [WPE][GTK] Web process crash on startup
https://bugs.webkit.org/show_bug.cgi?id=198485
Reviewed by Chris Dumez.
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestCreate):
2019-06-05 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Re-enable process warming
https://bugs.webkit.org/show_bug.cgi?id=198526
Reviewed by Michael Catanzaro.
It was disabled in r243490 because bubblewrap sandbox needs a valid WebsiteDataStore before launching the web
process. We can use the default WebsiteDataStore from the WebProcessPool and only use the prewarmed process
later if the given WebsiteDataStore is the same as the WebProcessPool one.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::tryTakePrewarmedProcess): Do not use the prewarmed process if WebsiteDataStore is
different than the one used to launch the process when sandboxing is enabled.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize): Do not disable process warming.
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Use the WebsiteDataStore from the WebProcessPool if process
is prewarmed and sandboxing is enabled.
2019-06-04 Chris Dumez <cdumez@apple.com>
Cookies set via [WKHTTPCookieStore setCookie:] on store right after constructing WKWebView get lost
https://bugs.webkit.org/show_bug.cgi?id=198553
<rdar://problem/51317144>
Reviewed by Geoffrey Garen.
If you call [WKHTTPCookieStore setCookie:] right after you construct the WKWebView and before the
WebContent process has finished launching, then WebsiteDataStore::processPoolForCookieStorageOperations()
would return null, even though there is already a view/page/WebProcessProxy/WebProcessPool for this data
store. As a result, the cookie would get added to the WebsiteDataStore's m_pendingCookies but it will
not be used since we've already previously launched a network process when we constructed the web view.
The reason processPoolForCookieStorageOperations() would return null is because WebsiteDataStore::processPools()
relies on WebProcessLifetimeObserver::processes() but processes only register themselves with the
WebProcessLifetimeObservers when they have pages *and* after they are finished launching.
This patch updates processPoolForCookieStorageOperations() to fallback to iterating over all process pools
and find a process pool with a process using the current data store and which has pages. This way, even if
the process is still launching, we'll properly find its associated process pool.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
2019-06-04 Michael Catanzaro <mcatanzaro@igalia.com>
Fix miscellaneous build warnings
https://bugs.webkit.org/show_bug.cgi?id=198544
Reviewed by Don Olmstead.
Carefully silence -Wsign-compare warnings.
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::readOrMakeSalt):
2019-06-04 Youenn Fablet <youenn@apple.com>
getUserMedia requests should be processed sequentially in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=198430
<rdar://problem/51311420>
Reviewed by Eric Carlson.
Before the patch, we process all incoming gum/gdm requests in parallel.
We now queueu them and process them one at a time.
This allows to take into consideration state changes triggered by one request for the next one.
In particular, if a user grants a request, this might grant the next one as well.
To implement that, we keep a reference of the current request to process.
We queue other requests happening whenever another request comes.
When the request is processed, we look at the next one in the queue.
To ensure we do not stop processing the queue for no good reason, some refactoring is done:
- queue processing happens when sending back IPC response to WebProcess.
- denyRequest/grantRequest are consistently called in the manager proxy.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests):
Invalidate pregranted requests as well.
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
Renamed from userMediaAccessWasDenied to denyRequest.
This method is now consistently used whenever the manager proxy wants to deny the request.
It does the IPC to the WebProcess and triggers processing of the next request.
(WebKit::UserMediaPermissionRequestManagerProxy::grantRequest):
Renamed from userMediaAccessWasGranted to grantRequest.
(WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
This method is now consistently used whenever the manager proxy wants to deny the request.
It does the IPC to the WebProcess and triggers processing of the next request.
(WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired):
We now keep a queue of request instead of request IDs to make the deny code path more consistent.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processNextUserMediaRequestIfNeeded):
(WebKit::UserMediaPermissionRequestManagerProxy::startProcessingUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
To make sure we do not process a different request, we keep a pointer to the request and compare it with the current media request.
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::viewIsBecomingVisible):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::setDeviceAsFirst):
(WebKit::UserMediaPermissionRequestProxy::allow):
(WebKit::UserMediaPermissionRequestProxy::deny):
* UIProcess/UserMediaPermissionRequestProxy.h:
2019-06-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r246086.
https://bugs.webkit.org/show_bug.cgi?id=198549
Causing Internal build failures (Requested by ShawnRoberts on
#webkit).
Reverted changeset:
"Remove some unused selection code"
https://bugs.webkit.org/show_bug.cgi?id=198451
https://trac.webkit.org/changeset/246086
2019-06-04 Tim Horton <timothy_horton@apple.com>
Turn on background color estimation for all link indicators
https://bugs.webkit.org/show_bug.cgi?id=198547
<rdar://problem/51140196>
Reviewed by Dean Jackson.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computeAndSendEditDragSnapshot):
(WebKit::linkIndicatorPositionInformation):
2019-06-04 Tim Horton <timothy_horton@apple.com>
Remove some unused selection code
https://bugs.webkit.org/show_bug.cgi?id=198451
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/GestureTypes.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toGestureType):
(toUIWKGestureType):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::canShrinkToTextSelection): Deleted.
(WebKit::hasCustomLineHeight): Deleted.
(WebKit::WebPage::rangeForWebSelectionAtPosition): Deleted.
2019-06-04 Sihui Liu <sihui_liu@apple.com>
WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
https://bugs.webkit.org/show_bug.cgi?id=198317
<rdar://problem/51244662>
Reviewed by Alex Christensen.
Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or
websiteDataStore.
Reland r245943 as test has been fixed in r246012.
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::isEphemeral const):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::setItems):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
(WebKit::StorageManager::LocalStorageNamespace::cloneTo):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::suspend):
(WebKit::StorageManager::resume):
(WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:
(): Deleted.
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchStorageEvent):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::connect):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2019-06-04 Alex Christensen <achristensen@apple.com>
Uploading third-party applications from /Applications needs additional syscall access
https://bugs.webkit.org/show_bug.cgi?id=198537
<rdar://problem/51164741>
Reviewed by Brent Fulgham.
* WebProcess/com.apple.WebProcess.sb.in:
2019-06-04 Chris Dumez <cdumez@apple.com>
Lazily construct the NetworkHTTPSUpgradeChecker
https://bugs.webkit.org/show_bug.cgi?id=198500
Reviewed by Alex Christensen.
Lazily construct the NetworkHTTPSUpgradeChecker since the feature is off by default and this
avoids unnecessarily opening its database in the common case.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
2019-06-04 Youenn Fablet <youenn@apple.com>
REGRESSION (r245913) [ Debug ] ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier()) Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=198434
<rdar://problem/51313917>
Reviewed by Alex Christensen.
Iterate through the connectionID-based connection map instead of the sessionID-based map to notify them their connection is lost.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
2019-06-04 Chris Dumez <cdumez@apple.com>
[iOS] UIProcess' background task expiration handler may get called after the app is foreground again
https://bugs.webkit.org/show_bug.cgi?id=198380
<rdar://problem/49762471>
Reviewed by Geoff Garen.
UIProcess' background task expiration handler may get called after the app is foreground again. When
this happens, we already have a foreground assertion on behalf of the WebContent process, and the view
is visible. We would send the WillSuspendImminently IPC to the WebContent process, which would freeze
its layers, even though it is visible on screen.
To address the issue, we now check if the app is visible in the expiration handler. If it is visible,
we do not notify clients of imminent suspension. Instead, we end the background task right away and
call _updateBackgroundTask asynchronously to start a new background task if necessary.
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2019-06-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash when re-entering AC mode after r245957
https://bugs.webkit.org/show_bug.cgi?id=198522
Reviewed by Žan Doberšek.
When AcceleratedBackingStoreWayland::displayBuffer() is called and we have already left AC mode, we early
dispatch the image and release it. The problem is that images are reused, so the given image can be the
committed one. In that case we end up freeing it again in the next AcceleratedBackingStoreWayland::paint()
call.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Do not release the given image if it's the committed one.
2019-06-03 Chris Dumez <cdumez@apple.com>
[iOS] Do not prevent app suspension for more than 20 seconds after getting backgrounded
https://bugs.webkit.org/show_bug.cgi?id=198488
<rdar://problem/50837208>
Reviewed by Geoff Garen.
Do not prevent app suspension for more than 20 seconds after getting backgrounded on iOS. We
do this by implementing our own expiration handler which notifies our child processes of
their imminent suspension before ending the background task that was preventing suspension.
* UIProcess/ios/ProcessAssertionIOS.mm:
(isBackgroundState):
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _scheduleTimeoutTask]):
(-[WKProcessAssertionBackgroundTaskManager _cancelTimeoutTask]):
(-[WKProcessAssertionBackgroundTaskManager _backgroundTaskExpired]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
(-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
2019-06-03 Wenson Hsieh <wenson_hsieh@apple.com>
Implement an internal switch to turn idempotent text autosizing and viewport rules off
https://bugs.webkit.org/show_bug.cgi?id=198460
<rdar://problem/51324526>
Reviewed by Tim Horton.
* Shared/WebPreferences.yaml:
Add new preferences to control viewport shrink-to-fit-content and idempotent text autosizing.
* Shared/WebPreferencesDefaultValues.cpp:
Add the non-iOS implementation of defaultTextAutosizingUsesIdempotentMode, and also wrap these functions in the
WebKit namespace.
(WebKit::defaultTextAutosizingUsesIdempotentMode):
(defaultPassiveTouchListenersAsDefaultOnDocument): Deleted.
(defaultCustomPasteboardDataEnabled): Deleted.
* Shared/WebPreferencesDefaultValues.h:
Move some existing default preference value helper functions into the WebKit namespace.
* Shared/ios/WebPreferencesDefaultValuesIOS.mm: Copied from Source/WebKit/Shared/WebPreferencesDefaultValues.cpp.
Add an iOS-specific file for WebPreferencesDefaultValues, so that we can check for the user interface idiom.
(WebKit::defaultTextAutosizingUsesIdempotentMode):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::immediatelyShrinkToFitContent):
Add an early return for the case where shrink-to-fit-content is explicitly disabled via the new preference.
2019-06-03 Rob Buis <rbuis@igalia.com>
Implement imagesrcset and imagesizes attributes on link rel=preload
https://bugs.webkit.org/show_bug.cgi?id=192950
Reviewed by Youenn Fablet.
Add a runtime flag for link preload responsive images.
* Shared/WebPreferences.yaml:
2019-06-03 Darin Adler <darin@apple.com>
Finish cleanup of String::number for floating point
https://bugs.webkit.org/show_bug.cgi?id=198471
Reviewed by Yusuke Suzuki.
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::submitTopList): Use makeString instead of StringBuilder since it
is more terse and possibly more efficient as well.
* UIProcess/API/APIUserScript.cpp:
(API::UserScript::generateUniqueURL): Ditto.
* UIProcess/API/APIUserStyleSheet.cpp:
(API::UserStyleSheet::generateUniqueURL): Ditto.
2019-06-03 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r240862) [WinCairo][WK2] position:fixed elements don't show
https://bugs.webkit.org/show_bug.cgi?id=198478
Reviewed by Carlos Garcia Campos.
All position:fixed elements didn't show in WinCairo WebKit2 since
r240862 which turns acceleratedCompositingEnabled on for WebKit2.
WinCairo WebKit2 doesn't have accelerated compositing support yet.
Let's do the same with GTK port.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Conditioned out the code
enabling acceleratedCompositingEnabled for PLATFORM(WIN).
2019-06-03 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r244182): [CoordinatedGraphics] Related view doesn't receive graphic updates
https://bugs.webkit.org/show_bug.cgi?id=198418
Reviewed by Žan Doberšek.
This is because we need a DisplayRefreshMonitor per drawing area, but the one from the first ThreradedCompositor
is always reused because they use the same display ID.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use a unique display ID derived from
WebPage's ID.
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode): Use the primary display ID.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::LayerTreeHost): Get the current web page display ID instead of inventing one.
(WebKit::LayerTreeHost::setIsDiscardable): Do not change display ID.
2019-06-01 Dean Jackson <dino@apple.com>
Provide an action to save an image on a link sheet
https://bugs.webkit.org/show_bug.cgi?id=198464
Reviewed by Wenson Hsieh.
When providing the set of default actions for a link
sheet, if an URL to an image was provided then offer
the action to save that image to Photos.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
2019-06-01 Konstantin Tokarev <annulen@yandex.ru>
Remove include directives unused since r245186
https://bugs.webkit.org/show_bug.cgi?id=198463
Reviewed by Don Olmstead.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2019-05-31 Megan Gardner <megan_gardner@apple.com>
Ensure keyboard editing is up to date
https://bugs.webkit.org/show_bug.cgi?id=198444
<rdar://problem/36311563>
Reviewed by Ryosuke Niwa.
In order for the keyboard cut/copy/undo/redo/etc buttons to be up to date
based on the state of the selection, we need to let the input delegate know when the
selection has changed.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _selectionChanged]):
2019-05-31 Sihui Liu <sihui_liu@apple.com>
Remove outdated FIXME in StorageManager
https://bugs.webkit.org/show_bug.cgi?id=198049
Reviewed by Geoffrey Garen.
Previously StorageManager messages were dispatched and handled in the same thread, so we could perform a message
check. Now they are on different thread, and we would not be able to verify those parameters when dispatching
the message.
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
2019-05-31 Jiewen Tan <jiewen_tan@apple.com>
Teach AuxiliaryProcess about LoadOptimizer
https://bugs.webkit.org/show_bug.cgi?id=198443
<rdar://problem/51319120>
Reviewed by Brent Fulgham.
* Shared/ios/AuxiliaryProcessIOS.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
2019-05-31 Youenn Fablet <youenn@apple.com>
Add an option to mute audio capture automatically when page is not visible
https://bugs.webkit.org/show_bug.cgi?id=198307
Reviewed by Eric Carlson.
Add API to set the new runtime flag.
Make source proxy factories implement this automatic muting.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _interruptAudioOnPageVisibilityChangeEnabled]):
(-[WKPreferences _setInterruptAudioOnPageVisibilityChangeEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::setAudioCapturePageState):
(WebKit::UserMediaCaptureManager::setVideoCapturePageState):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Autocorrection menu font is Times New Roman when using font-family: UICTFontTextStyle*
https://bugs.webkit.org/show_bug.cgi?id=198427
<rdar://problem/50031825>
Reviewed by Tim Horton.
When UICTFontTextStyle* is specified as the font-family in an editable element, text in autocorrection bubbles
always uses Times New Roman font. This is because we send a font family name, font size, and font attributes to
the UI process when computing autocorrection data for UIKit, and then assemble this information into a UIFont
object via +[UIFont fontWithFamilyName:traits:size:]. However, in the case where UICTFontTextStyle* is specified
as the font-family in CSS, the font family that we send to the UI process ends up being ".AppleSystemUIFont",
which +fontWithFamilyName:traits:size: fails to map to the system font as intended.
To fix this, we propagate font information to the UI process by encoding the UIFont itself via IPC, which
serializes the font descriptor, and then deserializes into a UIFont in the UI process. This allows the system
font to be returned in -fontForCaretSelection, which is invoked by UIKit when determining the font for the
autocorrection bubble. See below for more details.
Test: AutocorrectionTests.FontAtCaretWhenUsingUICTFontTextStyle
* Shared/ios/WebAutocorrectionData.h: Copied from Source/WebKit/UIProcess/AutoCorrectionCallback.h.
* Shared/ios/WebAutocorrectionData.mm: Renamed from Source/WebKit/UIProcess/AutoCorrectionCallback.h.
(WebKit::WebAutocorrectionData::encode const):
(WebKit::WebAutocorrectionData::decode):
Introduce WebAutocorrectionData, a struct containing information used to show autocorrection UI on iOS (i.e.
highlights and the bubble). This consists of a list of rects, along with a UIFont.
* SourcesCocoa.txt:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Refactor requestAutocorrectionData to request a WebAutocorrectionData instead, and also use the new async IPC
reply mechanism.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView fontForCaretSelection]):
Grab the UIFont directly from the WebAutocorrectionData. Also, address a FIXME by scaling the font size by the
content scale.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::autocorrectionDataCallback): Deleted.
(WebKit::WebPageProxy::autocorrectionContextCallback): Deleted.
Remove some IPC callbacks that are now unused.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestAutocorrectionData):
2019-05-31 Ryosuke Niwa <rniwa@webkit.org>
[iOS] Reveal the focused element when it's immediately above software keyboard
https://bugs.webkit.org/show_bug.cgi?id=198412
Reviewed by Wenson Hsieh.
When _zoomToRevealFocusedElement is called with forceScroll set to NO (happens when input type is none or drawing
or when the platform is iPad), we don't force scrolling to reveal the focused element when it's entirely visible.
This can be misleading in cases where there is more content right beneath it relevant for editing operations.
Zoom & scroll to reveal the focused element when the said element is within 50px of the software keyboard.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2019-05-31 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r245899.
Seems to be causing crashes on iosmac
Reverted changeset:
"[iOS] UIProcess' background task expiration handler may get
called after the app is foreground again"
https://bugs.webkit.org/show_bug.cgi?id=198380
https://trac.webkit.org/changeset/245899
2019-05-31 Ryosuke Niwa <rniwa@webkit.org>
iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
https://bugs.webkit.org/show_bug.cgi?id=198244
Reviewed by Simon Fraser.
This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
we still need to make it scrollable when the page is pinch zoomed or there is a content inset
e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
outside the visual viewport when pinch zoomed or the parts of the page that is not outside
the visual viewport due to the scrolling caused by the software keyboard being brought up.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
2019-05-31 Geoffrey Garen <ggaren@apple.com>
Some WeakPtr typedef cleanup
https://bugs.webkit.org/show_bug.cgi?id=198431
Reviewed by Chris Dumez.
Use "using" instead of "typedef", since using is preferred in C++ for
better compatibility with templates.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
2019-05-31 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245953.
https://bugs.webkit.org/show_bug.cgi?id=198436
Broke quip (Requested by rniwa on #webkit).
Reverted changeset:
"iOS: Main frame should be scrollable when pinch zoomed or
software keyboard is up"
https://bugs.webkit.org/show_bug.cgi?id=198244
https://trac.webkit.org/changeset/245953
2019-05-31 Tim Horton <timothy_horton@apple.com>
Optionally respect device management restrictions when loading from the network
https://bugs.webkit.org/show_bug.cgi?id=198318
<rdar://problem/44263806>
Reviewed by Alex Christensen.
* Configurations/Network-iOS.entitlements:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
Add some entitlements and sandbox holes required to talk to DeviceManagement.
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::wasBlockedByRestrictions):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::wasBlockedByRestrictions):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::wasBlockedByRestrictions):
* NetworkProcess/PingLoad.h:
* Shared/WebErrors.cpp:
(WebKit::wasBlockedByRestrictionsError):
* Shared/WebErrors.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
(WebKit::NetworkDataTask::failureTimerFired):
* NetworkProcess/NetworkDataTask.h:
* Shared/API/APIError.h:
* Shared/API/c/WKErrorRef.cpp:
(WKErrorGetErrorCode):
* Shared/API/c/WKErrorRef.h:
Plumb a new error for loads that are blocked by device management restrictions.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
Plumb a new bit that indicates whether a load is for the main resource of a frame.
We will only apply device management restrictions to main resources.
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
Plumb a new bit indicating whether a network session should respect device mangement
restrictions.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::resume):
Defer resuming the load until we have a reply from DeviceManagement framework
about whether the URL should be blocked. If it is blocked, instead fail the load.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::deviceManagementPolicyMonitor):
Cache a single DMFWebsitePolicyMonitor instance per NetworkSession.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
The default data store is persistent; its configuration should reflect that.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]): Style.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
Make it possible to create a non-persistent WKWebsiteDataStore from a
configuration, and ensure that it does not have any persistent storage directories set.
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration init]):
(-[_WKWebsiteDataStoreConfiguration initWithNonPersistentConfiguration]):
(-[_WKWebsiteDataStoreConfiguration isPersistent]):
(-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
(-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
(-[_WKWebsiteDataStoreConfiguration deviceManagementRestrictionsEnabled]):
(-[_WKWebsiteDataStoreConfiguration setDeviceManagementRestrictionsEnabled:]):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::isPersistent const):
(WebKit::WebsiteDataStoreConfiguration::setPersistent):
(WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota const):
(WebKit::WebsiteDataStoreConfiguration::deviceManagementRestrictionsEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setDeviceManagementRestrictionsEnabled):
(WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota): Deleted.
Make it possible to create a _WKWebsiteDataStoreConfiguration that will create a non-persistent
data store. Add a bit to _WKWebsiteDataStoreConfiguration that controls whether the network
session will respect device management restrictions.
* WebKit.xcodeproj/project.pbxproj:
* WebKit/NetworkProcess/cocoa/DeviceManagementSoftLink.h:
* WebKit/NetworkProcess/cocoa/DeviceManagementSoftLink.mm:
* WebKit/Platform/spi/Cocoa/DeviceManagementSPI.h:
Add some soft-linking and SPI headers.
2019-05-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245943.
Caused API test WKWebView.LocalStorageProcessSuspends to fail
on release bots.
Reverted changeset:
"WKWebsiteDataStore API fails to fetch web storage data for
non-persistent data store"
https://bugs.webkit.org/show_bug.cgi?id=198317
https://trac.webkit.org/changeset/245943
2019-05-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245946.
Breaks the watchOS build.
Reverted changeset:
"Add an option to mute audio capture automatically when page
is not visible"
https://bugs.webkit.org/show_bug.cgi?id=198307
https://trac.webkit.org/changeset/245946
2019-05-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WPERenderer: ensure we complete the last frame when leaving AC mode
https://bugs.webkit.org/show_bug.cgi?id=198372
Reviewed by Michael Catanzaro.
It can happen that we leave AC mode after a new image is received from the web process but before it's
committed. It can also happen that we receive a new image from the web process right after we have left AC
mode. In both cases we need to complete the frame to ensure we don't leave the wayland compositor waiting
forever for a frame to be completed.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::update): Complete any pending image when a new surface is used.
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Complete the given image and return early if we already
left AC mode.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
2019-05-31 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] WPERenderer: do not release the host file descritor when initializing the render target
https://bugs.webkit.org/show_bug.cgi?id=198371
Reviewed by Michael Catanzaro.
We are assuming that there will always be only one target for a web page. In the GTK port we destroy the render
target when leaving AC mode, and a new one is created when re-entering AC mode. Since the file descriptor is
released on the first target and adopted by libwpe, the second target passes -1 as host fd to libwpe, and the
new surface created by the target is not properly registered in the wayland compositor. That means that frame
requests for the new target are simply ignored by the wayland compositor, it returns early on surfacxe frame
when the surface doesn't have a view backend client.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::hostFileDescriptor const): Rename it and make it const.
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
(WebKit::AcceleratedSurfaceLibWPE::initialize): Pass a duplicated file descriptor to
wpe_renderer_backend_egl_target_create().
2019-05-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Fix memory leak introduced in r245807
https://bugs.webkit.org/show_bug.cgi?id=198369
Reviewed by Michael Catanzaro.
We should destroy the wpe_view_backend_exportable_fdo created in AcceleratedBackingStoreWayland.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
2019-05-31 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r244182): [GTK] Web view no longer updated after re-entering AC mode
https://bugs.webkit.org/show_bug.cgi?id=198367
Reviewed by Sergio Villar Senin.
This happens because we leave accelerated compositing mode when a rendering update is scheduled in
RenderingUpdateScheduler. The ThreadedDisplayRefreshMonitor is destroyed without completing the
frame, so that the RenderingUpdateScheduler is left scheduled forever, ignoring any new schedule request. We
need to ensure we complete the frame request before destroying the display refresh monitor to leave the
RenderingUpdateScheduler in a consistent state.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::invalidate):
2019-05-30 Ryosuke Niwa <rniwa@webkit.org>
iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
https://bugs.webkit.org/show_bug.cgi?id=198244
Reviewed by Simon Fraser.
This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
we still need to make it scrollable when the page is pinch zoomed or there is a content inset
e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
outside the visual viewport when pinch zoomed or the parts of the page that is not outside
the visual viewport due to the scrolling caused by the software keyboard being brought up.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
2019-05-30 Youenn Fablet <youenn@apple.com>
Add an option to mute audio capture automatically when page is not visible
https://bugs.webkit.org/show_bug.cgi?id=198307
Reviewed by Eric Carlson.
Add API to set the new runtime flag.
Make source proxy factories implement this automatic muting.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _interruptAudioOnPageVisibilityChangeEnabled]):
(-[WKPreferences _setInterruptAudioOnPageVisibilityChangeEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::setAudioCapturePageState):
(WebKit::UserMediaCaptureManager::setVideoCapturePageState):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2019-05-30 Sihui Liu <sihui_liu@apple.com>
WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
https://bugs.webkit.org/show_bug.cgi?id=198317
<rdar://problem/51244662>
Reviewed by Alex Christensen.
Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or
websiteDataStore.
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::isEphemeral const):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::setItems):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
(WebKit::StorageManager::LocalStorageNamespace::cloneTo):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::suspend):
(WebKit::StorageManager::resume):
(WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:
(): Deleted.
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchStorageEvent):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::connect):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2019-05-30 Youenn Fablet <youenn@apple.com>
REGRESSION (r245873) [Mac WK2] Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash after running new test
https://bugs.webkit.org/show_bug.cgi?id=198379
<rdar://problem/51264361>
Reviewed by Alex Christensen.
This case can happen when network process is crashing.
Given the WebSWClientConnection may be kept alive, it might reregister itself but in that case will never be unregistered.
Remove the WebSWClientConnection from the NetworkProcessConnection corresponding map on destruction time.
Covered by no longer crashing tests.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::removeSWClientConnection):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::~WebSWClientConnection):
2019-05-30 Chris Dumez <cdumez@apple.com>
Network process crash when decoding SecItemResponseData
https://bugs.webkit.org/show_bug.cgi?id=198388
<rdar://problem/50408046>
Reviewed by Alex Christensen.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode):
When decoding the elements inside a CFArrayRef, if decoding was successful but
the CFTypeRef element is still null then skip it instead of trying to append it
to the array. A CFArray container is not allowed to contain null.
Some of our decoders for CFTypeRef types may not initialize the element even if
the decode() function returns true. For example, the decoders for CFArrayRef and
CFDictionaryRef return true if the encoded container was null but do not create
a container.
* Shared/mac/SecItemResponseData.cpp:
(WebKit::SecItemResponseData::SecItemResponseData):
nit: The wrong parameter was being moved. This is more efficient.
(WebKit::SecItemResponseData::encode const):
nit: Drop unnecessary .get().
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::secItemRequest):
nit: Use nullptr instead of 0.
2019-05-30 Sihui Liu <sihui_liu@apple.com>
Stop StorageManager when network process is ready to suspend
https://bugs.webkit.org/show_bug.cgi?id=198201
<rdar://problem/49683172>
Reviewed by Youenn Fablet.
To avoid local storage database operations that can hold lock to database files, suspend thread of
StorageManager when network process is about to suspend.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::resume):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::suspend):
(WebKit::StorageManager::resume):
* NetworkProcess/WebStorage/StorageManager.h:
2019-05-30 Wenson Hsieh <wenson_hsieh@apple.com>
Missing caret when focusing an editable field if the selection was set when WKWebView wasn't first responder
https://bugs.webkit.org/show_bug.cgi?id=198356
<rdar://problem/50798593>
Reviewed by Tim Horton.
In this bug, the DOM selection is initially set by script in a web view that is not the first responder. Then,
either the user begins editing by tapping somewhere such that the selection does not change, or an editable
element is programmatically focused and the client allows programmatic focus to show the keyboard. This is
because the selection clipping rect used by the UI process when computing the bounds of the caret view is empty,
causing the entire caret to be clipped.
This is due to two related issues: first, no updated editor state is sent to the UI process after the element is
focused, if the selection has not also changed. This means that while the selection geometry is sent over to the
UI process, the selection clipping rect (a member of the EditorState's PostLayoutData called
"focusedElementRect") becomes stale in the UI process, since the there was no focused element when the
previously computed editor state was sent to the UI process. To fix this, we schedule a full editor state update
when an element is focused, to ensure that the selection is eventually updated in the UI process.
Secondly, even once the editor state update is sent to the UI process, we will actually avoid updating any text
selection views, since there is no change in WKSelectionDrawingInfo, which currently consists of a selection
type, and either a caret rect or a list of selection rects. However, since selection drawing is also affected by
the selection clipping rect, it seems reasonable to add the selection clipping rect to the drawing info, and
trigger a selection update if this selection clipping rect has changed.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
Add selectionClippingRect to WKSelectionDrawingInfo, and check against it when comparing two drawing infos.
(WebKit::operator==):
(WebKit::operator<<):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidFocus):
Schedule an editor state update when focusing an element. In many cases, an editor state update has already been
scheduled when focusing an element, so this becomes a no-op; however, in this scenario, it delivers updated
selection clipping rects (i.e. the focused element rect) and other updated information to the UI process.
2019-05-30 David Quesada <david_quesada@apple.com>
REGRESSION (r245756) [Mac] 2 TestWebKitAPI.DownloadProgress* and TestWebKitAPI._WKDownload.DownloadMonitorCancel are flaky timeouts
https://bugs.webkit.org/show_bug.cgi?id=198298
rdar://problem/51182393
Reviewed by Alexey Proskuryakov.
When canceling a download, there has always been a race condition between:
(A) the execution of Download::didCancel() within the block passed to
-[NSURLSessionDownloadTask cancelByProducingResumeData:] within
Download::platformCancelNetworkLoad(), and
(B) the invocation of -[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]
If A happens before B, the block calls didCancel() on the download, which reports the
cancellation to the UI process and tears down the download. When B happens, WKNetworkSessionDelegate
gracefully handles the fact that the Download has been removed from the map, and nothing
else happens. Life is good.
If B happens before A, -URLSession:task:didCompleteWithError: invokes Download::didFail(),
which reports a download failure (*not* a cancellation) to the UI process and tears down
the Download and DownloadProxy. On release builds, this can leave the tests waiting for a
cancellation until they time out. When A happens, the block calls Download::didCancel().
This messages the UI process, which results in a debug assertion failure from an unhandled
message since the DownloadProxy was torn down when the failure was reported. Meanwhile,
the network process hits a debug assertion in DownloadManager::downloadFinished() when
trying to remove the Download *again*.
r245756 made the bad case (B before A) more likely by adding a delay before didCancel()
is called.
Make this race condition impossible by eliminating the didCancel() from the cancellation
block, and instead relying on -URLSession:task:didCompleteWithError: to report the
download as canceled. This also effectively coalesces calls to platformCancelNetworkLoad(),
which, if called multiple times before CFNetwork reports that the download was canceled,
could cause multiple calls to didCancel(), resulting in the same assertion failures seen
in the B-before-A case.
No new tests, as recreating this race condition in the test scenario would require
additional machinery, and is no longer even possible since we don't depend on the calling
of the cancellation handler in order to report the Download as canceled.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::cancel):
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::wasCanceled const):
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformCancelNetworkLoad):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2019-05-30 Chris Dumez <cdumez@apple.com>
[iOS] UIProcess' background task expiration handler may get called after the app is foreground again
https://bugs.webkit.org/show_bug.cgi?id=198380
<rdar://problem/49762471>
Reviewed by Geoffrey Garen.
UIProcess' background task expiration handler may get called after the app is foreground again. When
this happens, we already have a foreground assertion on behalf of the WebContent process, and the view
is visible. We would send the WillSuspendImminently IPC to the WebContent process, which would freeze
its layers, even though it is visible on screen.
To address the issue, we now check if the app is visible in the expiration handler. If it is visible,
we do not notify clients of imminent suspension. Instead, we end the background task right away and
call _updateBackgroundTask asynchronously to start a new background task if necessary.
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2019-05-30 Chris Dumez <cdumez@apple.com>
[iOS] Third-party extensions using WKWebView are unable to render anything
https://bugs.webkit.org/show_bug.cgi?id=198359
<rdar://problem/51105015>
Reviewed by Brent Fulgham and Geoff Garen.
Third-party extensions using WKWebView are unable to render anything because we do not get notified
when the extension's visibility changes. Because we do not recognize the extension showing the
WebView to be foreground, we do not take a process assertion on behalf of the child processes and
they get suspended before they get a chance to render anything.
The root of the issue is that WebKit was relying on BKSApplicationStateMonitor.handler to get
notified when the extension's state switches between foreground and background. However, the handler
never gets called unless the extension has an appropriate entitlement.
To address the issue, we now use the same logic for extensions and we do for view services.
I have verified that the _UIViewServiceHostDidEnterBackgroundNotification / _UIViewServiceHostWillEnterForegroundNotification
notifications get sent to the extensions (even third-party). We also properly detect MobileSafari as
host application and are able to get MobileSafari's foreground state accurately.
* UIProcess/ApplicationStateTracker.mm:
2019-05-30 Wenson Hsieh <wenson_hsieh@apple.com>
Rare crash under `WebPage::shouldIgnoreMetaViewport const` when shrinking to fit content
https://bugs.webkit.org/show_bug.cgi?id=198374
<rdar://problem/51261348>
Reviewed by Tim Horton.
This is a speculative fix for the crash; what appears to be happening is that the shrink-to-fit-content timer
is somehow being scheduled after the page has already been closed. We can probably fix this by bailing when
scheduling shrink-to-fit-content if m_isClosed is true.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::scheduleShrinkToFitContent):
(WebKit::WebPage::immediatelyShrinkToFitContent):
2019-05-30 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r245881.
Broke 13 Layout tests on WK2
Reverted changeset:
"WKWebsiteDataStore API fails to fetch web storage data for
non-persistent data store"
https://bugs.webkit.org/show_bug.cgi?id=198317
https://trac.webkit.org/changeset/245881
2019-05-30 Philippe Normand <pnormand@igalia.com>
Unreviewed, WPE without a11y support build fix.
* UIProcess/wpe/WebPageProxyWPE.cpp: Include atk headers only when enabled.
2019-05-29 Wenson Hsieh <wenson_hsieh@apple.com>
Remove some logic to suppress the text selection assistant during drop
https://bugs.webkit.org/show_bug.cgi?id=198354
Reviewed by Tim Horton.
This logic was originally added to hide the ranged selection after performing a drop in editable content.
However, after r245803, we (1) no longer show the keyboard and/or text selection views when dropping, and (2)
the final selection is now a caret, so it's no longer necessary to suppress the selection assistant.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:concludeDrop:]):
2019-05-29 Sihui Liu <sihui_liu@apple.com>
WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
https://bugs.webkit.org/show_bug.cgi?id=198317
Reviewed by Alex Christensen.
Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or
websiteDataStore.
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::isEphemeral const):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::setItems):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
(WebKit::StorageManager::LocalStorageNamespace::cloneTo):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:
(): Deleted.
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchStorageEvent):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::connect):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2019-05-29 Don Olmstead <don.olmstead@sony.com>
Remove ENABLE definitions from WebKit config files
https://bugs.webkit.org/show_bug.cgi?id=197858
Reviewed by Simon Fraser.
Remove ENABLE flags that were present in the config files. Add the ENABLE flags
to FeatureDefines.xcconfig instead.
* Configurations/FeatureDefines.xcconfig:
* WebKit2Prefix.h:
* config.h:
2019-05-29 Youenn Fablet <youenn@apple.com>
Reestablish WebSWClientConnection in case of network process crash
https://bugs.webkit.org/show_bug.cgi?id=198333
Reviewed by Alex Christensen.
WebSWClientConnection now takes a RefPtr<IPC::Connection> so that on network process crash, it will set it back to null.
On the next call that needs the connection, WebSWClientConnection will reinitialize its underlying IPC connection and its own identifier.
Make sure that all code paths requiring this initialization are covered.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
(WebKit::NetworkProcessConnection::isRegisteredActiveSWClientConnection):
(WebKit::NetworkProcessConnection::initializeSWClientConnection):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::~WebSWClientConnection):
(WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
(WebKit::WebSWClientConnection::ensureConnectionAndSend):
(WebKit::WebSWClientConnection::scheduleJobInServer):
(WebKit::WebSWClientConnection::finishFetchingScriptInServer):
(WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
(WebKit::WebSWClientConnection::didResolveRegistrationPromise):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::runOrDelayTaskForImport):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
(WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWClientConnection::connectionToServerLost):
(WebKit::WebSWClientConnection::syncTerminateWorker):
(WebKit::WebSWClientConnection::serverConnectionIdentifier const):
(WebKit::WebSWClientConnection::updateThrottleState):
* WebProcess/Storage/WebSWClientConnection.h:
2019-05-29 Said Abou-Hallawa <sabouhallawa@apple.com>
[iOS] WebPage::positionInformation() may set InteractionInformationAtPosition.isImage to true but leave image unset
https://bugs.webkit.org/show_bug.cgi?id=198202
Reviewed by Tim Horton.
r192037 added the flags isLink and isImage to InteractionInformationAtPosition.
It also made WebPage::positionInformation() set isImage to true but before
ensuring there is a valid image at the position.
Safari WebKit additions assumes if isImage is true then the image has to
hold a valid ShareableBitmap pointer. Since WebPage::positionInformation()
is the only place that sets isImage, the fix is to set isImage to true
only after passing all the image validation checks.
Since WebPage::positionInformation() is a little bit difficult to read
(182 lines), It was re-factored by splitting it to static functions.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::focusedElementPositionInformation):
(WebKit::linkIndicatorPositionInformation):
(WebKit::dataDetectorLinkPositionInformation):
(WebKit::imagePositionInformation):
(WebKit::boundsPositionInformation):
(WebKit::elementPositionInformation):
(WebKit::selectionPositionInformation):
(WebKit::textInteractionPositionInformation):
(WebKit::WebPage::positionInformation):
2019-05-29 Geoffrey Garen <ggaren@apple.com>
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799
Reviewed by Youenn Fablet.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::networkSession):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::suspendedPage const):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
functions out of line to avoid #include explosion for .get().
* UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
(WebKit::SecKeyProxyStore::get const):
(WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
CanMakeWeakPtr.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.
(WebKit::WebProcessProxy::processPool const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const): Deleted. Moved
functions out of line to avoid #include explosion for .get().
2019-05-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245857.
Breaks internal builds.
Reverted changeset:
"WeakPtr breaks vtables when upcasting to base classes"
https://bugs.webkit.org/show_bug.cgi?id=188799
https://trac.webkit.org/changeset/245857
2019-05-29 Chris Dumez <cdumez@apple.com>
[iOS] The WebContent process needs proper entitlement to do secure drawing
https://bugs.webkit.org/show_bug.cgi?id=198343
<rdar://problem/50671257>
Reviewed by Tim Horton.
The WebContent process needs proper entitlement to do secure drawing on iOS.
* Configurations/WebContent-iOS.entitlements:
2019-05-29 Youenn Fablet <youenn@apple.com>
UserMediaCaptureManager should remove a source from its map once the source is ended
https://bugs.webkit.org/show_bug.cgi?id=198337
Reviewed by Eric Carlson.
When the source is stopped, for instance using MediaStreamTrack.stop,
remove the source from UserMediaCaptureManager sources map.
This makes sure the map will not grow over time.
Add an if check to ensure that the source is still there before processing an incoming IPC call.
When UIProcess tells us the capture is finished (typically capture failed), remove the entry on WebProcess side as well.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::sourceStopped):
(WebKit::UserMediaCaptureManager::captureFailed):
(WebKit::UserMediaCaptureManager::sourceMutedChanged):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::storageChanged):
(WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
(WebKit::UserMediaCaptureManager::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
(WebKit::UserMediaCaptureManager::sourceEnded):
(WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):
2019-05-29 Youenn Fablet <youenn@apple.com>
UserMediaCaptureManagerProxy::SourceProxy should directly have access to its IPC connection
https://bugs.webkit.org/show_bug.cgi?id=198335
Reviewed by Eric Carlson.
Previously, SourceProxy was getting its IPC connection by going through its manager, then its process proxy.
As some calls can be done from a background thread, it is safer to directly make SourceProxy own a Ref of its IPC connection.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2019-05-28 Geoffrey Garen <ggaren@apple.com>
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799
Reviewed by Youenn Fablet.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::networkSession):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::suspendedPage const):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
functions out of line to avoid #include explosion for .get().
* UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
(WebKit::SecKeyProxyStore::get const):
(WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
CanMakeWeakPtr.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.
(WebKit::WebProcessProxy::processPool const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const): Deleted. Moved
functions out of line to avoid #include explosion for .get().
2019-05-29 Youenn Fablet <youenn@apple.com>
Modernize getting proxies of UserMediaCaptureManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=198336
Reviewed by Eric Carlson.
No change of behavior, use HashMap::get instead of find.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
(WebKit::UserMediaCaptureManagerProxy::capabilities):
(WebKit::UserMediaCaptureManagerProxy::setMuted):
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2019-05-29 Andy Estes <aestes@apple.com>
[watchOS] Remove an unneeded #import
https://bugs.webkit.org/show_bug.cgi?id=198339
<rdar://problem/51195415>
Reviewed by Wenson Hsieh.
* UIProcess/ios/forms/WKTimePickerViewController.mm:
2019-05-29 Brent Fulgham <bfulgham@apple.com>
Correct flaky WebAuthN test cases
https://bugs.webkit.org/show_bug.cgi?id=198308
<rdar://problem/48677219>
Reviewed by David Kilzer.
Correct offset math in the MockHidConnection implementation. The write position of
the payload buffer was computed using the value of 'size()', which is set to the full
capacity of the vector after a 'grow()' operation.
Tests: http/wpt/webauthn
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::feedReports):
2019-05-28 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] REGRESSION(r245186) Crash in NetworkCache::IOChannel::read in http/tests/IndexedDB some tests
https://bugs.webkit.org/show_bug.cgi?id=197941
Reviewed by Don Olmstead.
http/tests/IndexedDB some tests were crashing in
NetworkCache::IOChannel::read in order to allocate a buffer with
std::numeric_limits<size_t>::max() as the size.
IOChannel::read should check the file size, and calculate the read
size.
* NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
(WebKit::NetworkCache::IOChannel::read): Limit the read buffer
size by calling FileSystem::getFileSize.
2019-05-28 Brent Fulgham <bfulgham@apple.com>
Fix sandbox violation when using QuickLook on iOS
https://bugs.webkit.org/show_bug.cgi?id=198312
<rdar://problem/51134351>
Reviewed by Alexey Proskuryakov.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-05-28 Tim Horton <timothy_horton@apple.com>
Horizontal scrollbar flashes after scrolling vertically with keyboard
https://bugs.webkit.org/show_bug.cgi?id=197942
<rdar://problem/46169578>
Reviewed by Dean Jackson.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(axesForDelta):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
Only flash relevant axes.
* Platform/spi/ios/UIKitSPI.h:
2019-05-28 Alex Christensen <achristensen@webkit.org>
Build Fix.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController IGNORE_WARNINGS_END]):
(-[WKImagePreviewViewController previewActionItems]): Deleted.
2019-05-28 Tim Horton <timothy_horton@apple.com>
REGRESSION(r245795): causing internal testers to exit early after 50 crashes.
https://bugs.webkit.org/show_bug.cgi?id=198310
<rdar://problem/51192535>
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::touchActionsForPoint):
Initialize hitView to nil.
2019-05-28 Brent Fulgham <bfulgham@apple.com>
Remove dead code from sandboxes
https://bugs.webkit.org/show_bug.cgi?id=198300
Reviewed by Alexey Proskuryakov.
SSIA.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-28 Brent Fulgham <bfulgham@apple.com>
Update sandbox rules for more News use cases
https://bugs.webkit.org/show_bug.cgi?id=198236
<rdar://problem/50054027>
Reviewed by Alexey Proskuryakov.
Update the WebContent and Network process sandboxes so that News has the same set of allowed
service access as regular WebKit views.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
https://bugs.webkit.org/show_bug.cgi?id=197944
Reviewed by Michael Catanzaro.
The WPEBackend-fdo implementation is quite similar to our Wayland nested compositor, but more efficient (using
linux dmabuf, resource caching, etc.). This allows us to share even more code with WPE port too.
* PlatformGTK.cmake:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::forceRepaint): WPE doesn't support force repaint yet.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
(WebKit::WebPageCreationParameters::decode): Ditto.
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Ditto.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* SourcesGTK.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor): Implement it when using WPE just calling webkitWebViewBaseRenderHostFileDescriptor().
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreateWebPage): Initialize the web page after the accelerated backing store is created, since
it's used now during intialization.
(webkitWebViewBaseRenderHostFileDescriptor): Return AcceleratedBackingStore::renderHostFileDescriptor()
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Remove wayland display name initialization.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Initialize wayland display name when not using WPE here
now. In case of using WPE, initialize hostClientFileDescriptor and implementationLibraryName.
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Remove unused wayland socket command line process parameter.
* UIProcess/gtk/AcceleratedBackingStore.h:
(WebKit::AcceleratedBackingStore::renderHostFileDescriptor): Return -1 by default.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::create): When using WPE call wpe_fdo_initialize_for_egl_display() and
check we have the required extensions.
(WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): When using WPE initialize the view backend.
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): When using WPE release the EGL images
still in use and the view texture.
(WebKit::AcceleratedBackingStoreWayland::renderHostFileDescriptor): Call wpe_view_backend_get_renderer_host_fd().
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Create the view texture if needed, save the pending
image and schedule a redraw.
(WebKit::AcceleratedBackingStoreWayland::paint): When using WPE commit the pending image and use it as target of
the view texture.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager): When using WPE disable hardware acceleration
if wpe_fdo_initialize_for_egl_display() fails.
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WaylandCompositor.h:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create): Create an AcceleratedSurfaceLibWPE for GTK port when using WPE and shared
display is Wayland.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
(WebKit::AcceleratedSurfaceLibWPE::initialize): Use the shared display for compositing instead of shared display.
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:
* WebProcess/WebProcess.h:
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Initialize the wpe display when using WPE.
2019-05-27 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Dropping in an editable element should result in a ranged selection
https://bugs.webkit.org/show_bug.cgi?id=198267
<rdar://problem/51145977>
Reviewed by Tim Horton.
When drag and drop was first implemented for iOS in iOS 11, selection behavior when dropping into editable
elements matched that of macOS, by leaving the inserted content selected after performing the drop. However, in
other parts of the platform (e.g. Notes), both the keyboard and selection views are not shown after a drop.
Instead of matching macOS behavior, WebKit on iOS should match the rest of the platform. This is a little
tricky, since we use the selection range after a drop to create a TextIndicator snapshot when creating a drag
preview. To resolve this, we refactor some of the logic introduced in r245778 to remember the DOM range to
snapshot before collapsing the range to the end of the inserted content.
Tested by adjusting some existing API tests.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
Remove some logic that currently presents the keyboard while the user is performing a drop that focuses an
editable element.
* WebProcess/WebPage/WebPage.h:
Add a member variable to keep track of which range should be snapshotted when generating a drop preview.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeDrop):
(WebKit::WebPage::didConcludeEditDrag):
Collapse the selection range to the end after an edit drag (i.e., a drop in an editable area that inserted
content).
(WebKit::WebPage::computeAndSendEditDragSnapshot):
2019-05-27 Chris Dumez <cdumez@apple.com>
Unreviewed Win Cairo build fix after r245796.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
2019-05-27 Chris Dumez <cdumez@apple.com>
Unreviewed Win Cairo build fix after r245796.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
2019-05-27 Chris Dumez <cdumez@apple.com>
Use a strongly-typed identifier for pages
https://bugs.webkit.org/show_bug.cgi?id=198206
Reviewed by Youenn Fablet.
* WebKit/*:
2019-05-27 Antoine Quint <graouts@apple.com>
[Pointer Events] Test at pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html times out
https://bugs.webkit.org/show_bug.cgi?id=198275
<rdar://problem/50618496>
Reviewed by Antti Koivisto.
Only WKCompositingView instances may have associated touch-action data, so we should filter out any hit-testing view
that isn't a WKCompositingView when finding the view that should hit-test when looking for touch-action information.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::touchActionsForPoint):
2019-05-27 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.1 release
* gtk/NEWS: Add release notes for 2.25.1.
2019-05-27 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK distcheck
Remove symbols that are not longer present in the library.
* webkitglib-symbols.map:
2019-05-26 Simon Fraser <simon.fraser@apple.com>
Move VelocityData to WebCore
https://bugs.webkit.org/show_bug.cgi?id=198261
Reviewed by Antti Koivisto.
Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll.
VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
the timetamp for the entire update).
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::scrollVelocity const):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView const):
(WebKit::VisibleContentRectUpdateInfo::timestamp const):
(WebKit::operator==):
(WebKit::VisibleContentRectUpdateInfo::horizontalVelocity const): Deleted.
(WebKit::VisibleContentRectUpdateInfo::verticalVelocity const): Deleted.
(WebKit::VisibleContentRectUpdateInfo::scaleChangeRate const): Deleted.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<VelocityData>::encode):
(IPC::ArgumentCoder<VelocityData>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(WebKit::HistoricalVelocityData::VelocityData::VelocityData): Deleted.
(WebKit::HistoricalVelocityData::HistoricalVelocityData): Deleted.
(WebKit::HistoricalVelocityData::velocityForNewData): Deleted.
(WebKit::HistoricalVelocityData::clear): Deleted.
(WebKit::HistoricalVelocityData::append): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::adjustVelocityDataForBoundedScale):
(WebKit::WebPage::updateVisibleContentRects):
2019-05-26 John Wilander <wilander@apple.com>
Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration
https://bugs.webkit.org/show_bug.cgi?id=198227
<rdar://problem/51117258>
Reviewed by Alex Christensen.
This patch adds a call back to the UI process if the network process finds the navigational
data transfer was done by a prevalent resource and we need to adjust something for the page.
Currently, that adjustment is to downgrade document.referrer.
The patch also removes an unused completion handler.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration): Deleted.
New name since we no longer only look for link decoration but also other means of navigational data transfer.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration): Deleted.
New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::checkIfNavigationContainsDataTransfer):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::isNonUniqueNavigationWithLinkDecoration): Deleted.
New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration): Deleted.
New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::wasLoadedWithDataTransferFromPrevalentResource):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-05-26 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Dropped text, attachments, and images should animate into place
https://bugs.webkit.org/show_bug.cgi?id=198243
<rdar://problem/35205373>
Reviewed by Tim Horton.
Adds support for targeted drop animations on iOS in modern WebKit by adopting UIKit SPI introduced in
<rdar://problem/31075005> to allow updating the drop preview mid-flight. To get the animation right, we refactor
and augment existing logic for taking snapshots after performing a drop in an editable content.
Currently, upon dropping in editable content, we first snapshot the web view and temporarily cover the real web
view with this snapshot. When the TextIndicator data arrives that contains (1) a snapshot of the visible part of
the web view ignoring the selection, and (2) a snapshot of just the selected contents after drop, we crossfade
from the web view snapshot to the snapshot in (1) using a hard-coded time delay (~500ms), and target the drop
preview to the drag caret rect. During this process, snapshot (2) is completely ignored.
This was effectively a halfway implemention of the desired effect of animating the dropped content into place
and crossfading to the final content; before UIKit implemented updateable drag previews, the full implementation
was not possible in modern WebKit (without using synchronous IPC).
Now that we're able to update the drag preview in the middle of the drop animation, we can now utilize snapshot
(2) above and clean up some parts of the drop animation in editable content. See below for more details.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):
Add a testing hook to perform the given block after any pending edit drag snapshot has been received. See
TestWebKitAPI changes for more detail.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Split up the existing DidConcludeEditDrag IPC message into two messages: WillReceiveEditDragSnapshot and
DidReceiveEditDragSnapshot. This allows us to defer cleaning up the drag session state during an edit drop,
until after the final edit drag snapshot has been received.
* UIProcess/ios/DragDropInteractionState.h:
Add some new methods to help manage the lifecycle of drop preview provider blocks.
* UIProcess/ios/DragDropInteractionState.mm:
(WebKit::createTargetedDragPreview):
Drive-by fix: make this return a RetainPtr.
(WebKit::DragDropInteractionState::prepareForDelayedDropPreview):
Stores a drop preview provider, given to us by UIKit.
(WebKit::DragDropInteractionState::deliverDelayedDropPreview):
Invokes the stored drop preview providers with given text indicator data. This is invoked after snapshots are
taken following an edit drag (this is additionally after all images in the inserted fragment have finished
loading).
(WebKit::DragDropInteractionState::clearAllDelayedItemPreviewProviders):
Invokes all stored drop preview providers with a nil preview. This is invoked in any case where drag session
cleanup occurs earlier than normal (e.g., if the web process crashes during drop), and ensures that the handlers
are always invoked when cleaning up the drag session.
(WebKit::DragDropInteractionState::previewForDragItem const):
(WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
Call clearAllDelayedItemPreviewProviders.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::willReceiveEditDragSnapshot):
(WebKit::PageClientImpl::didReceiveEditDragSnapshot):
(WebKit::PageClientImpl::didConcludeEditDrag): Deleted.
More plumbing (see changes to DidConcludeEditDrag above).
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView cleanUpDragSourceSessionState]):
(-[WKContentView _willReceiveEditDragSnapshot]):
(-[WKContentView _didReceiveEditDragSnapshot:]):
Set _waitingForEditDragSnapshot to YES in the gap between when -_willReceiveEditDragSnapshot is invoked, and
when -_didReceiveEditDragSnapshot is invoked. If _waitingForEditDragSnapshot is YES, we bail out of
-cleanUpDragSourceSessionState, and instead clean up drag session state after the edit drag snapshot is
received.
(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView textEffectsWindow]):
Drive-by fix to remove a workaround for a deprecation warning.
(-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):
(-[WKContentView dropInteraction:concludeDrop:]):
Implement this hook to ensure that the unselected content snapshot view and visible content snapshot view are
guaranteed to be removed from the view after a drop in editable content, even if the drag edit snapshot arrives
after the drop is concluded.
(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
(-[WKContentView _dropInteraction:delayedPreviewProviderForDroppingItem:previewProvider:]):
Implement the new UIKit SPI here. UIKit hands us a preview provider here, which we can invoke at a later time
to update the drop preview. We do this in _didReceiveEditDragSnapshot.
(-[WKContentView _doAfterReceivingEditDragSnapshotForTesting:]):
(-[WKContentView _didConcludeEditDrag:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::willReceiveEditDragSnapshot):
(WebKit::WebPageProxy::didReceiveEditDragSnapshot):
(WebKit::WebPageProxy::didConcludeDrop):
(WebKit::WebPageProxy::didConcludeEditDrag): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didFinishLoadingImageForElement):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didFinishLoadingImageForElement):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeDrop):
If an edit drag has been concluded, there's no need to hang on to pending dropped image elements anymore; clear
out the set here.
(WebKit::WebPage::didConcludeEditDrag):
After concluding an edit drag, we try to deliver two web content snapshots to the UI process, so that the UI
process can assemble a targeted drop preview for UIKit. One snapshot is of the visible content area, not
including any selected content. The other snapshot is of the selected content only. However, when dropping
images (or a text selection containing images), these images may not yet have been loaded. If that is the case,
these images will appear to be missing from these snapshots.
To ensure that we don't take this snapshot too early, defer it until all image elements in the dropped content
range have finished loading. We can tell that all dropped images have finished loading by using a new client
hook that is invoked when an image has finished loading.
(WebKit::WebPage::didFinishLoadingImageForElement):
(WebKit::WebPage::computeAndSendEditDragSnapshot):
Snapshot the selected content and send it to the UI process.
2019-05-24 Youenn Fablet <youenn@apple.com>
REGRESSION (r245715?) [WK2] Layout Test http/wpt/cache-storage/cache-storage-networkprocess-crash.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=198222
<rdar://problem/51114899>
Reviewed by Alex Christensen.
In case a connection gets closed, handle all of its async reply completion handlers.
This ensures they handlers are called in case the connection does not get destroyed until a much later stage.
* Platform/IPC/Connection.cpp:
(IPC::Connection::~Connection):
(IPC::Connection::connectionDidClose):
(IPC::addAsyncReplyHandler):
(IPC::clearAsyncReplyHandlers):
(IPC::CompletionHandler<void):
2019-05-24 Per Arne Vollan <pvollan@apple.com>
Remove unused member in WebsiteDataRecord
https://bugs.webkit.org/show_bug.cgi?id=198231
Reviewed by Brent Fulgham.
The data member 'originsWithCredentials' in WebsiteDataRecord is no longer needed since origins
with credentials are now stored in the 'origins' member.
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::addOriginWithCredential): Deleted.
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
2019-05-24 David Quesada <david_quesada@apple.com>
Crash under WebCore::TimerBase::~TimerBase after a download is canceled
https://bugs.webkit.org/show_bug.cgi?id=197927
rdar://problem/50822728
Reviewed by Ryosuke Niwa.
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformCancelNetworkLoad):
CFNetwork makes no guarantees about what thread is used to call the completion block
passed to -[NSURLSessionDownloadTask cancelByProducingResumeData], and in some cases,
it can be called on a background queue. This eventually causes the Download to be
deallocated on the background queue, which triggers a release assertion failure in
~TimerBase. When CFNetwork finishes canceling the download, we should move to the
main thread before calling didCancel().
2019-05-24 Youenn Fablet <youenn@apple.com>
Update messages_unittest.py after r245715
https://bugs.webkit.org/show_bug.cgi?id=198214
Reviewed by Alexey Proskuryakov.
Update expected results for messages.py output.i
Small refactoring to messages.py: instead of calling the completionHandler in case of decoding error with AsyncReply errors,
call cancelReply directly as it does the same thing.
* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestAsyncMessage::callReply):
(Messages::WebPage::TestAsyncMessage::cancelReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
* Scripts/webkit/messages.py:
2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
Socket-based RWI should be able to inspect a JSContext
https://bugs.webkit.org/show_bug.cgi?id=198197
Reviewed by Don Olmstead.
* UIProcess/socket/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::inspect):
* UIProcess/socket/RemoteInspectorClient.h:
* UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::inspect):
(WebKit::RemoteInspectorProtocolHandler::targetListChanged):
(WebKit::RemoteInspectorProtocolHandler::platformStartTask):
* UIProcess/socket/RemoteInspectorProtocolHandler.h:
Have the RWI client actually pass the debuggableType to WebInspectorUI.
2019-05-22 Stephanie Lewis <slewis@apple.com>
release builds of webkit cannot be used to generate a dyld shared cache
https://bugs.webkit.org/show_bug.cgi?id=198150
<rdar://problem/50675982>
Reviewed by Dan Bernstein.
Restrict the -not_for_dyld_shared_cache linker flag to macosx
* Configurations/WebKit.xcconfig:
2019-05-23 Zalan Bujtas <zalan@apple.com>
[Hittest] Move hittesting from RenderView to Document
https://bugs.webkit.org/show_bug.cgi?id=198192
<rdar://problem/51077762>
Reviewed by Antti Koivisto.
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
2019-05-23 Youenn Fablet <youenn@apple.com>
CacheStorageConnection callbacks should be completed on network connection close
https://bugs.webkit.org/show_bug.cgi?id=195757
Reviewed by Alex Christensen.
Update according new WebCore CacheStorageConnection interface.
Use Async IPC replies so that the completion handlers are called on network crash.
Allow to have specific error handling in case of cancelled reply or badly decoded message.
This allows to reject the corresponding JS promise.
* CMakeLists.txt:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::writeRecord):
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
* NetworkProcess/cache/CacheStorageEngineConnection.h:
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheIdentifierOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordIdentifiersOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheInfosOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordsOrError>::create):
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* Platform/IPC/ArgumentCoders.h:
* Platform/IPC/Connection.h:
(IPC::AsyncReplyError::create):
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::open):
(WebKit::WebCacheStorageConnection::remove):
(WebKit::WebCacheStorageConnection::retrieveCaches):
(WebKit::WebCacheStorageConnection::retrieveRecords):
(WebKit::WebCacheStorageConnection::batchDeleteOperation):
(WebKit::WebCacheStorageConnection::batchPutOperation):
(WebKit::WebCacheStorageConnection::engineRepresentation):
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageConnection.messages.in: Removed.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
2019-05-23 Sihui Liu <sihui_liu@apple.com>
Handling for non-persistent data should be consistent in computeNetworkProcessAccessTypeForDataFetch
https://bugs.webkit.org/show_bug.cgi?id=198050
Reviewed by Youenn Fablet.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
2019-05-23 Youenn Fablet <youenn@apple.com>
Set default WebsiteDataStore storage quota based on StorageQuotaManager
https://bugs.webkit.org/show_bug.cgi?id=198133
<rdar://problem/51031436>
Reviewed by Geoffrey Garen.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
2019-05-23 Alex Christensen <achristensen@webkit.org>
Deprecate more preview API
https://bugs.webkit.org/show_bug.cgi?id=198152
Reviewed by Dean Jackson.
This is working towards <rdar://problem/51003503>
* UIProcess/API/Cocoa/WKPreviewActionItem.h:
* UIProcess/API/Cocoa/WKPreviewActionItem.mm:
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
* UIProcess/API/Cocoa/WKPreviewActionItemInternal.h:
* UIProcess/API/Cocoa/WKPreviewElementInfo.h:
* UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
* UIProcess/ios/WKContentViewInteraction.mm:
(previewIdentifierForElementAction):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:commitPreview:]):
2019-05-23 Antoine Quint <graouts@apple.com>
[tvOS] Build broken by r245639
https://bugs.webkit.org/show_bug.cgi?id=198172
<rdar://problem/51048991>
Unreviewed build fix.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::touchWithIdentifierWasRemoved): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::touchWithIdentifierWasRemoved):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::touchWithIdentifierWasRemoved): Deleted.
2019-05-23 Antoine Quint <graouts@apple.com>
[tvOS] Build broken by r245639
https://bugs.webkit.org/show_bug.cgi?id=198172
<rdar://problem/51048991>
Unreviewed build fix.
* WebProcess/WebPage/WebPage.messages.in:
2019-05-23 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Build fails with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
https://bugs.webkit.org/show_bug.cgi?id=198125
Reviewed by Philippe Normand.
* UIProcess/glib/WebProcessPoolGLib.cpp: Guard the inclusion of GStreamerCommon.h with USE(GSTREAMER).
* WebProcess/glib/WebProcessGLib.cpp: Ditto.
2019-05-22 Antoine Quint <graouts@apple.com>
[tvOS] Build broken by r245639
https://bugs.webkit.org/show_bug.cgi?id=198172
<rdar://problem/51048991>
Unreviewed build fix.
* UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
(-[WKSyntheticTapGestureRecognizer reset]):
(-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
2019-05-22 Youenn Fablet <youenn@apple.com>
Use modern async IPC for EngineRepresentationCompleted and ClearMemoryRepresentationCompleted
https://bugs.webkit.org/show_bug.cgi?id=198134
Reviewed by Alex Christensen.
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
(WebKit::CacheStorageEngineConnection::engineRepresentation):
* NetworkProcess/cache/CacheStorageEngineConnection.h:
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
(WebKit::WebCacheStorageConnection::engineRepresentation):
(WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted): Deleted.
(WebKit::WebCacheStorageConnection::engineRepresentationCompleted): Deleted.
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageConnection.messages.in:
2019-05-22 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r245148): Removing inputmode="none" does not bring up software keyboard
https://bugs.webkit.org/show_bug.cgi?id=198141
Reviewed by Geoffrey Garen.
r245148 changed _requiresKeyboardWhenFirstResponder to return NO when shouldShowAutomaticKeyboardUI
returns NO with regards to software keyboard. This introduced a regression that removing inputmode="none"
no longer brings up the software keyboard. Fixed the bug by making it return YES when inputmode="none"
is present on an editable element in shouldShowAutomaticKeyboardUI, partially restoring the old behavior.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):
(-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
2019-05-22 Tim Horton <timothy_horton@apple.com>
REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
https://bugs.webkit.org/show_bug.cgi?id=198146
<rdar://problem/50698533>
Reviewed by Simon Fraser.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
(-[WKAccessibilityWebPageObjectBase setWebPage:]):
(-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
In r240552, we changed to only defer to the main frame PluginView's
accessibility tree if the cached "has a plugin" bit is true. That bit
was only updated in WebPage::platformInitialize, which is long before
we've actually loaded anything or have any clue if we're going to have
a plugin.
Instead, push updates every time we commit a load, which coincides
with when we make other decisions based on having a plugin or not.
Also, just use the existence of a PluginDocument to make the decision,
instead of actually digging in to see if there's a PluginView, since
PluginView comes in asynchronously.
2019-05-22 Ryosuke Niwa <rniwa@webkit.org>
Crash in WebFrame::jsContext() when m_coreFrame is null
https://bugs.webkit.org/show_bug.cgi?id=198067
Reviewed by Alex Christensen.
Added missing null checks. Unfortunately no new tests since we don't have a reproducible test case.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::jsContext):
(WebKit::WebFrame::jsContextForWorld):
2019-05-22 Sihui Liu <sihui_liu@apple.com>
API Test landed in r245540 [Mac WK2] TestWebKitAPI.WKWebView.LocalStorageProcessCrashes is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=198090
<rdar://problem/51003644>
Reviewed by Youenn Fablet.
We used to dispatch StorageManager message to StorageManager's work queue, which required message handler to be
added to queue before receiving first StorageManager message, otherwise network process would not know how to
decode the message.
After r245540, when netork process crashes and dom storage is accessed from web process after that, web process
re-establishes its connection to network process, asks network process to add message handler, and then sends
StorageManager message immediately. Because work queue message receiver is added on a background thread in
network process, it is possible the StorageManager message is received before that.
A safe and easy resolution is to not dispatch StorageManager message to work queue, so that we don't need to
wait for the message receiver to be added. Handling message on the main thread also allows us to untying the
knot that binds StorageManager and connection, which may be a preferred design in the future.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::webPageWasAdded):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::didGetValues):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::setItems):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::processWillOpenConnection): Deleted.
(WebKit::StorageManager::dispatchMessageToQueue): Deleted.
(WebKit::StorageManager::dispatchSyncMessageToQueue): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:
2019-05-22 Antoine Quint <graouts@apple.com>
[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198124
<rdar://problem/50410863>
Reviewed by Tim Horton.
In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
and into the resulting PlatformMouseEvent.
This means we need to identify the touch identifier, which is the same as the PointerID used for Pointer Events, in the single tap gesture
recognizer, an instance of WKSyntheticTapGestureRecognizer. To do this, we subclass the -[UIResponder touchesEnded:withEvent:] method and
track the touch identifier as the lastActiveTouchIdentifier, a new public property of WKSyntheticTapGestureRecognizer. To allow for this,
we need the support of the content view's UIWebTouchEventsGestureRecognizer which is exposed to the WKSyntheticTapGestureRecognizer as its
supportingWebTouchEventsGestureRecognizer property. This lastActiveTouchIdentifier property is cleared as the gesture recognizer is reset.
This allows the content view to pass the PointerID down to the Web process starting from -[WKContentView _singleTapRecognized:], going
through WebPageProxy::commitPotentialTap() and eventually WebPage::completeSyntheticClick().
While we used to tell the PointerCaptureController that a PointerID was no longer active when a given touch ended or was canceled (in
WebKitAdditions code), we can no longer do this as the dispatch of a synthetic tap is performed asynchronously and will happen past the
dispatch of "pointerup" and "pointercancel" Pointer Events. To clear inactive PointerIDs from the PointerCaptureController, we add a new
touchWithIdentifierWasRemoved() method on the WebPage and its proxy. When the WKSyntheticTapGestureRecognizer resets and -[WKContentView _singleTapDidReset:]
is called, we call that method which allows for only active PointerIDs to be tracked by the PointerCaptureController.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _singleTapRecognized:]):
* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
(-[WKSyntheticTapGestureRecognizer reset]):
(-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
(WebKit::WebPageProxy::commitPotentialTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::dispatchSyntheticMouseMove):
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::touchWithIdentifierWasRemoved):
2019-05-22 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support Attestation Conveyance Preference
https://bugs.webkit.org/show_bug.cgi?id=192722
<rdar://problem/49939647>
Reviewed by Brent Fulgham.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
(WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):
2019-05-22 Zalan Bujtas <zalan@apple.com>
[Paste] Add support for preferred presentation size when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=198132
<rdar://problem/50886917>
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/_WKElementAction.mm:
(addToReadingList):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
2019-05-22 Youenn Fablet <youenn@apple.com>
Implement Feature policy self/none/* parsing
https://bugs.webkit.org/show_bug.cgi?id=198078
Reviewed by Eric Carlson.
Fix a case where completion handler might not always be called.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
2019-05-22 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed fix for non-unified build after r245320.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::convertRectFromFrameClientToRootView):
(WebKit::convertPointFromFrameClientToRootView):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
2019-05-22 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK unit tests after r245565
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDispose): Null check accessible before calling webkitWebViewAccessibleSetWebView().
2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
[PlayStation] Don't call fcntl.
https://bugs.webkit.org/show_bug.cgi?id=197961
Reviewed by Fujii Hironori.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::open):
Use WTF::setNonBlock.
2019-05-21 Chris Dumez <cdumez@apple.com>
[PSON] Assertion hit when navigating back after a process swap forced by the client
https://bugs.webkit.org/show_bug.cgi?id=198006
Reviewed by Alex Christensen.
After r245198, we construct a SuspendedPageProxy when a process-swap is forced by the client
and we delay to closing of the WebPage in the old WebProcess until it is safe to do so without
flashing (by calling SuspendedPageProxy::closeWithoutFlashing()). The issue is that our logic
deciding if we should reuse a SuspendedPageProxy's WebPage relied on the SuspendedPageProxy's
m_suspensionState not being set to FailedToSuspend. In the case of a process-swap forced by the
client with delayed page closing, the suspended state may be suspended but is still not usable
because it is about to get closed. We would wrongly believe there is a WebPage to be reused so
the ProvisionalPageProxy would construct a proxy for the main frame in its constructor, we would
then hit the ASSERT(!m_mainFrame) assertion in ProvisionalPageProxy::didCreateMainFrame() when
the WebContent process would unexpectedly create a main frame.
To address the issue, stop relying on the suspended state to determine if we can reuse a WebPage
or not and introduce a new pageIsClosedOrClosing() getter on the SuspendedPageProxy instead
which indicates if the WebPage in the WebContent process has been closed or is about to be.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
(WebKit::SuspendedPageProxy::pageIsClosedOrClosing const):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2019-05-21 Per Arne Vollan <pvollan@apple.com>
Sandbox violation is making the WebContent process crash
https://bugs.webkit.org/show_bug.cgi?id=198089
<rdar://problem/50999499>
Reviewed by Brent Fulgham.
A new syscall rule needs to be added to the sandbox on iOS and macOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-21 Alex Christensen <achristensen@webkit.org>
Mark WKUIDelegate webView:shouldPreviewElement: and webView:previewingViewControllerForElement:defaultActions: as deprecated
https://bugs.webkit.org/show_bug.cgi?id=198083
<rdar://problem/50735687>
Reviewed by Geoffrey Garen.
* UIProcess/API/Cocoa/WKUIDelegate.h:
2019-05-21 Wenson Hsieh <wenson_hsieh@apple.com>
The cost of WebViewImpl::hasMarkedTextWithCompletionHandler should not increase with document size
https://bugs.webkit.org/show_bug.cgi?id=198075
<rdar://problem/37560103>
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::hasMarkedTextWithCompletionHandler):
Refactor hasMarkedTextWithCompletionHandler to use Editor::hasComposition, instead of computing the actual
marked text range. The latter is more expensive and unnecessary, since it uses TextIterator from the document
root to find editing offsets. This makes the cost of determining whether there is marked text proportional to
the document size.
This matches behavior in legacy WebKit, as well as iOS.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::hasMarkedText):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasMarkedText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-05-21 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Make WebAuthN default on only on macOS
https://bugs.webkit.org/show_bug.cgi?id=198068
<rdar://problem/50971874>
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-05-21 Pablo Saavedra <psaavedra@igalia.com>
Undefined reference platformCloseFrontendPageAndWindow() linking against libWPEWebKit-1.0.so after r245536
https://bugs.webkit.org/show_bug.cgi?id=198069
Reviewed by Ross Kirsling.
* UIProcess/RemoteWebInspectorProxy.cpp:
2019-05-21 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r245540): ASSERTION FAILED: identifier.isNull() || RunLoop::isMain()
https://bugs.webkit.org/show_bug.cgi?id=198074
Reviewed by Youenn Fablet.
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath const):
2019-05-21 Antti Koivisto <antti@apple.com>
RTL/overflow scroll tests fail with async overflow enabled
https://bugs.webkit.org/show_bug.cgi?id=196013
<rdar://problem/49066649>
Reviewed by Simon Fraser.
Add missing scroll offset <-> scroll position conversions.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
2019-05-21 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Add initial accessibility support using ATK
https://bugs.webkit.org/show_bug.cgi?id=197413
Reviewed by Michael Catanzaro.
Rename WebKitWebViewBaseAccessible as WebKitWebViewAccessible and move it to glib removing its dependency on
GTK. WPEView now implements get_accessible to return its associated WebKitWebViewAccessible.
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebViewAccessible.cpp: Added.
(webkitWebViewAccessibleInitialize):
(webkitWebViewAccessibleRefStateSet):
(webkitWebViewAccessibleGetIndexInParent):
(webkit_web_view_accessible_class_init):
(webkitWebViewAccessibleNew):
(webkitWebViewAccessibleSetWebView):
* UIProcess/API/glib/WebKitWebViewAccessible.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDispose):
(webkitWebViewBaseGetAccessible):
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Removed.
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.h: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::accessible):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
(WKWPE::View::~View):
(WKWPE::View::accessible):
* UIProcess/API/wpe/WPEView.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree): Call atk_socket_embed() with the given plug ID.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/wpe/WebPageWPE.cpp:
(WebKit::WebPage::platformInitialize): Create the WebKitWebPageAccessibilityObject and send
BindAccessibilityTree message to the UI process.
* WebProcess/wpe/WebProcessMainWPE.cpp:
(WebKit::initializeAccessibility): Implement AtkUtil interface and initialize the atk bridge.
2019-05-20 Alex Christensen <achristensen@webkit.org>
Revert r245501
https://bugs.webkit.org/show_bug.cgi?id=198007
That change did not fix <rdar://problem/49808949> but it caused <rdar://problem/50967271> so out it goes.
* Shared/API/Cocoa/WKMain.h: Added.
* Shared/API/Cocoa/WKMain.mm: Added.
(WKXPCServiceMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
(main):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main): Deleted.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* WebKit.xcodeproj/project.pbxproj:
2019-05-20 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Layout viewport size on google.com increases after rotating to landscape and back
https://bugs.webkit.org/show_bug.cgi?id=198062
<rdar://problem/50547895>
Reviewed by Maciej Stachowiak.
During an animated resize (e.g. when rotating the device on iOS), we currently immediately trigger the new
shrink-to-fit content size heuristic in the middle of dynamicViewportSizeUpdate, after the new view layout size
has been applied to the viewport configuration but before we've issued a resize event to the page.
Thus, on pages that use listen to the resize event and adjust their content accordingly to fit within the new
layout width, we prematurely declare that the page has horizontally overflowed, and try to lay out at a larger
width and scale down. This causes the page to unnecessarily shrink after rotating to landscale orientation and
back.
To fix this, we simply move the call to shrink-to-fit-content to the end of the dynamic viewport size update,
such that the page has had a chance to adjust to the new layout size.
Test: fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
2019-05-20 Ross Kirsling <ross.kirsling@sony.com>
Make lossy LayoutUnit constructors explicit
https://bugs.webkit.org/show_bug.cgi?id=191811
Reviewed by Antti Koivisto.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/ios/WebPageIOS.mm:
Make usage of LayoutUnit(float) explicit.
2019-05-20 Per Arne Vollan <pvollan@apple.com>
[iOS] WebKit crash loop
https://bugs.webkit.org/show_bug.cgi?id=198061
<rdar://problem/50967271>
Reviewed by Brent Fulgham.
A new syscall rule needs to be added to the sandbox on iOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-05-20 Sihui Liu <sihui_liu@apple.com>
Move Web Storage to Network Process
https://bugs.webkit.org/show_bug.cgi?id=197636
Reviewed by Youenn Fablet.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::webPageWasAdded):
(WebKit::NetworkConnectionToWebProcess::webPageWasRemoved):
(WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::networkSessionByConnection const):
(WebKit::NetworkProcess::hasLocalStorage):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::webPageWasAdded):
(WebKit::NetworkProcess::webPageWasRemoved):
(WebKit::NetworkProcess::webProcessWasDisconnected):
(WebKit::NetworkProcess::webProcessSessionChanged):
(WebKit::NetworkProcess::getLocalStorageOriginDetails):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::storageManager):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.cpp.
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
(WebKit::LocalStorageDatabase::~LocalStorageDatabase):
(WebKit::LocalStorageDatabase::openDatabase):
(WebKit::LocalStorageDatabase::tryToOpenDatabase):
(WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
(WebKit::LocalStorageDatabase::importItems):
(WebKit::LocalStorageDatabase::setItem):
(WebKit::LocalStorageDatabase::removeItem):
(WebKit::LocalStorageDatabase::clear):
(WebKit::LocalStorageDatabase::close):
(WebKit::LocalStorageDatabase::itemDidChange):
(WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
(WebKit::LocalStorageDatabase::updateDatabase):
(WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
(WebKit::LocalStorageDatabase::databaseIsEmpty):
* NetworkProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.h.
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp.
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::databasePath const):
(WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h.
* NetworkProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.cpp.
(WebKit::StorageManager::StorageArea::securityOrigin const):
(WebKit::StorageManager::StorageArea::isSessionStorage const):
(WebKit::StorageManager::LocalStorageNamespace::storageManager const):
(WebKit::StorageManager::TransientLocalStorageNamespace::create):
(WebKit::StorageManager::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
(WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::TransientLocalStorageNamespace::origins const):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
(WebKit::StorageManager::StorageArea::create):
(WebKit::StorageManager::StorageArea::StorageArea):
(WebKit::StorageManager::StorageArea::~StorageArea):
(WebKit::StorageManager::StorageArea::addListener):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::hasListener const):
(WebKit::StorageManager::StorageArea::clone const):
(WebKit::StorageManager::StorageArea::setItem):
(WebKit::StorageManager::StorageArea::removeItem):
(WebKit::StorageManager::StorageArea::clear):
(WebKit::StorageManager::StorageArea::items const):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageManager::StorageArea::dispatchEvents const):
(WebKit::StorageManager::LocalStorageNamespace::create):
(WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::SessionStorageNamespace::isEmpty const):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
(WebKit::StorageManager::SessionStorageNamespace::origins const):
(WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::SessionStorageNamespace::create):
(WebKit::StorageManager::SessionStorageNamespace::SessionStorageNamespace):
(WebKit::StorageManager::SessionStorageNamespace::~SessionStorageNamespace):
(WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::SessionStorageNamespace::cloneTo):
(WebKit::StorageManager::create):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::~StorageManager):
(WebKit::StorageManager::createSessionStorageNamespace):
(WebKit::StorageManager::destroySessionStorageNamespace):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::processWillOpenConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::getSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::applicationWillTerminate):
(WebKit::StorageManager::findStorageArea const):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
* NetworkProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.h.
* NetworkProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.messages.in.
* NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm.
(WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* PlatformMac.cmake:
* PlatformWin.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
(WKKeyValueStorageManagerDeleteAllEntries):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasLocalStorage):
(WebKit::NetworkProcessProxy::getLocalStorageDetails):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::platformInitialize):
(WebKit::WebsiteDataStore::platformDestroy):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::getLocalStorageDetails):
(WebKit::m_client): Deleted.
(WebKit::WebsiteDataStore::cloneSessionData): Deleted.
(WebKit::WebsiteDataStore::webPageWasAdded): Deleted.
(WebKit::WebsiteDataStore::webPageWasInvalidated): Deleted.
(WebKit::WebsiteDataStore::webProcessWillOpenConnection): Deleted.
(WebKit::WebsiteDataStore::webPageWillOpenConnection): Deleted.
(WebKit::WebsiteDataStore::webPageDidCloseConnection): Deleted.
(WebKit::WebsiteDataStore::webProcessDidCloseConnection): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resolvedLocalStorageDirectory const):
(WebKit::WebsiteDataStore::storageManager): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::removeWebPage):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::registerStorageAreaMap):
(WebKit::WebProcess::unregisterStorageAreaMap):
(WebKit::WebProcess::storageAreaMap const):
(WebKit::WebProcess::enablePrivateBrowsingForTesting):
* WebProcess/WebProcess.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::~StorageAreaMap):
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::loadValuesIfNeeded):
(WebKit::StorageAreaMap::connect):
(WebKit::StorageAreaMap::disconnect):
* WebProcess/WebStorage/StorageAreaMap.h:
(WebKit::StorageAreaMap::identifier const):
2019-05-20 Ross Kirsling <ross.kirsling@sony.com>
[WinCairo] Implement Remote Web Inspector Client.
https://bugs.webkit.org/show_bug.cgi?id=197434
Reviewed by Don Olmstead.
* PlatformWin.cmake:
* UIProcess/RemoteWebInspectorProxy.cpp:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/socket/RemoteInspectorClient.cpp: Added.
* UIProcess/socket/RemoteInspectorClient.h: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.cpp: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.h: Added.
* UIProcess/win/RemoteWebInspectorProxyWin.cpp: Added.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView):
2019-05-20 Per Arne Vollan <pvollan@apple.com>
[macOS] STP can't launch any WebContent processes
https://bugs.webkit.org/show_bug.cgi?id=198045
<rdar://problem/50931110>
Reviewed by Brent Fulgham.
This is caused by a syscall sandbox violation.
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-20 Zhifei Fang <zhifei_fang@apple.com>
Allow WebContent mach-lookup AGXCompilerService
https://bugs.webkit.org/show_bug.cgi?id=198031
<rdar://problem/50552974>
Reviewed by Per Arne Vollan.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-05-20 Sihui Liu <sihui_liu@apple.com>
[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196307
<rdar://problem/49345360>
Reviewed by Alex Christensen.
Delay dumping statistics if there is data being removed.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
(WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2019-05-20 Ludovico de Nittis <ludovico.denittis@collabora.com>
[WPE][Qt] Use C++17 instead of C++14
https://bugs.webkit.org/show_bug.cgi?id=197415
Reviewed by Philippe Normand.
There was a regression introduced with the commit https://bugs.webkit.org/show_bug.cgi?id=197131
The WPE Qt port was not updated to C++17 and this leaded to a compilation error.
* PlatformWPE.cmake:
2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Use a repeating timer to populate emoji chooser
https://bugs.webkit.org/show_bug.cgi?id=197984
Reviewed by Michael Catanzaro.
It ensures the emoji chooser popover is shown as soon as it's requested.
* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserSetupSectionBox):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserSetupEmojiSections):
(webkitEmojiChooserConstructed):
2019-05-19 Antoine Quint <graouts@apple.com>
[Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
https://bugs.webkit.org/show_bug.cgi?id=197882
<rdar://problem/50769116>
Reviewed by Dean Jackson.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):
2019-05-19 Alex Christensen <achristensen@webkit.org>
Revert r240956
https://bugs.webkit.org/show_bug.cgi?id=198007
<rdar://problem/49808949>
Reviewed by Alexey Proskuryakov.
r240956 made SafariForWebKitDevelopment crash when using WebKit nightly builds.
Since it's not needed and the binary reduction wasn't too big, just revert that revision.
* Shared/API/Cocoa/WKMain.h: Removed.
* Shared/API/Cocoa/WKMain.mm: Removed.
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Removed.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-05-18 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP fails in authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=197974
<rdar://problem/50879746>
Reviewed by Brent Fulgham.
Authenticators that support both CTAP and U2F protocols can be used in a U2F enabled browser to create a credential in
U2F format. When such authenticator is used to login in WebKit, it will be treated as a CTAP authenticator. Since the
previous credential is in U2F format, the authenticator will not consider that as a valid credential when CTAP requests
come along for that U2F credential. Therefore the previous created U2F credential will not be asked at all, and users
will not be able to login. This situation is not well documented in the CTAP/WebAuthN spec yet.
To workaround the above issue, an authenticator that supports both protocols will be downgraded to a U2F authenticator
to ask a potential U2F credential once a valid error is returned regarding to the first CTAP request.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Authenticator.h:
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::downgrade):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived):
(WebKit::CtapHidAuthenticator::tryDowngrade):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const): Deleted.
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:
2019-05-17 Don Olmstead <don.olmstead@sony.com>
[CMake] Use builtin FindICU
https://bugs.webkit.org/show_bug.cgi?id=197934
Reviewed by Michael Catanzaro.
Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
* CMakeLists.txt:
2019-05-17 Alex Christensen <achristensen@webkit.org>
Enable legacy EME for iOS WKWebView
https://bugs.webkit.org/show_bug.cgi?id=197964
<rdar://problem/50625666>
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
2019-05-17 Antoine Quint <graouts@apple.com>
Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
https://bugs.webkit.org/show_bug.cgi?id=197943
<rdar://problem/49078202>
Reviewed by Brent Fulgham.
* Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:
2019-05-17 Alex Christensen <achristensen@webkit.org>
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397
Reviewed by Geoff Garen.
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:
2019-05-17 Brady Eidson <beidson@apple.com>
Avoid races in taking networking assertions for downloads by having both Networking and UIProcess do it.
<rdar://problem/50564630> and https://bugs.webkit.org/show_bug.cgi?id=197995
Reviewed by Chris Dumez.
There's a fairly indeterminant time gap between when the UIProcess decides a load becomes a download
and when the NetworkProcess Download object is created, and therefore the download assertion to be taken.
The time gap can be long enough for the Networking process to suspend before the download actually starts.
There's the reverse race when the UIProcess tells a download to stop, as well.
By having both the UIProcess and NetworkProcess take an assertion on behalf of the NetworkProcess we
avoid the race.
* NetworkProcess/Downloads/DownloadMap.cpp:
(WebKit::DownloadMap::add):
(WebKit::DownloadMap::remove):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
(WebKit::DownloadProxyMap::downloadFinished):
(WebKit::DownloadProxyMap::invalidate):
* UIProcess/Downloads/DownloadProxyMap.h:
2019-05-17 Keith Rollin <krollin@apple.com>
Re-enable generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=197933
<rdar://problem/50831677>
Reviewed by Jonathan Bedard.
The following two tasks have been completed, and we can re-enable
generate-xcfilelists:
Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
* Scripts/check-xcfilelists.sh:
2019-05-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245401.
https://bugs.webkit.org/show_bug.cgi?id=197990
Causing internal build failures (Requested by ShawnRoberts on
#webkit).
Reverted changeset:
"Add SPI to set a list of hosts to which to send custom header
fields cross-origin"
https://bugs.webkit.org/show_bug.cgi?id=197397
https://trac.webkit.org/changeset/245401
2019-05-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245418.
https://bugs.webkit.org/show_bug.cgi?id=197989
New API test causing crashes on Mojave testers (Requested by
ShawnRoberts on #webkit).
Reverted changeset:
"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245418
2019-05-17 Antti Koivisto <antti@apple.com>
[iOS] Respect scrolling="no" on composited frames
https://bugs.webkit.org/show_bug.cgi?id=197972
<rdar://problem/50252398>
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
Disallow scrolling based on canHaveScrollbars, similar to main frame.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):
Factor into a function.
2019-05-17 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix variations shown in GTK emoji chooser after r245460.
We are tno showing the variations in the sub-popover because of a missing parameter in
webkitEmojiChooserAddEmoji() call.
* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserShowVariations): Pass prepend parameter to webkitEmojiChooserAddEmoji().
2019-05-16 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Need WebKitContextMenuItemType to open emoji picker
https://bugs.webkit.org/show_bug.cgi?id=176760
Reviewed by Michael Catanzaro.
Add a default implementation to show the emoji chooser when requested by the application, either using the
context menu or keyboard shortcuts. GtkEmojiChooser is private in GTK, so we include our own copy, adapted to
the WebKit coding style. The emoji chooser is always shown by default when using GTK >= 3.24 for any editable
content. I'm going to add public API in a follow up patch to be able to use your own chooser, or even prevent
the default chooser from being shown, similar to what we do for other UI elements like file chooser, color
chooser, print dialog, etc.
* Shared/API/glib/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetActionTag): Handle insert emoji action.
(webkitContextMenuActionGetForContextMenuItem): Ditto.
(webkitContextMenuActionGetLabel): Ditto.
* SourcesGTK.txt:
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/WebKitEmojiChooser.cpp: Added.
(webkitEmojiChooserAddEmoji):
(webkitEmojiChooserAddRecentItem):
(emojiActivated):
(emojiDataHasVariations):
(webkitEmojiChooserShowVariations):
(emojiLongPressed):
(emojiPressed):
(emojiPopupMenu):
(verticalAdjustmentChanged):
(webkitEmojiChooserSetupSectionBox):
(scrollToSection):
(webkitEmojiChooserSetupSectionButton):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserEnsureEmptyResult):
(webkitEmojiChooserSearchChanged):
(webkitEmojiChooserSetupFilters):
(webkitEmojiChooserInitializeEmojiMaxWidth):
(webkitEmojiChooserConstructed):
(webkitEmojiChooserShow):
(webkit_emoji_chooser_class_init):
(webkitEmojiChooserNew):
* UIProcess/API/gtk/WebKitEmojiChooser.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): Add a timer to release the emoji chooser if not used
after 2 minutes.
(_WebKitWebViewBasePrivate::releaseEmojiChooserTimerFired): Destroy the emoji chooser.
(emojiChooserEmojiPicked): Complete the operation using the given emoji text.
(emojiChooserClosed): Complete the operation if needed using an empty string.
(webkitWebViewBaseShowEmojiChooser): Create the emoji chooser if needed and show it.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/WebPageProxy.h: Add showEmojiPicker().
* UIProcess/WebPageProxy.messages.in: Add ShowEmojiPicker message.
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::insertEmojiCallback): Add GtkInsertEmoji command.
(WebKit::KeyBindingTranslator::KeyBindingTranslator): Connect to insert-emoji signal.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::showEmojiPicker): Call webkitWebViewBaseShowEmojiChooser().
* WebProcess/WebCoreSupport/WebContextMenuClient.h: Override insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/WebEditorClient.h: Add insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
(WebKit::WebContextMenuClient::insertEmoji): Call WebPage::showEmojiPicker().
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleGtkEditorCommand): Call WebPage::showEmojiPicker() if command is GtkInsertEmoji.
(WebKit::WebEditorClient::executePendingEditorCommands): Handle Gtk specific commands.
(WebKit::WebEditorClient::handleKeyboardEvent): Use a reference instead of a pointer for Frame.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::showEmojiPicker): Send ShowEmojiPicker message to the UI process.
2019-05-16 John Wilander <wilander@apple.com>
Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
https://bugs.webkit.org/show_bug.cgi?id=197967
<rdar://problem/50753129>
Reviewed by Brent Fulgham.
NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
hang, waiting for the result to document.hasStorageAccess().
The existing layout test case was augmented to use an ephemeral session.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2019-05-16 Alex Christensen <achristensen@webkit.org>
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800
Reviewed by Youenn Fablet.
* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.
2019-05-16 Alex Christensen <achristensen@webkit.org>
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397
Reviewed by Geoff Garen.
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:
2019-05-16 Ryan Walklin <ryan@testtoast.com>
[WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
https://bugs.webkit.org/show_bug.cgi?id=185764
Reviewed by Carlos Garcia Campos.
Add a function to the wpe_view_backend_client struct which accepts a device scale factor
configured through wpe_view_backend_dispatch_set_device_scale_factor() and calls
setIntrinsicDeviceScaleFactor for the the current View.Page object. The
function definition has been added in libwpe 1.3.
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend): Add set_device_scale_factor implementation declared by libwpe.
2019-05-15 Devin Rousso <drousso@apple.com>
Web Inspector: user gesture toggle should also force user interaction flag
https://bugs.webkit.org/show_bug.cgi?id=197269
Reviewed by Joseph Pecoraro.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::userIsInteracting const): Added.
(WebKit::WebChromeClient::setUserIsInteracting): Added.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userIsInteracting const): Added.
(WebKit::WebPage::setUserIsInteracting): Added.
2019-05-15 Brent Fulgham <bfulgham@apple.com>
Revise sandbox to allow IOKit properties needed by Metal and LaunchServices
https://bugs.webkit.org/show_bug.cgi?id=197924
<rdar://problem/50823976>
Reviewed by Per Arne Vollan.
Update sandbox to allow access to some IOKit properties to avoid sandbox violations that could
lower performance or increase launch times:
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-15 Chris Dumez <cdumez@apple.com>
Unreviewed, fix assertion introduced in r245339.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
2019-05-15 Sihui Liu <sihui_liu@apple.com>
Add assertions to help diagnose crash at WebProcessProxy::processPool()
https://bugs.webkit.org/show_bug.cgi?id=197856
<rdar://problem/49341366>
Reviewed by Chris Dumez.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
(WebKit::WebProcessLifetimeObserver::hasProcess const):
2019-05-15 Wenson Hsieh <wenson_hsieh@apple.com>
inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
https://bugs.webkit.org/show_bug.cgi?id=197916
<rdar://problem/50815427>
Reviewed by Timothy Hatcher.
Use UIKeyboardTypeNumberPad instead of UIKeyboardTypeNumbersAndPunctuation when presenting a keyboard for a
field with inputmode="numeric". While the WhatWG specification merely requires the UA to display a keyboard
"capable of numeric input", it suggests that the keyboard should be "useful for PIN entry", which loosely
implies a number pad.
This is also generally in line with feedback from web developers.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):
2019-05-15 Don Olmstead <don.olmstead@sony.com>
Add USE(LIBWPE) for AcceleratedSurface
https://bugs.webkit.org/show_bug.cgi?id=197918
Reviewed by Michael Catanzaro.
Renamed AcceleratedSurfaceWPE to AcceleratedSurfaceLibWPE since it just uses the
libwpe APIs.
* PlatformWPE.cmake:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp.
(WebKit::AcceleratedSurfaceLibWPE::create):
(WebKit::AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::initialize):
(WebKit::AcceleratedSurfaceLibWPE::finalize):
(WebKit::AcceleratedSurfaceLibWPE::window const):
(WebKit::AcceleratedSurfaceLibWPE::surfaceID const):
(WebKit::AcceleratedSurfaceLibWPE::clientResize):
(WebKit::AcceleratedSurfaceLibWPE::willRenderFrame):
(WebKit::AcceleratedSurfaceLibWPE::didRenderFrame):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h.
2019-05-15 Youenn Fablet <youenn@apple.com>
getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
https://bugs.webkit.org/show_bug.cgi?id=197851
Reviewed by Alex Christensen.
Before the patch, stopping capture in a document and quickly triggering a new capture
might fail as the UIProcess would grant access and revoke sandbox access based on the fact
the page is no longer capturing.
To fix that issue, keep a state in the UIProcess to not revoke sandbox extensions in case of
capture being started.
Add an IPC message back to tell UIProcess when an allowed capture is finished.
Just after doing that, make sure the document is updating the media state to UIProcess, which will trigger proper sandbox extension handling.
This should also trigger the case of an allowed getUserMedia call that fails to start for some reason.
In that case, the patch will automatically trigger a document media state refresh which will trigger a sandbox revokation.
Covered by added test that exercise a newly added debug assertion.
This assertion ensures that we revoke extensions while a document is not capturing.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isCapturingAudio const):
(WebKit::WebPageProxy::isCapturingVideo const):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::checkDocumentsCaptureStateConsistency):
(WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
2019-05-15 Chris Dumez <cdumez@apple.com>
[WK2][iOS] UIProcess may get killed because it is taking too long to release its background task after expiration
https://bugs.webkit.org/show_bug.cgi?id=197893
<rdar://problem/50234105>
Reviewed by Alex Christensen.
The UIProcess may get killed because it is taking too long to release its background task after its expiration handler
was called. The reason is that the background task's expiration handler was sequentially sending a ProcessWillSuspendImminently
synchronous IPC to each of its child processes and only then ends the background task. By the time we receive the response from
all child processes, it may be too late and we get killed.
To address the issue, we now:
1. Send the ProcessWillSuspendImminently asynchronously so that all processes can do their processing in parallel
2. After 2 seconds, the UIProcess releases the background task (We get killed after ~5 seconds)
Also, to make sure that the UIProcess supends promptly, we now make sure we never start a new background task *after*
the app has been backgrounded. The intention of our background task is too finish critical work (like releasing locked
files) after the app gets backgrounded, not to start new work and delay process suspension.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processWillSuspendImminently):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _scheduleReleaseTask]):
(-[WKProcessAssertionBackgroundTaskManager _cancelPendingReleaseTask]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveSyncMessage):
(WebKit::WebProcess::processWillSuspendImminently):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-05-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Make WebAuthN default on
https://bugs.webkit.org/show_bug.cgi?id=197805
<rdar://problem/50683699>
Reviewed by Darin Adler.
* Shared/WebPreferences.yaml:
2019-05-15 Youenn Fablet <youenn@apple.com>
Reuse existing WebPageProxy quota handler for NetworkProcessProxy quota requests
https://bugs.webkit.org/show_bug.cgi?id=197463
<rdar://problem/47403621>
Reviewed by Alex Christensen.
Add a getter to know whether websitedatastore client implements the quota delegate.
If not, find the most visible page that is the same origin as the quota request
and reuse the existing exceededDatabasQuota delegate.
This approach allows to call the delegate even if the quota request comes from a service worker.
If no such page is found, the quota will not be increased.
Refactoring to make sure we are calling the delegate once a previous call to that delegate is completed.
Covered by API test.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageSpace):
* UIProcess/WebPageProxy.cpp:
(WebKit::StorageRequests::add):
(WebKit::StorageRequests::processNext):
(WebKit::StorageRequests::areBeingProcessed const):
(WebKit::StorageRequests::setAreBeingProcessed):
(WebKit::StorageRequests::StorageRequests):
(WebKit::StorageRequests::~StorageRequests):
(WebKit::StorageRequests::singleton):
(WebKit::WebPageProxy::forMostVisibleWebPageIfAny):
(WebKit::WebPageProxy::didChangeMainDocument):
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestStorageSpace):
(WebKit::WebPageProxy::makeStorageSpaceRequest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::forWebPages):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::implementsRequestStorageSpaceHandler const):
2019-05-15 Youenn Fablet <youenn@apple.com>
Constant crashes under WebPage::isThrottleable() after r245299
https://bugs.webkit.org/show_bug.cgi?id=197902
<rdar://problem/50793796>
Reviewed by Alex Christensen.
Update throttle state after a run loop iteration when page state changes to make sure the pageMap does not have null pages.
Add appNapEnabled preference that is used by added API test.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAppNapEnabled:]):
(-[WKPreferences _appNapEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-05-15 Alex Christensen <achristensen@webkit.org>
Allow NSFileCoordinator to be called from WebContent process
https://bugs.webkit.org/show_bug.cgi?id=197895
<rdar://problem/50107679>
Reviewed by Brent Fulgham.
* WebProcess/com.apple.WebProcess.sb.in:
Expand sandbox to allow use of com.apple.FileCoordination mach service like we do on iOS.
2019-05-15 Devin Rousso <drousso@apple.com>
Web Automation: elements larger than the viewport have incorrect in-view center point
https://bugs.webkit.org/show_bug.cgi?id=195696
<rdar://problem/48737122>
Reviewed by Simon Fraser.
Original patch by Brian Burg <bburg@apple.com>.
This seems to be an omission in the specification. While it does mention that the in-view
center point (IVCP) must be within the viewport, the algorithm never intersects the element
bounding box with the viewport rect.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
This code is incorrect. For `CoordinateSystem::LayoutViewport`, coordinates should be in
root view coordinates so that it can be later converted to screen and synthesized as a HID
event in screen coordinates. Intersect the element rect and the viewport rect before finding
the center point of the part of the element that's visible in the viewport.
(WebKit::convertRectFromFrameClientToRootView): Added.
(WebKit::convertPointFromFrameClientToRootView): Added.
Added helpers to properly account for scroll contents position on iOS.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
Now that we determine whether the element is inside the viewport much earlier, if the
element has no `inViewCenterPoint`, we can return a `TargetOutOfBounds` instead of a more
"generic" `ElementNotInteractable`.
(WebKit::WebAutomationSession::simulateMouseInteraction):
Rename `locationInView` -> `locationInViewport`.
(WebKit::WebAutomationSession::simulateTouchInteraction):
This code is incorrect. The `unobscuredContentRect` is in screen coordinates, but
we are trying to see if (x, y) is outside the size of the viewport assumed to be at (0, 0).
Grab the visual viewport rect and see if the location exceeds the viewport size.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::operator<<):
Add logging helper for `TouchInteraction` enum.
(WebKit::WebAutomationSession::platformSimulateTouchInteraction):
Move local variable.
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
Fix a typo in logging.
* UIProcess/Automation/Automation.json:
Simplify enum name.
* Platform/Logging.h:
Add logging channel to dump fully resolved interaction details.
2019-05-14 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed restoration of non-unified build.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* UIProcess/WebProcessProxy.cpp:
2019-05-14 Youenn Fablet <youenn@apple.com>
A service worker process should app nap when all its clients app nap
https://bugs.webkit.org/show_bug.cgi?id=185626
<rdar://problem/46785908>
Reviewed by Alex Christensen.
Compute whether a given web process can be throttled on every page throttling change.
Send that information to network process which stores that information in WebSWServerConnection.
Every WebSWServerToContextConnection throttle state is then computed based on all WebSWServerConnection
that have a client that matches the registrable domain of the context connection.
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
(WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
(WebKit::WebSWServerConnection::hasMatchingClient const):
(WebKit::WebSWServerConnection::computeThrottleState const):
(WebKit::WebSWServerConnection::setThrottleState):
(WebKit::WebSWServerConnection::updateThrottleState):
(WebKit::WebSWServerConnection::serverToContextConnectionCreated):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
(WebKit::WebSWServerConnection::isThrottleable const):
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::setThrottleState):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
(WebKit::WebSWServerToContextConnection::isThrottleable const):
* UIProcess/ServiceWorkerProcessProxy.cpp:
* UIProcess/ServiceWorkerProcessProxy.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::updateThrottleState):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::setThrottleState):
(WebKit::WebSWContextManagerConnection::isThrottleable const):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateUserActivity):
(WebKit::WebPage::isThrottleable const):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::arePagesThrottleable const):
* WebProcess/WebProcess.h:
2019-05-14 Chris Dumez <cdumez@apple.com>
Crash under WebKit::WebProcessProxy::didBecomeUnresponsive()
https://bugs.webkit.org/show_bug.cgi?id=197883
<rdar://problem/50665984>
Reviewed by Alex Christensen.
Protect |this| in didBecomeUnresponsive() and didExceedCPULimit() since we call client
delegates and those may cause |this| to get destroyed.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didBecomeUnresponsive):
(WebKit::WebProcessProxy::didExceedCPULimit):
2019-05-14 Chris Dumez <cdumez@apple.com>
The network process tries to take a process assertion when NetworkProcess::processWillSuspendImminently() is called
https://bugs.webkit.org/show_bug.cgi?id=197888
Reviewed by Geoffrey Garen.
When actualPrepareToSuspend() in the Network process is called set the 'IsSuspended' flag on the SQLite database tracker and unset
the flag when the process resume. This is consistent with what we already do in the WebProcess and makes sure that
the network process does not try and take on a new assertion due to locked files when getting notified it is about to get
suspended.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::processWillSuspendImminently):
(WebKit::NetworkProcess::resume):
2019-05-14 Chris Dumez <cdumez@apple.com>
Update TBA macros for API / SPI that has already shipped
https://bugs.webkit.org/show_bug.cgi?id=197841
<rdar://problem/50698499>
Reviewed by Geoffrey Garen.
* Configurations/WebKit.xcconfig:
Disable header postprocessing when building for macOS Mojave
* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKTypeRefWrapper.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKView.h:
(WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInspector.h:
* UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/API/Cocoa/WKWebProcess.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2019-05-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245281.
https://bugs.webkit.org/show_bug.cgi?id=197887
Broke API Test TestWebKitAPI.Challenge.ClientCertificate
(Requested by aakashjain on #webkit).
Reverted changeset:
"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245281
2019-05-14 Daniel Bates <dabates@apple.com>
[iOS] Cannot scroll to beginning of document after scrolling to end of document and vice versa via key commands
https://bugs.webkit.org/show_bug.cgi?id=197848
<rdar://problem/49523065>
Reviewed by Brent Fulgham.
Following the fix for <rdar://problem/49523065>, UIKit no longer emits a keyup event for a Command-
modified key. This breaks WebKit's own implementation of key command handling for scrolling to the
beginning or end of the document (triggered using Command + Arrow Up and Command + Arrow Down,
respectively) because it watches for keyup events to reset state after initiating a scroll. If state
is not reset then the scroll key command logic becomes confused and may not perform a subsequent scroll.
It seems like we can actually get away with supporting these key commands and future Command modified
commands by preemptively reseting state on keydown if the Command modifier is held down. If this does
not work out then we can do something more complicated.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator handleKeyEvent:]):
2019-05-14 Brent Fulgham <bfulgham@apple.com>
Protect current WebFrame during form submission
https://bugs.webkit.org/show_bug.cgi?id=197459
<rdar://problem/50368618>
Reviewed by Alex Christensen.
The 'continueWillSubmitForm' method calls a completion handler that
might affect the state of the current frame. Ensure the frame is valid
for the scope of the function.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::continueWillSubmitForm):
2019-05-14 Daniel Bates <dabates@apple.com>
[iOS] Cannot tab or shift + tab out of address bar on google.com
https://bugs.webkit.org/show_bug.cgi?id=197859
<rdar://problem/46651565>
Reviewed by Darin Adler.
Non-editable elements can participate in tab cycling via the HTML tabindex attribute.
We should allow setting the initial focus to such an element when transitioning from
the chrome (e.g. address bar) to the web page.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2019-05-14 Alex Christensen <achristensen@webkit.org>
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800
Reviewed by Youenn Fablet.
* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.
2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
Followup to r245267: fix some more deprecated uses of -[UIApplication interfaceOrientation]
https://bugs.webkit.org/show_bug.cgi?id=197867
<rdar://problem/50743963>
Reviewed by Simon Fraser.
Add a helper method on WKContentView that asks the view's window's scene for an interface orientation; then,
use this helper from various places in WebKit instead of invoking -[UIApplication interfaceOrientation]
directly. No change in behavior.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView interfaceOrientation]):
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsPicker initWithInformation:inView:]):
* UIProcess/ios/forms/WKFormColorPicker.mm:
(-[WKColorPicker initWithView:]):
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePicker initWithView:datePickerMode:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker initWithView:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):
2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] When running layout tests that tap in the same location, subsequent tests fail to fire click handlers
https://bugs.webkit.org/show_bug.cgi?id=197821
<rdar://problem/50700512>
Reviewed by Tim Horton.
After r244775, when running back-to-back layout tests on iOS that simulate taps in the same location, the double
tap gesture recognizer for recognizing double clicks ends up recognizing instead of the single tap gesture
recognizer in the subsequent test. This means that click handlers in the subsequent test will fail to recognize,
unless the element with the click handler is also accompanied by a dblclick handler.
To avoid this, we reset the double click gesture recognizer when navigating; this has the additional effect of
making it such that the second page doesn't end up observing a dblclick when the first click was only sent to
the first page.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _didStartProvisionalLoadForMainFrame]):
2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix some deprecation warnings when using a recent SDK
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsPicker initWithInformation:inView:]):
2019-05-13 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] InvalidStateError should be reported to sites
https://bugs.webkit.org/show_bug.cgi?id=193269
<rdar://problem/48298264>
Reviewed by Brent Fulgham.
This patch implements step 20 about InvalidStateError of the spec:
https://www.w3.org/TR/webauthn/#createCredential.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
2019-05-13 Jer Noble <jer.noble@apple.com>
Take out MediaPlayback UI assertion when any WebProcess is playing audible media
https://bugs.webkit.org/show_bug.cgi?id=197798
Reviewed by Chris Dumez.
To keep the system from suspending the UIProcess (and all the other constellation of processes that
are necessary to play media), take a UIProcess assertion with the MediaPlayback reason whenever there
is a WebContent process that is playing audible media.
* Platform/spi/ios/AssertionServicesSPI.h:
* UIProcess/ProcessAssertion.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updatePlayingMediaDidChange):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
(WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::webPageMediaStateDidChange):
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::toBKSProcessAssertionReason):
(WebKit::ProcessAssertion::ProcessAssertion):
* WebProcess/WebProcess.h:
2019-05-13 Per Arne Vollan <pvollan@apple.com>
[iOS] Crash when trying to QuickLook
https://bugs.webkit.org/show_bug.cgi?id=197853
<rdar://problem/49795964>
Reviewed by Brent Fulgham.
This is caused by a syscall sandbox violation.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-05-13 Brent Fulgham <bfulgham@apple.com>
Correct the sandbox to allow loading libraries from /Library/Apple
https://bugs.webkit.org/show_bug.cgi?id=197844
Reviewed by Per Arne Vollan.
Grant access to '/Library/Apple' as an appropriate place to load
system frameworks.
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-13 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r245240.
Broke the build
Reverted changeset:
"Update TBA macros for API / SPI that has already shipped"
https://bugs.webkit.org/show_bug.cgi?id=197841
https://trac.webkit.org/changeset/245240
2019-05-13 Youenn Fablet <youenn@apple.com>
Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=197802
Reviewed by Eric Carlson.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
2019-05-13 Don Olmstead <don.olmstead@sony.com>
decidePolicyForInstallMissingMediaPluginsPermissionRequest requires GStreamer
https://bugs.webkit.org/show_bug.cgi?id=197843
Reviewed by Alex Christensen.
* UIProcess/API/wpe/PageClientImpl.cpp:
ENABLE(VIDEO) && USE(GSTREAMER)
* UIProcess/WebPageProxy.h:
Cleanup the declaration.
2019-05-13 Don Olmstead <don.olmstead@sony.com>
Move StorageManager.cpp into WebKit/Sources.txt
https://bugs.webkit.org/show_bug.cgi?id=197842
Reviewed by Michael Catanzaro.
StorageManager.cpp is used by all ports so it should just go into Sources.txt.
* PlatformMac.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
2019-05-13 Chris Dumez <cdumez@apple.com>
Update TBA macros for API / SPI that has already shipped
https://bugs.webkit.org/show_bug.cgi?id=197841
<rdar://problem/50698499>
Reviewed by Alex Christensen.
* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKTypeRefWrapper.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKView.h:
(WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInspector.h:
* UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/API/Cocoa/WKWebProcess.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
2019-05-13 Chris Fleizach <cfleizach@apple.com>
AX: Need an entitlement for WebContent to send accessibility notifications
https://bugs.webkit.org/show_bug.cgi?id=197832
Reviewed by Brent Fulgham.
In order to send accessibility notifications on iOS, we need to be able to look up this port.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable warnings in release builds
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearWebProcessHasUploads):
2019-05-12 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
https://bugs.webkit.org/show_bug.cgi?id=197650
Reviewed by Fujii Hironori.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::restartWithCredential):
2019-05-10 Chris Dumez <cdumez@apple.com>
[PSON] Prevent flashing when the process-swap is forced by the client
https://bugs.webkit.org/show_bug.cgi?id=197799
Reviewed by Geoffrey Garen.
When the process-swap is forced by the client, we would not construct a SuspendedPageProxy for
the previous page, which would cause a white/black flash upon navigation on macOS. The reason
we did not construct a SuspendedPageProxy is that it would be unsafe to keep the page around
in this case because other windows might have an opener link to the page when the swap is forced
and we need those opener / openee links to get severed.
The new approach to maintain the Web facing behavior without flashing is to create a suspended
page proxy for the previous page when the process swap is forced by the client. We then close
the page as soon as we can do so without flashing (when pageEnteredAcceleratedCompositingMode()
has been called).
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::close):
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
(WebKit::SuspendedPageProxy::closeWithoutFlashing):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::commitProvisionalPage):
* UIProcess/WebPageProxy.h:
2019-05-10 Brent Fulgham <bfulgham@apple.com>
Streamline test-and-clear operation for ContextMenu
https://bugs.webkit.org/show_bug.cgi?id=197795
<rdar://problem/50473746>
Reviewed by Wenson Hsieh.
Rather than performing a check when entering the function, doing work,
then clearing the member variable, perform the check and clear in
a single operation. Only perform the selection if the menu exists.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didSelectItemFromActiveContextMenu):
2019-05-10 Megan Gardner <megan_gardner@apple.com>
Returning incorrect marked text rects
https://bugs.webkit.org/show_bug.cgi?id=197758
<rdar://problem/46548586>
Reviewed by Tim Horton.
We are not returning marked text rects in the correct view coordinate space.
This is the same translation we are applying to the caret rects.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
2019-05-10 Wenson Hsieh <wenson_hsieh@apple.com>
Let WebKit clients supply an application name for user agent in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=197782
<rdar://problem/50646747>
Reviewed by Beth Dakin.
Add plumbing for a new private property on WKWebpagePreferences.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _applicationNameForUserAgentWithModernCompatibility]):
(-[WKWebpagePreferences _setApplicationNameForUserAgentWithModernCompatibility:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
2019-05-10 Chris Dumez <cdumez@apple.com>
The active tab sometimes app naps even though it should not
https://bugs.webkit.org/show_bug.cgi?id=197791
<rdar://problem/48460054>
Reviewed by Geoffrey Garen.
The WebPage constructor was initializing m_activityState but not calling updateThrottleState().
As a result, we would not take a UserActivity even when warranted by the initial activity state.
* WebProcess/WebPage/WebPage.cpp:
2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] storage/indexeddb tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=196289
Reviewed by Alex Christensen.
storage/indexeddb tests were timing out for WinCairo port because
WebKit::NetworkCache classes were not implemented yet for Windows.
Implement WebKit::NetworkCache classes by using WTF::FileSystem
functions.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::readFile): Use
IOChannel::isOpened() to check the channel is opened instead of
checking the file descriptor.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::remove):
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::Data::mapToFile const):
(WebKit::NetworkCache::mapFile):
(WebKit::NetworkCache::adoptAndMapFile):
(WebKit::NetworkCache::makeSalt):
(WebKit::NetworkCache::readOrMakeSalt):
* NetworkProcess/cache/NetworkCacheData.h:
(WebKit::NetworkCache::Data::isEmpty const):
(WebKit::NetworkCache::Data::size const):
* NetworkProcess/cache/NetworkCacheDataCurl.cpp:
(WebKit::NetworkCache::Data::Data):
(WebKit::NetworkCache::Data::empty):
(WebKit::NetworkCache::Data::data const):
(WebKit::NetworkCache::Data::isNull const):
(WebKit::NetworkCache::Data::apply const):
(WebKit::NetworkCache::Data::subrange const):
(WebKit::NetworkCache::concatenate):
(WebKit::NetworkCache::Data::adoptMap): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::traverseDirectory):
(WebKit::NetworkCache::fileTimes):
(WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
* NetworkProcess/cache/NetworkCacheIOChannel.h:
(WebKit::NetworkCache::IOChannel::isOpened const):
(WebKit::NetworkCache::IOChannel::fileDescriptor const): Deleted.
* NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
(WebKit::NetworkCache::IOChannel::IOChannel):
(WebKit::NetworkCache::IOChannel::~IOChannel):
(WebKit::NetworkCache::runTaskInQueue):
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::write):
2019-05-10 Chris Dumez <cdumez@apple.com>
Do not wait until requestPermission() is called to fire deviceorientation events if permission was already granted
https://bugs.webkit.org/show_bug.cgi?id=197750
Reviewed by Geoffrey Garen.
The UIProcess remembers previous device orientation permission decisions per origin for the duration of the browsing
session. However, the WebContent process was not aware of previous decisions and would therefore not fire any
deviceorientation / devicemotion events until the JS has called requestPermission(). This patches addresses this
problem by having the UIProcess communicate any previous permission decision for the origin via WebSitePolicies.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp:
(WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowAccess):
(WebKit::WebDeviceOrientationAndMotionAccessController::cachedDeviceOrientationPermission const):
(WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const): Deleted.
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h:
2019-05-10 Chris Dumez <cdumez@apple.com>
Add WKWebViewConfiguration._canShowWhileLocked SPI
https://bugs.webkit.org/show_bug.cgi?id=197777
<rdar://problem/50065100>
Reviewed by Tim Horton.
* Platform/mac/LayerHostingContext.h:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy const):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::canShowWhileLocked const):
(API::PageConfiguration::setCanShowWhileLocked):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _setCanShowWhileLocked:]):
(-[WKWebViewConfiguration _canShowWhileLocked]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_canShowWhileLocked):
(WebKit::m_shrinkToFitContentTimer): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::canShowWhileLocked const):
2019-05-10 Michael Catanzaro <mcatanzaro@igalia.com>
Fix a bunch of compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=197785
Reviewed by Don Olmstead.
Guard Cocoa-specific format modifier to avoid -Wformat warning.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::fireConversionRequest):
2019-05-10 Chris Fleizach <cfleizach@apple.com>
AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
https://bugs.webkit.org/show_bug.cgi?id=197761
<rdar://problem/50237614>
Reviewed by Per Arne Vollan.
It's valid for the incoming voice to be nil, so we need to protect against that.
Tests: fast/speechsynthesis/speech-synthesis-real-client-version.html
* WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
(WebKit::WebSpeechSynthesisClient::speak):
2019-05-10 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Add webkit_frame_get_id() API
https://bugs.webkit.org/show_bug.cgi?id=197270
Reviewed by Carlos Garcia Campos.
It's as simple as can be: just an API to return the ID of a frame.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
(webkit_frame_get_id):
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:
2019-05-10 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
https://bugs.webkit.org/show_bug.cgi?id=197271
Reviewed by Youenn Fablet.
* WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
(API::InjectedBundle::FormClient::didAssociateFormControls):
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
(WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didAssociateFormControls):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2019-05-09 Rob Buis <rbuis@igalia.com>
Limit number of prefetches of a given page
https://bugs.webkit.org/show_bug.cgi?id=197736
Reviewed by Darin Adler.
Limit prefetches for same url to 1.
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::store):
2019-05-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out most of r245151.
Caused assertions in High Sierra
Reverted most of changeset:
"Remove now-unnecessary Connection::sendMessageWithReply"
https://bugs.webkit.org/show_bug.cgi?id=197747
https://trac.webkit.org/changeset/245151
2019-05-09 Daniel Bates <dabates@apple.com>
[iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused
https://bugs.webkit.org/show_bug.cgi?id=197746
<rdar://problem/50630406>
Reviewed by Brent Fulgham.
Be even lazier. We only need to create a keyboard if an editable element is focused or on
the first hardware keydown when a non-editable element is focused. We currently do the former.
Let's also do the latter.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]): Reset bookkeeping.
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Further condition the result on
whether we have seen a hardware keydown event in a non-editable element.
(-[WKContentView _handleKeyUIEvent:]): If this is the first hardware key event we've seen then
update state and call -reloadInputView. -reloadInputView will call us back in -_requiresKeyboardWhenFirstResponder
and we will now return YES. So, it will create the keyboard.
(-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reset bookkeeping.
2019-05-08 Dean Jackson <dino@apple.com>
Guard long press link preview with a USE macro rather than complicated includes
https://bugs.webkit.org/show_bug.cgi?id=197728
<rdar://problem/50604700>
Reviewed by Wenson Hsieh.
It was getting complicated to manage the coordination between WebKitAdditions
and WebKit without having to split up the includes into multiple files
or have lots of duplication.
Instead, WebKitAdditions will now define a USE macro which can be used
in various places through WebKit.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView _contentsOfUserInterfaceItem:]):
(previewIdentifierForElementAction):
(-[WKContentView shouldUsePreviewForLongPress]):
(-[WKContentView _registerPreview]):
(-[WKContentView _unregisterPreview]):
(shouldUsePreviewForLongPress): Deleted.
(-[WKContentView _registerPreviewLongPress]): Deleted.
(-[WKContentView _unregisterPreviewLongPress]): Deleted.
2019-05-09 Alex Christensen <achristensen@webkit.org>
Remove now-unnecessary Connection::sendMessageWithReply
https://bugs.webkit.org/show_bug.cgi?id=197747
Reviewed by Tim Horton.
The WebProcess messages that use it already do the right thing with CompletionHandlers and can be replaced by sendWithAsyncReply.
The SecItemShim message that uses it can be replaced by sendSync.
This patch only increases responsiveness when clearing website data and removes the need for a WorkQueue dedicated entirely to the SecItemShim.
* Platform/IPC/Connection.cpp:
(IPC::Connection::invalidate):
(IPC::Connection::processIncomingSyncReply):
(IPC::Connection::connectionDidClose):
(IPC::Connection::sendMessageWithReply): Deleted.
* Platform/IPC/Connection.h:
(IPC::Connection::send):
(IPC::Connection::sendWithReply): Deleted.
* Shared/mac/SecItemResponseData.h:
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
(WebKit::workQueue): Deleted.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* WebProcess/WebProcess.messages.in:
2019-05-09 Dean Jackson <dino@apple.com>
Build fix for iOS.
* UIProcess/WKImagePreviewViewController.mm:
2019-05-09 Alex Christensen <achristensen@webkit.org>
Remove unnecessary test SPI after r244883
https://bugs.webkit.org/show_bug.cgi?id=197575
Reviewed by Tim Horton.
We now have two ways of doing the same thing. Let's remove the one that's only for testing,
and make the tests clean up like an application would.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeCredential): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::removeCredential): Deleted.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _removeCredential:forProtectionSpace:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeCredential): Deleted.
* UIProcess/WebProcessPool.h:
2019-05-09 Daniel Bates <dabates@apple.com>
REGRESSION (r241734): 1% slower PLT on iPad
https://bugs.webkit.org/show_bug.cgi?id=197745
<rdar://problem/50457731>
Reviewed by Per Arne Vollan.
For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard
is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached.
We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>.
In r241734 we unified the key event handling code paths so we use exactly one for both software and
hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when
the WKContentView becomes first responder. We did this so that we could continue listening for hardware
key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always
creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is
attached or an editable element is focused.
(-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard
creation) if -_requiresKeyboardWhenFirstResponder returns YES.
2019-05-09 Daniel Bates <dabates@apple.com>
[iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard)
https://bugs.webkit.org/show_bug.cgi?id=197632
<rdar://problem/47902054>
Reviewed by Brent Fulgham.
Fixes an issue where it is not possible to submit a <form> with target = "_blank": a form that
opens a new window.
By default we only allow popups to open if they were user initiated (like when a person clicks
on a link). We achieve this by putting a token on the stack, called the UserGestureToken when
WebCore processes an event from WebKit. So long as this token is on the stack we consider
all requests to open a popup to be user initiated. And we implicitly submit a form when pressing
the Return key in an HTML input element during the processing of a TextInputEvent dispatched as
part of inserting a '\n' into the field. On Mac, the keydown dispatches a TextInputEvent synchronously.
However on iOS text insertion, and hence a dispatch of a TextInputEvent event, occurs asynchronously
with respect to the keydown event. So, by the time the UI process calls back to the WebProcess
to perform the text insertion of '\n' we have long since popped the UserGestureToken off the stack
and hence we disallow opening a popup. To fix this, when -insertText is called we query the keyboard
to determine if it's being called by the keyboard. If it is then we can assume that this is
part of key event handling and hence was initiated by the user. We can pass along this detail
to the WebProcess for it to push a new UserGestureToken onto the stack.
For now we only track whether text inserted by the keyboard was user initiated or not. In
<https://bugs.webkit.org/show_bug.cgi?id=197721> we will fix this up for all editing commands.
* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/Cocoa/InsertTextOptions.cpp:
(IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode):
(IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode):
Encode and decode whether we are processing a user gesture.
* Shared/Cocoa/InsertTextOptions.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertText:]): Query the keyboard to determine whether it called us or
the embedding client did. We only want to privilege user initiated actions (the keyboard).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync): Push a UserGestureToken onto the stack that is initialized
depending on whether we are or are not processing a user gesture.
2019-05-09 Antoine Quint <graouts@apple.com>
pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
https://bugs.webkit.org/show_bug.cgi?id=197738
<rdar://problem/50588613>
Reviewed by Antti Koivisto.
We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.
To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
starts.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.
2019-05-08 Antoine Quint <graouts@apple.com>
[iOS] Correctly handle overlapping regions for elements with a touch-action property
https://bugs.webkit.org/show_bug.cgi?id=194813
<rdar://problem/48194708>
Reviewed by Antti Koivisto.
We now use WebKit::touchActionsForPoint() to determine the touch actions for a given touch using its location in -[WKContentViewInteraction
_handleTouchActionsForTouchEvent:]. We then record these touch actions for the touch's identifier on the RemoteScrollingCoordinatorProxy.
Then, as we interact with a UIScrollView, we get its gesture recognizer and get its active touch identifier through the new
-[WKContentViewInteraction activeTouchIdentifierForGestureRecognizer:] method, and query the RemoteScrollingCoordinatorProxy for the touch
actions matching that touch identifier.
Tests: pointerevents/ios/touch-action-none-overlap.html
pointerevents/ios/touch-action-pan-x-overlap.html
pointerevents/ios/touch-action-pan-y-overlap.html
pointerevents/ios/touch-action-pinch-zoom-overlap.html
* UIProcess/PageClient.h:
(WebKit::PageClient::activeTouchIdentifierForGestureRecognizer):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Maintain a touch identifier to touch actions map.
(WebKit::RemoteScrollingCoordinatorProxy::activeTouchActionsForTouchIdentifier const):
(WebKit::RemoteScrollingCoordinatorProxy::setTouchActionsForTouchIdentifier):
(WebKit::RemoteScrollingCoordinatorProxy::clearTouchActionsForTouchIdentifier):
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const): Deleted.
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const): Deleted.
(WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier): Deleted.
(WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier): Deleted.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const): Deleted.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::activeTouchIdentifierForGestureRecognizer):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
(-[WKContentView _handleTouchActionsForTouchEvent:]):
2019-05-08 Megan Gardner <megan_gardner@apple.com>
Add quirks to emulate undo and redo in hidden editable areas on some websites
https://bugs.webkit.org/show_bug.cgi?id=197452
Reviewed by Alex Christensen.
We need to make our own undo manager to allow undo even when
the manager is empty. This is to interface with rich editing
websites that don't actually interface with our undo abilities.
Then we need to generate synthetic undo and redo in the web process.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isCurrentURLHost const):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKNSUndoManager initWithContentView:]):
(-[WKNSUndoManager canUndo]):
(-[WKNSUndoManager canRedo]):
(-[WKNSUndoManager undo]):
(-[WKNSUndoManager redo]):
(-[WKContentView undoManager]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView generateSyntheticUndoRedo:]):
(-[WKContentView hasHiddenContentEditable]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::generateSyntheticUndoRedo):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleEditingKeyboardEvent):
(WebKit::WebPage::generateSyntheticUndoRedo):
2019-05-08 Alex Christensen <achristensen@webkit.org>
Add SPI to set HSTS storage directory
https://bugs.webkit.org/show_bug.cgi?id=197259
<rdar://problem/48797895>
Reviewed by Brady Eidson.
It is with great sadness that I lament the design of this SPI, which is necessitated by the process-global nature of the SPI that
I must call and the time at which I must call it (before any networking calls have been made).
I'm also not thrilled about the fact that the unit test infrastructure I developed for this in r244594 cannot be used because
the SPI that I must call does not work on iOS simulator or Mac. I have verified the SPI is being called and that when called on iOS,
and that CFNetwork does the right thing with it.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
(-[_WKProcessPoolConfiguration hstsStorageDirectory]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-05-08 Daniel Bates <dabates@apple.com>
Pass insertTextAsync options as a struct
https://bugs.webkit.org/show_bug.cgi?id=197710
Reviewed by Brent Fulgham.
WebPageProxy::insertTextAsync() is becoming unwieldy to work with given the large number of
optional arguments that can be passed to it. Let's pass a struct instead.
* Shared/Cocoa/InsertTextOptions.cpp: Added.
(IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode):
(IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode):
* Shared/Cocoa/InsertTextOptions.h: Added.
* Shared/EditingRange.h: Add EnumTrait so that we can encode the EditingRangeIsRelativeTo
enumeration.
* SourcesCocoa.txt: Add a new file.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::insertText): Update code now that we pass a struct.
(WebKit::WebViewImpl::setMarkedText): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::insertTextAsync): Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertText:]): Ditto.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::insertDictatedTextAsync): Ditto.
* WebKit.xcodeproj/project.pbxproj: Add new files.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync): Ditto.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Ditto.
2019-05-08 Timothy Hatcher <timothy@apple.com>
Add plumbing for inactive system colors in RenderTheme cache.
https://bugs.webkit.org/show_bug.cgi?id=197699
rdar://problem/49406936
Reviewed by Tim Horton.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsInactive):
* UIProcess/PageClient.h:
(WebKit::PageClient::effectiveAppearanceIsInactive const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useInactiveAppearance const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shrinkToFitContentTimer):
(WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
2019-05-08 Chris Dumez <cdumez@apple.com>
Regression: Crash at WebKit: PAL::HysteresisActivity::start
https://bugs.webkit.org/show_bug.cgi?id=197666
<rdar://problem/50037153>
Reviewed by Geoffrey Garen.
We've recently made it so that the WebContent process destroys its WebSQLiteDatabaseTracker when preparing
for process suspension and then re-constructs it when resuming. The issue is that the WebSQLiteDatabaseTracker
internal implementation was calling callOnMainThread() and capturing |this| to start/stop its HysteresisActivity.
As a result, |this| could be dead by the time we're on the main thread and we'd crash.
To address the issue, we no longer destroy the WebSQLiteDatabaseTracker when preparing to suspend. Instead, we
set a 'isSuspended' flag on the WebSQLiteDatabaseTracker so that it stops notifying the WebProcess of changes.
Also clean up the class a bit so that:
1. The constructor takes in a WTF::Function instead of a NetworkProcess / WebProcess reference. This is provides
better layering. The WebSQLiteDatabaseTracker should not need to know anything about those objects.
2. Use RunLoop::main().dispatch() instead of callOnMainThread() since we're in WebKit2 code.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
(WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated): Deleted.
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_nonVisibleProcessCleanupTimer):
(WebKit::WebProcess::initializeSQLiteDatabaseTracker):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
(WebKit::m_webSQLiteDatabaseTracker): Deleted.
* WebProcess/WebProcess.h:
2019-05-08 Tim Horton <timothy_horton@apple.com>
iOS: Selection is dismissed even if click is preventDefault()'d
https://bugs.webkit.org/show_bug.cgi?id=197686
<rdar://problem/49398824>
Reviewed by Wenson Hsieh.
We currently unconditionally dismiss the selection on any tap; however
if a site preventDefault()s on click, we shouldn't perform the default
action of dismissing the selection.
Instead of clearing the selection in the UI process, clear it in the
Web content process if we don't dispatch a synthetic click; the normal
WebCore machinery will handle it in the case that we do.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapRecognized:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::commitPotentialTapFailed):
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::clearSelection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
2019-05-08 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Support navigation gesture on touchscreens
https://bugs.webkit.org/show_bug.cgi?id=197690
Reviewed by Michael Catanzaro.
Touch events generate scroll events that are handled in webkitWebViewBaseHandleWheelEvent(),
bypassing webkitWebViewBaseScrollEvent(). Because of that, ViewGestureController never receives
them. Hence pass scroll events to ViewGestureController in webkitWebViewBaseHandleWheelEvent()
instead.
For touch events, gesture progress calculation has to take window width into account to make
the page perfectly follow finger, and deltas are additionally divided by Scrollbar::pixelsPerLineStep(),
so compensate for that.
For touchpad events, change delta multiplier to 10 to match GTK behavior, and introduce a 400px
base width so the swipe speed doesn't change from the previous behavior.
Because of the multiplier change, threshold for triggering the gesture with touchpad is now 4
times larger.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseHandleWheelEvent): Move ViewGestureController bits here.
(webkitWebViewBaseScrollEvent): Removed ViewGestureController bits.
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
Allow events from touchscreen devices.
(WebKit::isTouchEvent): Added.
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
Change delta multipliers.
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
Change delta multipliers, account for view width for touchscreen events.
2019-05-08 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add a quirk to synthesize mouse events when modifying the selection
https://bugs.webkit.org/show_bug.cgi?id=197683
<rdar://problem/48003980>
Reviewed by Tim Horton.
Introduces support for dispatching synthetic mouse events when modifying the selection on some websites. See
below for more details.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::selectAll):
* UIProcess/WebPageProxy.h:
Instead of executing a "SelectAll" editing command using the generic WebPage::executeEditCommand method,
introduce a separate method for selectAll that executes the "SelectAll" edit command and then does some
platform-specific work. See platformDidSelectAll.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView selectAllForWebView:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::selectAll):
(WebKit::WebPage::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
Add a helper method to determine whether the quirk should be enabled.
(WebKit::WebPage::platformDidSelectAll):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::elementRectInRootViewCoordinates):
Move this function closer to the top of the file so that it can be used in
dispatchSyntheticMouseEventsForSelectionGesture.
(WebKit::WebPage::clearSelection):
(WebKit::WebPage::dispatchSyntheticMouseEventsForSelectionGesture):
Add a helper method to dispatch a synthetic mouse event for a given selection gesture type. Used in several
places in WebPageIOS to synthesize and dispatch mouse events during selection.
(WebKit::WebPage::updateSelectionWithTouches):
When changing the selection with selection handles, fake mousedown when the user first touches down on the
selection handle; mousemove as the user is moving the handle around; and finally, mouseup when the user lets go.
(WebKit::WebPage::extendSelection):
(WebKit::WebPage::platformDidSelectAll):
When tapping "Select All" and/or "Select" in the callout menu, fake a mousedown at the selection start, then a
mousemove at selection end, and finally, a mouseup at selection end.
(WebKit::WebPage::getFocusedElementInformation):
2019-05-08 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Pinch Zooming has no maximum
https://bugs.webkit.org/show_bug.cgi?id=194865
Reviewed by Michael Catanzaro.
Set maximum zoom to 3.0, reflecting the value on macOS and iOS.
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::ZoomGesture::scaleChanged):
2019-05-08 Rob Buis <rbuis@igalia.com>
Link prefetch not useful for top-level navigation
https://bugs.webkit.org/show_bug.cgi?id=195623
Reviewed by Youenn Fablet.
Cache cross-domain top-level prefetches in a dedicated cache. When a navigation
to the same url is done within a threshold (5 seconds), reuse the
prefetch cache entry, move it to the disk cache and navigate to
the url, meaning no extra network trip is needed. When not used within
the threshold period, the prefetch entry will be erased using a timer.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::prefetchCache):
(WebKit::NetworkSession::clearPrefetchCache):
* NetworkProcess/cache/PrefetchCache.cpp: Added.
(WebKit::PrefetchCache::Entry::Entry):
(WebKit::PrefetchCache::PrefetchCache):
(WebKit::PrefetchCache::~PrefetchCache):
(WebKit::PrefetchCache::clear):
(WebKit::PrefetchCache::take):
(WebKit::PrefetchCache::store):
(WebKit::PrefetchCache::clearExpiredEntries):
* NetworkProcess/cache/PrefetchCache.h: Added.
(WebKit::PrefetchCache::Entry::releaseBuffer):
* Shared/WebPreferences.yaml:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-05-07 Chris Dumez <cdumez@apple.com>
Simplify logic to prevent App Nap in WebPage
https://bugs.webkit.org/show_bug.cgi?id=197674
Reviewed by Geoff Garen.
Simplify logic to prevent App Nap in WebPage. We do not need both m_userActivityHysteresis and
m_userActivity since UserActivity is already a HysteresisActivity. We had 2 levels of
HysteresisActivity stacked on top of one another. Also rename "process suppression" to "app nap" as
I find it clearer.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::updatePreferences):
(WebKit::m_userActivityHysteresis): Deleted.
(WebKit::WebPage::updateUserActivity): Deleted.
* WebProcess/WebPage/WebPage.h:
2019-05-07 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r244230): Web Automation: use null instead of empty string as success result of scripts when alert is open
https://bugs.webkit.org/show_bug.cgi?id=197655
Reviewed by Devin Rousso.
This regressed in r244230, the case of an alert open while running a script is now handled in WebKit side, but
an empty string is returned as a result, which is not a valid JSON serialized string. That made all user prompts
tests to fail.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog): Use null as script result instead of an empty string.
2019-05-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245038.
Breaks internal builds.
Reverted changeset:
"Add SPI to set a list of hosts to which to send custom header
fields cross-origin"
https://bugs.webkit.org/show_bug.cgi?id=197397
https://trac.webkit.org/changeset/245038
2019-05-07 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] A new request should always suppress the pending request if any
https://bugs.webkit.org/show_bug.cgi?id=191517
<rdar://problem/46888222>
Reviewed by Brent Fulgham.
Previously we blocked new WebAuthN requests whenever a pending request was in progress
to prevent background tabs from DoS foreground tabs. However, in r244938, the WebAuthN
API was changed to restrict request handling to the focused document. Therefore, we no
longer have a risk of DoS.
Apart from the vanished benefit, this behavoir actually blocks new pages to use
WebAuthN API in the period between [the previous initating page is closed, the pending
request is hanedled/timeout].
Also, it makes sense to have the current focused document preempt the pending request.
Therefore, the policy will be to always cancel any pending requests whenever a new
request is made. This will enforce the policy of handling only one request at a time.
Note that the current implementation doesn't explicitly cancel pending requests in the
Authenticators, which means that we could receive responses from the Authenticator that
were meant for a previous (now cancelled) request. A follow-up patch (see Bug 191523)
will implement an Authenticator feature to support immediate cancellation.
In the meantime, to protect the atomicity of the request/response pair, i.e., preventing an old
response being used for a new request, there are two safeguards:
1) In web process, each request to UI process is paired with an incremental ID, and therefore an old
response from UI process would have a different ID than the current request, which will then be ignored.
2) In UI process, all responses from authenticators will be piped to the main run loop for processing.
Therefore, when the new request comes in, the old response is either processed or waiting in the pipe.
To prevent the latter being processed, the new request will immediately destroy any authenticators bound
to the old response in the current run loop. Hence, in the next run loop when dealing the old response,
the lambda will have no where to hand the response over.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::makeCredential):
(WebKit::AuthenticatorManager::getAssertion):
(WebKit::AuthenticatorManager::clearStateAsync):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
(WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
(WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
(WebKit::WebAuthenticatorCoordinatorProxy::requestReply):
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
* WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
(WebKit::WebAuthenticatorCoordinator::makeCredential):
(WebKit::WebAuthenticatorCoordinator::getAssertion):
* WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in:
2019-05-07 Per Arne Vollan <pvollan@apple.com>
[macOS] Crash with sandbox error
https://bugs.webkit.org/show_bug.cgi?id=197675
<rdar://problem/50473330>
Reviewed by Geoffrey Garen.
This crash is caused by missing syscall rules in the sandbox.
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-07 Alex Christensen <achristensen@webkit.org>
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397
Reviewed by Geoff Garen.
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:
2019-05-07 Adrian Perez de Castro <aperez@igalia.com>
[GTK][WPE] Cannot build documentation with gtk-doc
https://bugs.webkit.org/show_bug.cgi?id=197663
Reviewed by Philippe Normand.
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init): Escape content which gets wrongly interpreted as
SGML tags by gtk-doc as Markdown preformatted content, which fits well for the
tag names in the documentation for the WebKitSettings:enable-media property.
2019-05-07 John Wilander <wilander@apple.com>
Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
https://bugs.webkit.org/show_bug.cgi?id=197648
<rdar://problem/50527493>
Reviewed by Chris Dumez.
Developers have requested two minor changes to the Storage Access API:
- Only consume the user gesture when the user explicitly denies access.
- Make document.hasStorageAccess() return true instead of false when the feature is off.
In addition to this, we have refactoring and cleanup to do. Namely:
- Make use of WebCore::RegistrableDomain all the way.
- Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
- Introduce boolean enums for state handling.
- Break out the Storage Access API functionality into a supplement of WebCore::Document.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Deleted.
This function is now no longer exposed and its functionality could be folded into
the existing WebResourceLoadStatisticsStore::requestStorageAccess() which is more
clearly named.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasStorageAccessForFrame): Deleted.
(WebKit::NetworkProcess::hasStorageAccess): Deleted.
(WebKit::NetworkProcess::requestStorageAccess): Deleted.
(WebKit::NetworkProcess::requestStorageAccessGranted): Deleted.
(WebKit::NetworkProcess::grantStorageAccess): Deleted.
(WebKit::NetworkProcess::removeAllStorageAccess): Deleted.
These functions were left behind in the move of ITP to the network process.
This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Scripts/webkit/messages.py:
Instructions for derived IPC code on how to include the new enums
WebCore::StorageAccessWasGranted and WebCore::StorageAccessPromptWasShown.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame): Deleted.
(WebKit::NetworkProcessProxy::hasStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::requestStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::grantStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::removeAllStorageAccess): Deleted.
These functions were left behind in the move of ITP to the network process.
This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasStorageAccess): Deleted.
(WebKit::WebsiteDataStore::requestStorageAccess): Deleted.
(WebKit::WebsiteDataStore::grantStorageAccess): Deleted.
These functions were left behind in the move of ITP to the network process.
This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::hasStorageAccess):
(WebKit::WebChromeClient::requestStorageAccess):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown. They also receive WebCore::RegistrableDomain
objects instead of Strings now.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
These changes are due to the new enums WebCore::StorageAccessWasGranted and
WebCore::StorageAccessPromptWasShown. They also receive WebCore::RegistrableDomain
objects instead of Strings now.
* WebProcess/WebPage/WebPage.h:
2019-05-07 John Wilander <wilander@apple.com>
Change IsITPFirstPartyWebsiteDataRemovalEnabled from DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to true.
https://bugs.webkit.org/show_bug.cgi?id=197667
<rdar://problem/50549288>
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
2019-05-07 Tim Horton <timothy_horton@apple.com>
iOSMac Share Sheet shows up at the wrong place
https://bugs.webkit.org/show_bug.cgi?id=197649
<rdar://problem/49922942>
Reviewed by Megan Gardner.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showShareSheet:inRect:completionHandler:]):
(-[WKContentView _hoverGestureRecognizerChanged:]):
Pass the last mouse-over location as the presentation location for the
share sheet, if we don't have a rect to present from. Centering the popover
like we do on iPad doesn't work so well (at all) with a macOS context menu.
2019-05-07 Chris Dumez <cdumez@apple.com>
Rename ConnectionMac.mm to ConnectionCocoa.mm since it is used on both macOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=197661
Reviewed by Alexey Proskuryakov.
* Platform/IPC/cocoa/ConnectionCocoa.mm: Renamed from Source/WebKit/Platform/IPC/mac/ConnectionMac.mm.
(IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
(IPC::Connection::platformInvalidate):
(IPC::Connection::cancelReceiveSource):
(IPC::Connection::terminateSoon):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
(IPC::Connection::sendMessage):
(IPC::Connection::platformCanSendOutgoingMessages const):
(IPC::Connection::sendOutgoingMessage):
(IPC::Connection::initializeSendSource):
(IPC::Connection::resumeSendSource):
(IPC::createMessageDecoder):
(IPC::readFromMachPort):
(IPC::Connection::receiveSourceEventHandler):
(IPC::Connection::identifier const):
(IPC::Connection::getAuditToken):
(IPC::Connection::kill):
(IPC::AccessibilityProcessSuspendedNotification):
(IPC::Connection::willSendSyncMessage):
(IPC::Connection::didReceiveSyncReply):
(IPC::Connection::remoteProcessID const):
* Platform/IPC/cocoa/ImportanceAssertion.h: Renamed from Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h.
(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::~ImportanceAssertion):
* Platform/IPC/cocoa/MachMessage.cpp: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.cpp.
(IPC::MachMessage::create):
(IPC::MachMessage::MachMessage):
(IPC::MachMessage::~MachMessage):
(IPC::MachMessage::messageSize):
(IPC::MachMessage::leakDescriptors):
* Platform/IPC/cocoa/MachMessage.h: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.h.
(IPC::MachMessage::size const):
(IPC::MachMessage::header):
(IPC::MachMessage::messageReceiverName const):
(IPC::MachMessage::messageName const):
* Platform/IPC/cocoa/MachPort.h: Renamed from Source/WebKit/Platform/IPC/mac/MachPort.h.
(IPC::MachPort::MachPort):
(IPC::MachPort::encode const):
(IPC::MachPort::decode):
(IPC::MachPort::port const):
(IPC::MachPort::disposition const):
* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-05-07 Antti Koivisto <antti@apple.com>
<body> with overflow:hidden shouldn't be keyboard scrollable on iOS
https://bugs.webkit.org/show_bug.cgi?id=197659
<rdar://problem/50541453>
Reviewed by Antoine Quint.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
Disable also keyboard scrolling when touch scrolling is disabled.
2019-05-07 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Avoid crashing the UI process when writing empty data to the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=197644
<rdar://problem/50526364>
Reviewed by Tim Horton.
Test: WebKit.WKWebProcessPlugInDoNotCrashWhenCopyingEmptyClientData
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::setBufferForType):
Make this function robust by not attempting to create a shared memory buffer in the case where the given data
buffer is empty.
2019-05-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash in webkitWebViewBaseSetEnableBackForwardNavigationGesture
https://bugs.webkit.org/show_bug.cgi?id=197653
Reviewed by Žan Doberšek.
We still need to null-check the ViewGestureController there, since it can be called with a running process but
not yet attached when using a related view.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSetEnableBackForwardNavigationGesture):
2019-05-07 Antti Koivisto <antti@apple.com>
<body> with overflow:hidden CSS is scrollable on iOS
https://bugs.webkit.org/show_bug.cgi?id=153852
<rdar://problem/38715356>
Reviewed by Antoine Quint.
Disable touch scrolling of the main scroll view when <body> has overflow:hidden.
This already works for subframes where we don't create a scrollview in the first place.
The patch also adds a test for that.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
Update scrollability after scrolling tree commits.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
Base the decision on root ScrollingTreeScrollingNode::canHaveScrollbars() which is computed from overflow.
This matches Mac where wheel event dispatch is similarly blocked based on this property.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2019-05-06 James Savage <james.savage@apple.com>
Improve coordination for creating UIWindow instances.
https://bugs.webkit.org/show_bug.cgi?id=197578.
<rdar://problem/50456965>.
Reviewed by Wenson Hsieh.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(makeWindowFromView): Pull out window creation.
(-[WKFullScreenWindowController enterFullScreen]): Call new helper function.
2019-05-06 Tim Horton <timothy_horton@apple.com>
_overrideViewportWithArguments does not work when called before loading
https://bugs.webkit.org/show_bug.cgi?id=197638
<rdar://problem/50505111>
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setOverrideViewportArguments):
2019-05-06 Chris Dumez <cdumez@apple.com>
ASSERT at WebKit::NetworkCache::makeSafeToUseMemoryMapForPath under Storage::StoreBodyAsBlob when running WebDriver tests
https://bugs.webkit.org/show_bug.cgi?id=197635
<rdar://problem/50473149>
Reviewed by Geoffrey Garen.
We need to make sure the the path at blobPathString exists before calling FileSystem::makeSafeToUseMemoryMapForPath().
If the blob does not already exist when BlobStorage::add() is called, what will create it is the call to Data::mapToFile().
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
2019-05-06 Wenson Hsieh <wenson_hsieh@apple.com>
Occasional crashes in layout tests when firing the shrink-to-fit-content timer
https://bugs.webkit.org/show_bug.cgi?id=197629
<rdar://problem/50514382>
Reviewed by Tim Horton.
Fixes several crashing layout tests by stopping the shrink-to-fit-content timer when the page closes.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
2019-05-04 Per Arne Vollan <pvollan@apple.com>
-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=197510
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2019-05-06 Keith Rollin <krollin@apple.com>
Temporarily disable generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=197619
<rdar://problem/50507392>
Reviewed by Alex Christensen.
We need to perform a significant update to the generate-xcfilelist
scripts. This work involves coordinated work with another facility. If
the work does not occur in tandem, the build will be broken. To avoid
this, disable the invoking of the scripts during the transition. The
checking will be restored once the new scripts are in place.
* Scripts/check-xcfilelists.sh:
2019-05-06 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r244984.
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-05-06 Chris Dumez <cdumez@apple.com>
Prewarmed WebContent processes never app nap
https://bugs.webkit.org/show_bug.cgi?id=197630
Reviewed by Geoffrey Garen.
Do not require actually having a WebPage in the WebContent process to App Nap.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2019-05-06 Daniel Bates <dabates@apple.com>
Fix the build after r244975
(https://bugs.webkit.org/show_bug.cgi?id=197474)
Actually make use of the Keyboard Event when building with USE(UIKIT_KEYBOARD_ADDITIONS)
and substitute -> for . since it's now passed by reference.
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::handleInputMethodKeydown):
2019-05-06 Jer Noble <jer.noble@apple.com>
Adopt AVStreamDataParser.audiovisualMIMETypes
https://bugs.webkit.org/show_bug.cgi?id=197581
<rdar://problem/50458981>
Reviewed by Eric Carlson.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):
(WebKit::WebProcess::setMediaMIMETypes):
2019-05-06 Chris Dumez <cdumez@apple.com>
Terminate service workers that use too much CPU / power
https://bugs.webkit.org/show_bug.cgi?id=197626
<rdar://problem/50374707>
Reviewed by Geoffrey Garen.
Terminate service worker processes that use over 50% CPU on average over the last 8 minutes,
similarly to what we do for background WebContent processes.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didExceedCPULimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateCPULimit):
(WebKit::WebProcess::updateCPUMonitorState):
2019-05-06 Daniel Bates <dabates@apple.com>
Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
https://bugs.webkit.org/show_bug.cgi?id=197474
<rdar://problem/47219324>
Reviewed by Ryosuke Niwa.
Adopt UIKit SPI (added in <rdar://problem/50181162>) to ask the Input Manager to handle
the key event. If the Input Manager handled it then we pass along this information to
WebCore, just as we do for Mac, so that it can alter its event handling logic. Otherwise,
we handle the event as we do now.
A large part of this patch is fixing up #if defs to compile more Mac code when building
on iOS.
* Platform/spi/ios/UIKitSPI.h: Expose more SPI.
* Shared/NativeWebKeyboardEvent.h:
* Shared/WebEvent.h:
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode const):
(WebKit::WebKeyboardEvent::decode):
* Shared/ios/NativeWebKeyboardEventIOS.mm:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):
Compile more Mac code on iOS. Just like on Mac we maintain some bookkeeping on
whether an event was handled by the Input Manager.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage): Pass NativeWebKeyboardEvent::HandledByInputMethod::No
to keep the behavior we have now.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView shouldSuppressUpdateCandidateView]): Added. Used to tell UIKit whether to
suppress updating/showing the candidate view.
(-[WKContentView setMarkedText:selectedRange:]):
Bookkeeping to track whether we need to delay showing/updating the inline candidate view.
The concept in UIKit is deferment, but at the time of writing its simply a request to delay
the update for 0.4 seconds. We opt into this delay only for the first key that begins
marked text (i.e. the transition from no marked text to marked text). We do this because we
may not have up-to-date editor state at the time UIKit is ready to show/update the inline
candidate view for us to answer -textFirstRect and -textLastRect, which UIKit calls as part
of computing the frame rect for the inline candidate view on screen. Once we receive up-to-date
editor state, in -selectionChanged, we tell UIKit to layout the keyboard, which ultimately
causes it to re-compute the frame rect for the inline candidate view and show it.
(-[WKContentView handleKeyWebEvent:]): Pass NativeWebKeyboardEvent::HandledByInputMethod::No
to keep the behavior we have now.
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]): Ask the keyboard to handle the
event using the Input Manager. If it was handled then there is no need to delay calling the
completion handler, call it, then tell the web process about the key event and that it was
already handled by the Input Manager.
(-[WKContentView _selectionChanged]): Tell the keyboard to update the candidate view, if needed.
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::handleInputMethodKeydown): Mark the event as default handled if
the UI process told us that the event was handled by the Input Manager just like we do on Mac.
2019-05-06 Alex Christensen <achristensen@webkit.org>
Null check m_mainFrame in WebPageProxy.cpp
https://bugs.webkit.org/show_bug.cgi?id=197618
<rdar://problem/47463054>
Reviewed by Geoffrey Garen.
It's already null checked in some places, and the places where it isn't are causing crashes.
Let's fix all of them.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):
2019-05-06 Brent Fulgham <bfulgham@apple.com>
Use more efficient path resolution logic
https://bugs.webkit.org/show_bug.cgi?id=197389
<rdar://problem/50268491>
Reviewed by Maciej Stachowiak.
The code in SandboxExtensionsCocoa.mm 'resolveSymlinksInPath' is pretty inefficient, and tries to reproduce (badly)
logic that is already provided by the operating system.
To make matters worse, 'resolvePathForSandboxExtension' was effectively performing the work of fully resolving
symlinks twice, since NSString's 'stringByStandardizingPath' method does some of this already.
Instead, we should just use NSString's 'stringByResolvingSymlinksInPath', which does the symlink resolution
using more efficient logic than our 'resolveSymlinksInPath' code.
* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::resolveSymlinksInPath): Removed.
(WebKit::resolvePathForSandboxExtension): Remove redundant call to 'resolveSymlinksInPath', and switches from
'stringByStandardizingPath' to 'stringByResolvingSymlinksInPath', which can take the place of both calls.
(WebKit::stringByResolvingSymlinksInPath): Switch to call 'stringByResolvingSymlinksInPath'.
2019-05-06 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce SPI to request modern compatibility mode but defer to site-specific quirks
https://bugs.webkit.org/show_bug.cgi?id=197614
<rdar://problem/50208577>
Reviewed by Tim Horton.
Add plumbing for a new _allowSiteSpecificQuirksToOverrideCompatibilityMode SPI property on
WKWebpagePreferences.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _allowSiteSpecificQuirksToOverrideCompatibilityMode]):
(-[WKWebpagePreferences _setAllowSiteSpecificQuirksToOverrideCompatibilityMode:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/WebPageProxy.cpp:
Use currentRequest instead of originalRequest; see internal change for more details.
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-05-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r244917.
Caused
TestWebKitAPI.WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog
failure on debug bots.
Reverted changeset:
"Use more efficient path resolution logic"
https://bugs.webkit.org/show_bug.cgi?id=197389
https://trac.webkit.org/changeset/244917
2019-05-04 Alex Christensen <achristensen@webkit.org>
Revert r244953 and r244954 because they broke internal builds.
https://bugs.webkit.org/show_bug.cgi?id=197534
* Platform/spi/ios/PDFKitSPI.h:
* Platform/spi/ios/UIKitSPI.h: Added.
(currentUserInterfaceIdiomIsPad):
* Shared/DocumentEditingContext.mm:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
* Shared/ios/NativeWebTouchEventIOS.mm:
* Shared/ios/WebIconUtilities.mm:
* UIProcess/API/Cocoa/NSAttributedString.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ApplicationStateTracker.mm:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
* UIProcess/Cocoa/WKShareSheet.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* UIProcess/WKImagePreviewViewController.mm:
* UIProcess/_WKTouchEventGenerator.mm:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/InputViewUpdateDeferrer.mm:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/ios/SmartMagnificationController.mm:
* UIProcess/ios/TextCheckerIOS.mm:
* UIProcess/ios/ViewGestureControllerIOS.mm:
* UIProcess/ios/WKActionSheet.mm:
* UIProcess/ios/WKActionSheetAssistant.mm:
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
* UIProcess/ios/WKPDFView.mm:
* UIProcess/ios/WKPasswordView.mm:
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKWebEvent.mm:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
* UIProcess/ios/forms/WKFocusedFormControlView.h:
* UIProcess/ios/forms/WKFormColorControl.mm:
* UIProcess/ios/forms/WKFormColorPicker.mm:
* UIProcess/ios/forms/WKFormInputControl.mm:
* UIProcess/ios/forms/WKFormPopover.mm:
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
* UIProcess/ios/forms/WKFormSelectPicker.mm:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
* UIProcess/ios/forms/WKNumberPadViewController.mm:
* UIProcess/ios/forms/WKQuickboardListViewController.h:
* UIProcess/ios/forms/WKSelectMenuListViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-05-04 Alex Christensen <achristensen@webkit.org>
Merge the three UIKitSPI.h files into a single one in PAL
https://bugs.webkit.org/show_bug.cgi?id=197534
Reviewed by Darin Adler.
* Platform/spi/ios/PDFKitSPI.h:
* Platform/spi/ios/UIKitSPI.h: Removed.
* Shared/DocumentEditingContext.mm:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
* Shared/ios/NativeWebTouchEventIOS.mm:
* Shared/ios/WebIconUtilities.mm:
* UIProcess/API/Cocoa/NSAttributedString.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ApplicationStateTracker.mm:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
* UIProcess/Cocoa/WKShareSheet.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* UIProcess/WKImagePreviewViewController.mm:
* UIProcess/_WKTouchEventGenerator.mm:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/InputViewUpdateDeferrer.mm:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/ios/SmartMagnificationController.mm:
* UIProcess/ios/TextCheckerIOS.mm:
* UIProcess/ios/ViewGestureControllerIOS.mm:
* UIProcess/ios/WKActionSheet.mm:
* UIProcess/ios/WKActionSheetAssistant.mm:
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
* UIProcess/ios/WKPDFView.mm:
* UIProcess/ios/WKPasswordView.mm:
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKWebEvent.mm:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
* UIProcess/ios/forms/WKFocusedFormControlView.h:
* UIProcess/ios/forms/WKFormColorControl.mm:
* UIProcess/ios/forms/WKFormColorPicker.mm:
* UIProcess/ios/forms/WKFormInputControl.mm:
* UIProcess/ios/forms/WKFormPopover.mm:
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
* UIProcess/ios/forms/WKFormSelectPicker.mm:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
* UIProcess/ios/forms/WKNumberPadViewController.mm:
* UIProcess/ios/forms/WKQuickboardListViewController.h:
* UIProcess/ios/forms/WKSelectMenuListViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-05-03 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r244897): Caret may appear wider than normal after zooming to focus an editable element
https://bugs.webkit.org/show_bug.cgi?id=197579
Reviewed by Tim Horton.
Fixes a couple of flaky tests (CaretSelectionRectAfterRestoringFirstResponderWithRetainActiveFocusedState and
CaretSelectionRectAfterRestoringFirstResponder) that began failing after r244897. These tests both begin by
focusing an editable element, which causes the web view to zoom in. The tests subsequently check that the caret
rect is {{ 16, 13 }, { 2, 15 }}. While the specified caret rect (coming from EditorState) is {{ 16, 13 }, { 3,
15 }}, the narrower caret rect is used because we take measures to preserve the width of the caret relative to
the view (see the inverse scaling logic in -[WKContentView selectedTextRange] for more details).
See below for more details.
* UIProcess/ios/WKContentViewInteraction.h:
Remove _isZoomingToRevealFocusedElement, now that we don't need it anymore (see -observeValueForKeyPath:).
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
Stop bailing from a selection update when changing scale, while zooming to reveal the focused element. This
check was added in r239441 to prevent UIWKTextInteractionAssistant's selection scrolling logic from interfering
with WKContentView-driven logic for zooming to the focused element. However, since r244141, this is no longer
necessary since selection scrolling is only driven by code in the web process.
This new update while zooming to reveal the focused element ensures that the WKTextRange returned by
-selectedTextRange after zooming will have a width that is inversely scaled using the content view's current
scale, such that it has a consistent width (relative to the web view) across different scales.
(-[WKContentView _zoomToRevealFocusedElement]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::layerTreeCommitComplete):
Remove any attempt here to notify PageClient about editor states after focus. This logic was actually incorrect,
since it didn't ensure that the layer tree commit that is being completed actually contained an editor state; as
such, the "editor state" received here could be stale.
2019-05-03 Zalan Bujtas <zalan@apple.com>
[iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
https://bugs.webkit.org/show_bug.cgi?id=197573
<rdar://problem/48008441>
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::adjustLayoutSizeIfNeeded):
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::immediatelyShrinkToFitContent):
2019-05-03 Dean Jackson <dino@apple.com>
Make imageForElementActionType a class method on _WKElementAction
https://bugs.webkit.org/show_bug.cgi?id=197588
<rdar://problem/50463157>
Reviewed by Wenson Hsieh.
Make this helper function a class method, so that it can
be more easily detected.
* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction imageForElementActionType:]):
(_WKUIImageForElementActionType): Deleted.
2019-05-03 Chris Dumez <cdumez@apple.com>
Unresponsive Service Worker processes should get killed
https://bugs.webkit.org/show_bug.cgi?id=197580
<rdar://problem/50458239>
Reviewed by Geoffrey Garen.
Enable the background responsiveness logic for service worker processes so that they get
killed if they becomes unresponsive. The logic was previously not enabling the timer for
service worker processes because it required having a page.
* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didBecomeUnresponsive):
(WebKit::WebProcessProxy::didFinishLaunching):
2019-05-03 Youenn Fablet <youenn@apple.com>
[iOS] set the default maximum camera count to 1 for enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=197566
Reviewed by Eric Carlson.
The previous number for iOS was 2 as there is a front and a back camera.
Since we are by default setting deviceIds to "", it is better to just have one,
as it might confuse applications to have two devices with the same ID.
Covered by updated test.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
2019-05-03 Daniel Bates <dabates@apple.com>
Pass KeyboardEvent by reference in more places
https://bugs.webkit.org/show_bug.cgi?id=197480
Reviewed by Wenson Hsieh.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleEditingKeyboardEvent):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleEditingKeyboardEvent):
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::handleEditingKeyboardEvent):
2019-05-03 Youenn Fablet <youenn@apple.com>
Enable Fetch Keep Alive by default
https://bugs.webkit.org/show_bug.cgi?id=197331
Reviewed by Geoffrey Garen.
* Shared/WebPreferences.yaml:
2019-05-03 Devin Rousso <drousso@apple.com>
REGRESSION(r230367): a "." is prepended before cookies set without an explicit domain
https://bugs.webkit.org/show_bug.cgi?id=197268
<rdar://problem/49767847>
Reviewed by Alex Christensen.
RFC 2965 states "If an explicitly specified value does not start with a dot, the user agent
supplies a leading dot.", so we should only be adding a leading "." if a `domain` is provided.
In order to not regress r230367, also delete all cookies for the non-"."-prefixed domain.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::deleteCookiesForHostnames): Added.
(WebKit::WebCookieManagerProxy::deleteCookiesForHostname): Deleted.
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerDeleteCookiesForHostname):
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::deleteCookiesForHostnames): Added.
(WebKit::WebCookieManager::deleteCookiesForHostname): Deleted.
Since the underlying `NetworkStorageSession` accepts a list of domains, extend that support
to allow the IPC to send a list of domains as well, but still keep the C API the same.
2019-05-03 Sihui Liu <sihui_liu@apple.com>
Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
https://bugs.webkit.org/show_bug.cgi?id=197390
<rdar://problem/42685773>
Reviewed by Geoffrey Garen.
Move data protection check to WebCore so it can be applied to database files.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::makeSafeToUseMemoryMapForPath): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm: Removed.
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleListStore.cpp:
(API::openAndMapOrCopyContentRuleList):
(API::compiledToFile):
2019-05-03 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: [weakThis->m_view window] == weakThis->m_targetWindowForMovePreparation
https://bugs.webkit.org/show_bug.cgi?id=197574
<rdar://problem/50453181>
Reviewed by Tim Horton.
Tweak the assertion so that it holds even if the WebView gets closed because the completion
handler has been called.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::prepareForMoveToWindow):
2019-05-03 Brent Fulgham <bfulgham@apple.com>
Use more efficient path resolution logic
https://bugs.webkit.org/show_bug.cgi?id=197389
<rdar://problem/50268491>
Reviewed by Maciej Stachowiak.
The code in SandboxExtensionsCocoa.mm 'resolveSymlinksInPath' is pretty inefficient, and tries to reproduce (badly)
logic that is already provided by the operating system.
To make matters worse, 'resolvePathForSandboxExtension' was effectively performing the work of fully resolving
symlinks twice, since NSString's 'stringByStandardizingPath' method does some of this already.
Instead, we should just use NSString's 'stringByResolvingSymlinksInPath', which does the symlink resolution
using more efficient logic than our 'resolveSymlinksInPath' code.
* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::resolveSymlinksInPath): Removed.
(WebKit::resolvePathForSandboxExtension): Remove redundant call to 'resolveSymlinksInPath', and switches from
'stringByStandardizingPath' to 'stringByResolvingSymlinksInPath', which can take the place of both calls.
(WebKit::stringByResolvingSymlinksInPath): Switch to call 'stringByResolvingSymlinksInPath'.
2019-05-02 Dean Jackson <dino@apple.com>
Need additional UIPreviewAction information in WKImagePreviewViewController
https://bugs.webkit.org/show_bug.cgi?id=197540
<rdar://problem/50430510>
Reviewed by Wenson Hsieh.
Include a WebKitAdditions file to provide a macro for
additional UIPreviewAction information.
While here, take the opportunity to move from the deprecated
UIViewControllerPreviewAction to the newer UIPreviewAction.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController previewActionItems]):
2019-05-02 Dean Jackson <dino@apple.com>
Provide UIImages for element actions
https://bugs.webkit.org/show_bug.cgi?id=197539
<rdar://problem/50430363>
Reviewed by Wenson Hsieh.
Use an additions include to export a function that
relates a UIImage to a _WKElementAction.
* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(_WKUIImageForElementActionType):
2019-05-03 Jay Mulani <jmulani@apple.com>
Expose full screen controller SPI to check if full screen is open and close full screen
https://bugs.webkit.org/show_bug.cgi?id=197263
Reviewed by Jer Noble.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView closeFullScreenWindowController]):
(-[WKWebView fullScreenWindowController]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2019-05-03 Youenn Fablet <youenn@apple.com>
LayoutTest imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=182849
<rdar://problem/50353372>
Reviewed by Alex Christensen.
In case of restarting the load after a redirection, which now happens in case
of following cross origin redirections with same-origin credentials, make sure to
update the request as would do NetworkLoad.
This is in particular important to preserve the request body.
Covered by WPT updated test.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::updateRequest):
(WebKit::NetworkLoad::updateRequestAfterRedirection const):
(WebKit::NetworkLoad::continueWillSendRequest):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
2019-05-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244881.
https://bugs.webkit.org/show_bug.cgi?id=197559
Breaks compilation of jsconly on linux, breaking compilation
for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
guijemont on #webkit).
Reverted changeset:
"[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
WEBKIT_COPY_FILES"
https://bugs.webkit.org/show_bug.cgi?id=197174
https://trac.webkit.org/changeset/244881
2019-05-02 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION: Layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html is failing
https://bugs.webkit.org/show_bug.cgi?id=197532
<rdar://problem/50177144>
Reviewed by Ryosuke Niwa.
Fixes layout tests that began failing after r244546. See below for details.
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
Partially reverts a change in r244546, after which we commit the layer tree and scroll before updating the
page's editor state. The purpose of this change was to ensure that UI process-side element focus scrolling logic
would not conflict with web-process-driven scrolling logic.
Instead, we split the existing logic in WebPageProxy::editorStateChanged into two pieces: one that updates the
editor state (by setting m_editorState), and a second that dispatches updates to PageClient when the first
editor state is received after focusing an element. During a layer tree commit in the UI process, we first
update the editor state, then commit the layer tree and apply scroll position changes, and finally scroll to
reveal the focused element if necessary.
When an editor state is delivered to the UI process in an out-of-band update (i.e. not in a layer tree commit),
simply dispatch the initial editor state for a focused element immediately.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
Add an IPC message to schedule an editor state update in the next remote layer tree commit. See below for more
details.
(WebKit::WebPageProxy::editorStateChanged):
(WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus):
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::updateEditorState):
(WebKit::WebPageProxy::editorStateChanged): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
Additionally ensure that an editor state update is scheduled. This addresses a potential source of flakiness in
the layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html, where an editor
state update may only be scheduled after the next layout timer fires (this is the case in custom callout menu
actions that change the DOM but do not otherwise trigger any editing commands).
In the problematic scenario, the client could make a change that triggers layout soon; but before the layout
timer fires, the timer for the next remote layer tree commit could fire, such that the next layer tree commit
would not contain the relevant editor state.
This extra step ensures that we always *schedule* an editor state update when performing a callout menu action
that does not automatically dismiss, so that we can prevent the callout bar from dismissing during the correct
scope.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::layerTreeCommitComplete):
(WebKit::WebPageProxy::updateEditorState):
Rename editorStateChanged to updateEditorState, and make the editorStateChanged codepath only executed when an
out-of-band editor state update is delivered to the UI process.
(WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus):
Notify the UI process that the initial editor state has been received; this prompts us to scroll to reveal the
focused element, if needed.
(WebKit::WebPageProxy::editorStateChanged): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::updateEditorState):
(WebKit::WebPageProxy::editorStateChanged): Deleted.
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::updateEditorState):
(WebKit::WebPageProxy::editorStateChanged): Deleted.
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::updateEditorState):
(WebKit::WebPageProxy::editorStateChanged): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-05-02 Timothy Hatcher <timothy@apple.com>
NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
https://bugs.webkit.org/show_bug.cgi?id=197523
Reviewed by Darin Adler.
Caching the WKWebView was loading about:blank to unload the previous content.
This was causing subsequent rapid conversions to fail since the blank load
would be confused with the real content loading. Loading a blank page wasn't
really needed, it just helped keep the cached view in a cleaner state. Instead
of adding complexity to track the extra navigation, we can eliminate the blank load.
Ultimately a process swap will likely happen on the next navigation, and unused
cached views are closed quickly -- so stale content isn't held around too long.
This also avoids extra work and speeds up conversions a bit.
* UIProcess/API/Cocoa/NSAttributedString.mm:
(+[_WKAttributedStringWebViewCache cacheWebView:]): Don't load about:blank when caching.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getContentsAsAttributedString): Use rangeOfContents() for a fail
safe way to get the range needed.
2019-05-02 John Wilander <wilander@apple.com>
Make both filterForRegistrableDomains() in WebKit::NetworkProcess use WebCore::RegistrableDomain::uncheckedCreateFromHost()
https://bugs.webkit.org/show_bug.cgi?id=197521
<rdar://problem/49651503>
Reviewed by Brent Fulgham.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::filterForRegistrableDomains):
2019-05-02 Per Arne Vollan <pvollan@apple.com>
-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=197510
<rdar://problem/50372338>
Reviewed by Alex Christensen.
When asked to delete persistent credentials for a set of origins, send a message to the network process with the
list of origins. The network process will then delete all persistent credentials from these origins from
NSURLCredentialStorage.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeCredentialsWithOrigins):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::removeCredentialsWithOrigins):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
2019-05-02 Don Olmstead <don.olmstead@sony.com>
[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
https://bugs.webkit.org/show_bug.cgi?id=197174
Reviewed by Alex Christensen.
Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
for framework headers explicit.
* CMakeLists.txt:
* PlatformWin.cmake:
2019-05-02 Per Arne Vollan <pvollan@apple.com>
[macOS] Fix syscall sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=197517
<rdar://problem/49945031>
Reviewed by Brent Fulgham.
A syscall needs to be added to the sandbox on macOS.
* WebProcess/com.apple.WebProcess.sb.in:
2019-05-02 Alex Christensen <achristensen@webkit.org>
Safe browsing warning should update colors when a user switches between light and dark appearance
https://bugs.webkit.org/show_bug.cgi?id=197443
<rdar://problem/49883917>
Reviewed by Tim Horton.
We draw the WKSafeBrowsingExclamationPoint ourselves, so we need to call setNeedsDisplay when viewDidChangeEffectiveAppearance is called.
Instead of setting NSView.layer.backgroundColor we need to make an NSView subclass I call WKSafeBrowsingBox and we need to set its layer's
backgroundColor in updateLayer, otherwise the CGColor isn't updated from the NSColor.
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(colorForItem):
(-[WKSafeBrowsingExclamationPoint viewDidChangeEffectiveAppearance]):
(-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
(-[WKSafeBrowsingBox updateLayer]):
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(setBackground): Deleted.
2019-05-02 Frederic Wang <fwang@igalia.com>
[GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
https://bugs.webkit.org/show_bug.cgi?id=196142
This patch introduces some experimental runtime flag to let users
disable MathML features that are removed from MathML Core [1]. For now,
these features are only disabled on GTK and WPE ports.
[1] https://mathml-refresh.github.io/mathml-core/
Reviewed by Rob Buis.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
Add the ability to import WebKitAdditions snippets in WebKit.apinotes
https://bugs.webkit.org/show_bug.cgi?id=197487
<rdar://problem/50389085>
Reviewed by Tim Horton.
* Shared/API/Cocoa/WebKit.apinotes: Import a new WebKitAdditions file.
* WebKit.xcodeproj/project.pbxproj: Check all files in Headers/ and PrivateHeaders/ that need replacement, not
simply anything ending with ".h".
* mac/replace-webkit-additions-includes.py:
(main): Teach the replacement script to handle files in Headers/ or PrivateHeaders/ that don't end in ".h".
2019-05-01 Alex Christensen <achristensen@webkit.org>
Protect against null crash in fetchDiskCacheEntries
https://bugs.webkit.org/show_bug.cgi?id=197399
<rdar://problem/47759337>
Reviewed by Antti Koivisto.
If the call to Entry::decodeStorageRecord returns nullptr in Storage::traverse, do not call the traverseHandler, which expects
that when it is called with nullptr that is the end of the traversal.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::traverse):
2019-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
https://bugs.webkit.org/show_bug.cgi?id=197342
<rdar://problem/50063091>
Reviewed by Tim Horton.
This patch introduces a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a
larger width in order to shrink content to fit the viewport. This is similar to existing shrink-to-fit behaviors
used for viewport sizing in multitasking mode, except that it not only scales the view, but additionally expands
the layout size, such that the overall layout of the page is preserved. In fact, the reason we ended up
reverting the existing flavor of shrink-to-fit in all cases except for multitasking was that page layout was not
preserved, which caused elements that poke out of the viewport to make the rest of the page look out of
proportion — see <rdar://problem/23818102> and related radars.
Covered by 5 new layout tests, and by adjusting a couple of existing layout tests. See comments below for more
details.
* Platform/Logging.h:
Add a new ViewportSizing logging channel. This will only log on pages that overflow the viewport and shrink to
fit as a result.
* Shared/WebPreferences.yaml:
Turn IgnoreViewportScalingConstraints off by default. This preference currently controls whether we allow
shrink-to-fit behaviors, and is only used by Safari when it is in multitasking mode. The value of this
preference is currenly *on* by default, and is turned off almost immediately during every page load after the
first visible content rect update, wherein visibleContentRectUpdateInfo.allowShrinkToFit() is false.
However, this sometimes causes a brief jitter during page load; to fix this, make the default value for
IgnoreViewportScalingConstraints false, and change the logic in WebPage::updateVisibleContentRects to
setCanIgnoreScalingConstraints to true if either the IgnoreViewportScalingConstraints preference (not only
affected by an internal debug switch) is true, or WKWebView SPI is used to enable the behavior.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
Add a new hook for WebFrameLoaderClient to call into WebPage when document load finishes. Also, tweak
dispatchDidFinishLoad to take a WebFrame& instead of a WebFrame* in a drive-by fix (the frame is assumed to be
non-null anyways).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::didFinishDocumentLoad):
(WebKit::WebPage::didFinishLoad):
When finishing document load or finishing the overall load, kick off the shrink-to-fit timer; when committing a
load, cancel the timer.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
Don't allow the minimum effective device width from the client to stomp over any minimum effective device width
set as a result of the new shrink-to-fit heuristic; on some pages that load quickly, this can result in a race
where the minimum effective device width (i.e. a value that lower-bounds the minimum layout width) is first set
by the shrink-to-fit heuristic, and then set to an incorrect value by the client.
In the near future, web view SPI used to set the minimum effective device width should actually be removed
altogether, since the new shrink-to-fit heuristic supersedes any need for the client to fiddle with the minimum
effective device width.
(WebKit::WebPage::dynamicViewportSizeUpdate):
When performing a dynamic viewport size update, additionally re-run the shrink-to-fit heuristic. This allows
the minimum layout size of the viewport to be updated, if necessary. An example of where this matters is when a
web page is *below* a tablet/desktop layout breakpoint in portrait device orientation, but then exceeds this
layout breakpoint in landscape orientation. In this scenario, rotating the device should swap between these two
page layouts.
(WebKit::WebPage::resetViewportDefaultConfiguration):
(WebKit::WebPage::scheduleShrinkToFitContent):
(WebKit::WebPage::shrinkToFitContentTimerFired):
(WebKit::WebPage::immediatelyShrinkToFitContent):
Leverage the existing capability for a viewport to have a "minimum effective device width" to grant the viewport
a larger layout size than it would normally have, and then scale down to fit within the bounds of the view. One
challenge with this overall approach is that laying out at a larger width may cause the page to lay out even
wider in response, which may actually worsen horizontal scrolling. To mitigate this, we only attempt to lay out
at the current content width once; if laying out at this width reduced the amount of horizontal scrolling by any
amount, then proceed with this layout width; otherwise, revert to the previous layout width.
(WebKit::WebPage::shouldIgnoreMetaViewport const):
Pull some common logic out into a readonly getter.
(WebKit::WebPage::updateVisibleContentRects):
See the comment below WebPreferences.yaml, above.
2019-05-01 Dean Jackson <dino@apple.com>
Link Previews that use WKImagePreviewViewController are not always scaled correctly
https://bugs.webkit.org/show_bug.cgi?id=197450
<rdar://problem/50357695>
Reviewed by Wenson Hsieh.
Tell the UIImageView that we create in WKImagePreviewViewController to use
a filling scaling method.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):
2019-05-01 Darin Adler <darin@apple.com>
WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
https://bugs.webkit.org/show_bug.cgi?id=195535
Reviewed by Alexey Proskuryakov.
* Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.
* Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
(WKStringGetUTF8CStringImpl): Updated for changes to return values.
2019-05-01 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r244821.
Causing
Reverted changeset:
"WebKit has too much of its own UTF-8 code and should rely
more on ICU's UTF-8 support"
https://bugs.webkit.org/show_bug.cgi?id=195535
https://trac.webkit.org/changeset/244821
2019-05-01 Youenn Fablet <youenn@apple.com>
Kept alive loaders should use the redirected request in case of redirections
https://bugs.webkit.org/show_bug.cgi?id=197337
Reviewed by Alex Christensen.
Instead of using the request, the redirected request should be used in case of redirection.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
2019-04-29 Darin Adler <darin@apple.com>
WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
https://bugs.webkit.org/show_bug.cgi?id=195535
Reviewed by Alexey Proskuryakov.
* Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.
* Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
(WKStringGetUTF8CStringImpl): Updated for changes to return values.
2019-04-30 Chris Dumez <cdumez@apple.com>
Regression(PSON) URL scheme handlers can no longer respond asynchronously
https://bugs.webkit.org/show_bug.cgi?id=197426
<rdar://problem/50256169>
Reviewed by Brady Eidson.
The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
with the page, including the one associated with the provisisional page / process.
To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
tasks associated with the m_process (which is the process we're about to swap away from).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::stopAllURLSchemeTasks):
* UIProcess/WebPageProxy.h:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::processForTaskIdentifier):
(WebKit::WebURLSchemeHandler::stopAllTasksForPage):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::process const):
2019-04-30 John Wilander <wilander@apple.com>
Add logging of Ad Click Attribution errors and events to a dedicated channel
https://bugs.webkit.org/show_bug.cgi?id=197332
<rdar://problem/49918800>
Reviewed by Youenn Fablet.
This patch adds an experimental Ad Click Attribution debug mode which
logs information. Most changes are just log output in the various
functions in WebKit::AdClickAttributionManager.
The constructor to WebKit::AdClickAttributionManager now takes a
PAL::SessionID so that the log functions can make sure they don't
output anything in ephemeral sessions.
WebProcessPool::platformInitializeNetworkProcess() now picks up the
debug mode setting from the incoming
WebKit::NetworkProcessCreationParameters object.
NetworkResourceLoader::handleAdClickAttributionConversion() was
moved to AdClickAttributionManager::handleConversion() to keep all
the logging in one file.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::storeUnconverted):
(WebKit::AdClickAttributionManager::handleConversion):
(WebKit::AdClickAttributionManager::convert):
(WebKit::AdClickAttributionManager::fireConversionRequest):
(WebKit::AdClickAttributionManager::firePendingConversionRequests):
(WebKit::AdClickAttributionManager::clearExpired):
(WebKit::AdClickAttributionManager::debugModeEnabled const):
* NetworkProcess/AdClickAttributionManager.h:
(WebKit::AdClickAttributionManager::AdClickAttributionManager):
(WebKit::AdClickAttributionManager::m_sessionID):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
(WebKit::NetworkResourceLoader::handleAdClickAttributionConversion): Deleted.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::handleAdClickAttributionConversion):
(WebKit::NetworkSession::convertAdClickAttribution): Deleted.
* NetworkProcess/NetworkSession.h:
* Platform/Logging.h:
* Shared/WebPreferences.yaml:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2019-04-30 Devin Rousso <drousso@apple.com>
Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
https://bugs.webkit.org/show_bug.cgi?id=197361
<rdar://problem/49861407>
Reviewed by Brian Burg.
Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
element isn't visible, then the child won't be either.
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::resolveLocation):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
2019-04-30 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r244802.
Caused an API test failure
Reverted changeset:
"Regression(PSON) URL scheme handlers can no longer respond
asynchronously"
https://bugs.webkit.org/show_bug.cgi?id=197426
https://trac.webkit.org/changeset/244802
2019-04-30 Chris Dumez <cdumez@apple.com>
Regression(PSON) URL scheme handlers can no longer respond asynchronously
https://bugs.webkit.org/show_bug.cgi?id=197426
<rdar://problem/50256169>
Reviewed by Brady Eidson.
The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
with the page, including the one associated with the provisisional page / process.
To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
tasks associated with the m_process (which is the process we're about to swap away from).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::stopAllURLSchemeTasks):
* UIProcess/WebPageProxy.h:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::processForTaskIdentifier):
(WebKit::WebURLSchemeHandler::stopAllTasksForPage):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::process const):
2019-04-30 Chris Dumez <cdumez@apple.com>
Only use a related page's process if that page has not been closed yet
https://bugs.webkit.org/show_bug.cgi?id=197393
<rdar://problem/50302423>
Reviewed by Tim Horton.
We should not attempt to use a related page's process if that related page has already been closed.
Once closed, a page's process is invalid and trying to launch a new process for the closed page
leads to crashes such as the one in the radar.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
2019-04-30 Tim Horton <timothy_horton@apple.com>
Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
https://bugs.webkit.org/show_bug.cgi?id=197404
<rdar://problem/24589331>
Reviewed by Wenson Hsieh.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _updateImmediateActionItem]):
(-[WKImmediateActionController menuItem:previewItemAtPoint:]):
(-[WKImmediateActionController menuItem:itemFrameForPoint:]):
(-[WKImmediateActionController _animationControllerForDataDetectedLink]):
Add some null checks; _webHitTestResult can be null if we (somehow) get
an immediate action gesture without having previously gotten a
mouseDidMoveOverElement from the Web Content process. Cover all our bases.
2019-04-30 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix crash caused by sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=197416
<rdar://problem/50266257>
Reviewed by Brent Fulgham.
Add syscall to the iOS sandbox.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-04-30 Zalan Bujtas <zalan@apple.com>
[iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
https://bugs.webkit.org/show_bug.cgi?id=197347
<rdar://problem/49393423>
Reviewed by Wenson Hsieh.
This patch adds support for dispatching dblclick event as the result of the double tap gesture.
1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _doubleTapRecognizedForDoubleClick:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
2019-04-30 Antti Koivisto <antti@apple.com>
Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
https://bugs.webkit.org/show_bug.cgi?id=197414
Reviewed by Frédéric Wang.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2019-04-30 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r244750): [GTK][WPE] Network process is crashing in all layout tests
https://bugs.webkit.org/show_bug.cgi?id=197406
Reviewed by Žan Doberšek.
Do not trasnfer ownership of cachePath to traverseDirectory() lambda, since it's passed also as first argument
and it can be passed as a reference.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
2019-04-29 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r244755.
Casued several test failures on iOS
Reverted changeset:
"Double-tapping a post to like doesn't work on Instagram.com
(needs 'dblclick' event)"
https://bugs.webkit.org/show_bug.cgi?id=197347
https://trac.webkit.org/changeset/244755
2019-04-29 Chris Dumez <cdumez@apple.com>
[iOS] The UIProcess may get killed for trying to stay runnable in the background for more than 30 seconds
https://bugs.webkit.org/show_bug.cgi?id=197385
<rdar://problem/50001505>
Reviewed by Geoffrey Garen.
If the UIProcess holds a background assertion for itself for 30 seconds, the assertion's invalidation handler
will get called and it is our responsibility to release this assertion or the UIProcess will get killed by the
system. The logic in ProcessAssertion would normally do that but it would also happily try and re-take another
background process assertion shortly after the previous one expired (and before the UIProcess got suspended).
When doing so, the new background assertion would expire right away and we would get killed without its
invalidation handler getting called.
To address the issue, the logic in ProcessAssertion will now prevent taking a new background assertion after
one expires and until the application becomes foreground again.
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2019-04-29 Alex Christensen <achristensen@webkit.org>
<rdar://problem/50299396> Fix internal High Sierra build
https://bugs.webkit.org/show_bug.cgi?id=197388
* Configurations/Base.xcconfig:
2019-04-29 Zalan Bujtas <zalan@apple.com>
[iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
https://bugs.webkit.org/show_bug.cgi?id=197347
<rdar://problem/49393423>
Reviewed by Wenson Hsieh.
This patch adds support for dispatching dblclick event as the result of the double tap gesture.
1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _doubleTapRecognizedForDoubleClick:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
2019-04-29 Tim Horton <timothy_horton@apple.com>
REGRESSION (r244142): Fandango accounts tab crashes under Color()
https://bugs.webkit.org/show_bug.cgi?id=197380
<rdar://problem/50186175>
Reviewed by Megan Gardner.
* UIProcess/API/Cocoa/WKWebView.mm:
(baseScrollViewBackgroundColor):
We now call -_updateScrollViewBackground from -setBackgroundColor:.
-setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
isn't initialized yet either. So add a further fallback.
2019-04-29 Dean Jackson <dino@apple.com>
Add InteractionIsHappening to SuppressSelectionAssistantReason
https://bugs.webkit.org/show_bug.cgi?id=197375
<rdar://problem/50304986>
Reviewed by Megan Gardner.
Add a new reason for suppressing the selection assistant, to
be used in a follow-up patch.
* UIProcess/ios/WKContentViewInteraction.h: Add InteractionIsHappening.
2019-04-29 Alex Christensen <achristensen@webkit.org>
Storage::deleteOldVersions does not need to retain Storage
https://bugs.webkit.org/show_bug.cgi?id=197336
<rdar://problem/48679972>
Reviewed by Darin Adler.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
Something is wrong with the lifetime of Storage, but we only need a String, not the whole Storage.
2019-04-29 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Move common sandbox files from Shared/mac to Shared/Cocoa
https://bugs.webkit.org/show_bug.cgi?id=197376
<rdar://problem/50305272>
Reviewed by Dean Jackson.
The Apple sandboxing logic currently lives in the inappropriate 'Shared/mac' directory. This is
confusing because the code is used by all Apple ports, not just macOS.
This patch just moves the relevant files from 'Shared/mac' to 'Shared/Cocoa' to avoid this confusion.
* Shared/Cocoa/SandboxExtensionCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxExtensionMac.mm.
* Shared/Cocoa/SandboxInitialiationParametersCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxInitialiationParametersMac.mm.
* Shared/Cocoa/SandboxUtilities.h: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.h.
* Shared/Cocoa/SandboxUtilities.mm: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.mm.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-04-29 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Back/forward gesture snapshot always times out
https://bugs.webkit.org/show_bug.cgi?id=197233
Reviewed by Michael Catanzaro.
Delaying web process launch caused a regression where we create ViewGestureController when the
web process doesn't yet exist. The controller immediately tries to connect to it and fails,
and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
snapshot always stays until timeout after performing the gesture.
To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
and immediately apply it when creating the controller.
Since there is now a point where controller is null, make webkitWebViewBaseViewGestureController()
return null and add null checks everywhere.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged):
Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Add a null check.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDraw): Ditto.
(webkitWebViewBaseScrollEvent): Ditto.
(webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
for the case ViewGestureController doesn't exist yet.
(webkitWebViewBaseViewGestureController): Return a pointer instead of reference.
(webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
(webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
immediately call setSwipeGestureEnabled() with the stored value.
(webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Add a null check.
(webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame):Ditto.
(webkitWebViewBaseDidFinishLoadForMainFrame): Ditto.
(webkitWebViewBaseDidFailLoadForMainFrame): Ditto.
(webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Ditto.
(webkitWebViewBaseDidRestoreScrollPosition): Ditto.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2019-04-29 Chris Dumez <cdumez@apple.com>
User-facing strings should use curly quotes instead of straight
https://bugs.webkit.org/show_bug.cgi?id=197370
Reviewed by Geoffrey Garen.
Update localizable alert text that was recently added to use curly quotes instead of
straight ones, as per our guidelines.
* UIProcess/Cocoa/WKOrientationAccessAlert.mm:
(WebKit::presentOrientationAccessAlert):
* UIProcess/Cocoa/WKStorageAccessAlert.mm:
(WebKit::presentStorageAccessAlert):
2019-04-29 Alex Christensen <achristensen@webkit.org>
Build fix.
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet updateSheetPosition]):
2019-04-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244648.
https://bugs.webkit.org/show_bug.cgi?id=197363
Lots of tests are crashing (Requested by KaL on #webkit).
Reverted changeset:
"[GTK] Back/forward gesture snapshot always times out"
https://bugs.webkit.org/show_bug.cgi?id=197233
https://trac.webkit.org/changeset/244648
2019-04-29 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] window-object-cleared documentation should reference webkit_frame_get_js_context_for_script_world()
https://bugs.webkit.org/show_bug.cgi?id=197357
Reviewed by Carlos Garcia Campos.
We should recommend using the non-deprecated replacement for
webkit_frame_get_javascript_context_for_script_world().
* WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
2019-04-27 Chris Dumez <cdumez@apple.com>
Improve safety of MachMessage class
https://bugs.webkit.org/show_bug.cgi?id=197323
<rdar://problem/44291920>
Reviewed by Darin Adler.
Improve safety of MachMessage class and clean things up a bit.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage):
- Pass MessageReceiverName / MessageName when constructing the MachMessage rather
than setting them afterwards since they never change for a given MachMessage.
- Set header->msgh_id to the right value right away instead of setting it first
to inlineBodyMessageID and then later fixing it to be outOfLineBodyMessageID
when the body is out of line.
- When messageBodyIsOOL was true, we would call getDescriptorAndSkip() which
would advance the pointer by sizeof(mach_msg_port_descriptor_t), even though
the descriptor type is mach_msg_ool_descriptor_t. This would not matter in
the end because we would not use the messageData pointer after this but
still.
* Platform/IPC/mac/MachMessage.cpp:
(IPC::MachMessage::create):
Use fastZeroedMalloc() instead of fastMalloc() for safety, given that this class
has a mach_msg_header_t flexible array member. This is what is recommended by the
mach documentation. It is much safer because it otherwize relies on the user
(Connection::sendOutgoingMessage()) to initialize ALL the message members
correctly. I suspect this was the cause of <rdar://problem/44291920> because
Connection::sendOutgoingMessage() would fail to initialize header->msgh_voucher_port
and the MachMessage destructor would then call mach_msg_destroy(header()), which
would mach_msg_destroy_port(header->msgh_voucher_port).
(IPC::MachMessage::MachMessage):
Pass MessageReceiverName / MessageName when constructing the MachMessage rather
than setting them afterwards since they never change for a given MachMessage.
(IPC::MachMessage::messageSize):
Drop if checks for portDescriptorCount and memoryDescriptorCount since the logic
will do the right thing even if they are 0.
* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::header):
(IPC::MachMessage::messageReceiverName const):
(IPC::MachMessage::messageName const):
2019-04-26 Wenson Hsieh <wenson_hsieh@apple.com>
Rename m_LayerTreeFreezeReasons to m_layerTreeFreezeReasons
https://bugs.webkit.org/show_bug.cgi?id=197343
Reviewed by Antti Koivisto.
No change in behavior.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
* WebProcess/WebPage/WebPage.h:
2019-04-26 Keith Rollin <krollin@apple.com>
Enable new build rule for post-processing headers when using XCBuild
https://bugs.webkit.org/show_bug.cgi?id=197340
<rdar://problem/50226685>
Reviewed by Brent Fulgham.
In Bug 197116, we conditionally disabled the old method for
post-processing header files when we are using the new XCBuild build
system. This check-in conditionally enables the new post-processing
facility. Note that the old system is disabled and the new system
enabled only when the USE_NEW_BUILD_SYSTEM environment variable is set
to YES.
* Configurations/WebKit.xcconfig:
2019-04-26 Jessie Berlin <jberlin@webkit.org>
Add new mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=197313
Reviewed by Alex Christensen.
* Configurations/Version.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig:
2019-04-26 Youenn Fablet <youenn@apple.com>
Use kDNSServiceFlagsKnownUnique to speed up mdns name registration for ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=197328
Reviewed by Eric Carlson.
This allows skipping the probing step of MDNS name registration.
We can do that as registered names are random UUIDs.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
2019-04-26 Chris Dumez <cdumez@apple.com>
[iOS] Our process assertion should not allow idle sleep
https://bugs.webkit.org/show_bug.cgi?id=197317
<rdar://problem/50137740>
Reviewed by Geoffrey Garen.
Our process assertion should not allow idle sleep. This is bad for power because the device
may switch between sleep and awake state frequently, as it get woken up by network packages.
* UIProcess/ios/ProcessAssertionIOS.mm:
2019-04-26 Eric Carlson <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
Reviewed by Youenn Fablet.
* Shared/ios/WebIconUtilities.mm:
(WebKit::iconForVideoFile):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::clone const):
2019-04-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244683.
https://bugs.webkit.org/show_bug.cgi?id=197320
Causing crash on iOS Simulator and EWS failures (Requested by
sroberts on #webkit).
Reverted changeset:
"[iOS] Add internal setting to force -webkit-text-size-adjust
to "auto""
https://bugs.webkit.org/show_bug.cgi?id=197275
https://trac.webkit.org/changeset/244683
2019-04-26 Youenn Fablet <youenn@apple.com>
Use normal loading path for ping loads
https://bugs.webkit.org/show_bug.cgi?id=196807
Reviewed by Alex Christensen.
In case a NetworkResourceLoader has the keepAlive option we do the following:
- Always use NetworkLoadChecker as we might need it to do checks after the Web context is gone.
- In case of aborting a KeepAlive loader, remove it from NetworkConnectionToWebProcess map
and add it to a kept-alive NetworkSession load set. The loader is only kept alive if it
has not yet received a response. Mark the loader as kept-alive.
- In case loader is kept-alive, cancel the load as soon as a response is gathered.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::transferKeptAliveLoad):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::addKeptAliveLoad):
(WebKit::NetworkProcess::removeKeptAliveLoad):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoadMap.cpp:
(WebKit::NetworkResourceLoadMap::remove):
(WebKit::NetworkResourceLoadMap::take):
* NetworkProcess/NetworkResourceLoadMap.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::cleanup):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):
(WebKit::WebLoaderStrategy::usePingLoad const):
* WebProcess/Network/WebLoaderStrategy.h:
2019-04-26 Alex Christensen <achristensen@webkit.org>
Fix internal High Sierra build after r244653
https://bugs.webkit.org/show_bug.cgi?id=197131
* DerivedSources.make:
-std=gnu++17 didn't exist yet. -std=gnu++1z did.
2019-04-26 Alex Christensen <achristensen@webkit.org>
Fix an internal High Sierra build after r244653
https://bugs.webkit.org/show_bug.cgi?id=197131
* DerivedSources.make:
Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
2019-04-26 Sihui Liu <sihui_liu@apple.com>
Stop IDB transactions to release locked database files when network process is ready to suspend
https://bugs.webkit.org/show_bug.cgi?id=196372
<rdar://problem/48930116>
Reviewed by Brady Eidson.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processWillSuspendImminently):
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::resume):
2019-04-25 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
https://bugs.webkit.org/show_bug.cgi?id=197275
<rdar://problem/50211019>
Reviewed by Simon Fraser.
* Shared/WebPreferences.yaml:
* UIProcess/WebPreferences.h:
2019-04-25 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Implement idempotent mode for text autosizing
https://bugs.webkit.org/show_bug.cgi?id=197250
<rdar://problem/50211034>
Reviewed by Jon Lee.
Push the initial scale down into the page.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
2019-04-25 Alex Christensen <achristensen@webkit.org>
Make NetworkCache blobs safe for mmap instead of not using blobs
https://bugs.webkit.org/show_bug.cgi?id=197264
<rdar://problem/49564348>
Reviewed by Antti Koivisto.
This does what r244597 did for WKContentRuleLists but for the NetworkCache's blobs.
Those are the two cases where we were calling mmap and seeing crashes in apps with
default file protection of NSFileProtectionComplete.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm:
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::mayContainBlob const):
(WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
(WebKit::NetworkCache::estimateRecordsSize): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
2019-04-25 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=188357
<rdar://problem/42986633>
Reviewed by Dean Jackson.
DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
tests would fall into low memory mode and have different behavior.
Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
to Internals, so it's shared by DRT and WTR.
We no longer need the WK2 C SPI glue.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
(WKBundlePageSetCompositingPolicyOverride): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2019-04-25 Chris Dumez <cdumez@apple.com>
Trying to load a main resource outside the sandbox should not crash the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=197299
<rdar://problem/49808042>
Reviewed by Geoffrey Garen.
Trying to load a main resource outside the sandbox should not crash the WebContent process. We should
simply ignore the load and log an error message.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-04-25 Timothy Hatcher <timothy@apple.com>
Only send a synthetic mouse out event if synthetic mouse move events were sent.
https://bugs.webkit.org/show_bug.cgi?id=197295
rdar://problem/49040233
Reviewed by Zalan Bujtas.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
2019-04-25 Timothy Hatcher <timothy@apple.com>
Disable date and time inputs on iOSMac.
https://bugs.webkit.org/show_bug.cgi?id=197287
rdar://problem/46794376
Reviewed by Wenson Hsieh.
* Configurations/FeatureDefines.xcconfig:
2019-04-25 Brady Eidson <beidson@apple.com>
REGRESSION (243388): WebProcess::shouldFreezeOnSuspension() decision is flipped
<rdar://problem/49755494> and https://bugs.webkit.org/show_bug.cgi?id=197284
Reviewed by Chris Dumez.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::shouldFreezeOnSuspension const): If any non-suspended pages are in the process it should
be eligible. Only if all pages are suspended should it be jetsam-able.
2019-04-25 Alex Christensen <achristensen@webkit.org>
Start using C++17
https://bugs.webkit.org/show_bug.cgi?id=197131
Reviewed by Darin Adler.
* Configurations/Base.xcconfig:
* DerivedSources.make:
2019-04-25 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Back/Forward gesture interferes with scrolling
https://bugs.webkit.org/show_bug.cgi?id=197168
Reviewed by Michael Catanzaro.
When the gesture is released with 0 velocity close to an edge of the webview,
the finishing animation is way too long, and in some cases it can look like the
gesture is already over, when it's still animating. By scrolling vertically while
that happens, it's possible to reset animation over and over again.
To reduce the duration in this case, instead of using maximum possible duration
(400ms), introduce a base velocity and use it for calculating the duration if
the actual velocity, relative to the end point, is equal to or less than 0.
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
2019-04-25 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Back/forward gesture snapshot always times out
https://bugs.webkit.org/show_bug.cgi?id=197233
Reviewed by Michael Catanzaro.
Delaying web process launch caused a regression where we create ViewGestureController when the
web process doesn't yet exist. The controller immediately tries to connect to it and fails,
and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
snapshot always stays until timeout after performing the gesture.
To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
and immediately apply it when creating the controller.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged):
Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
for the case ViewGestureController doesn't exist yet.
(webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
(webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
immediately call setSwipeGestureEnabled() with the stored value.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2019-04-25 Youenn Fablet <youenn@apple.com>
[Mac iOS WK2] Layout Test http/wpt/cache-storage/cache-quota-after-restart.any.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=197040
<rdar://problem/49997641>
Reviewed by Antti Koivisto.
Delay write operations in case synchronize is ongoing.
This is restricted to AvoidRandomness mode which is always used by CacheAPI
and is also used by network cache for layout tests.
Tested by cache-quota-after-restart.any.html no longer exhibiting write disk errors.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::store):
2019-04-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244627.
https://bugs.webkit.org/show_bug.cgi?id=197282
Causing internal build failures (Requested by ShawnRoberts on
#webkit).
Reverted changeset:
"Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
https://bugs.webkit.org/show_bug.cgi?id=197171
https://trac.webkit.org/changeset/244627
2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Hardcoded text color in input fields
https://bugs.webkit.org/show_bug.cgi?id=126907
Reviewed by Michael Catanzaro.
Implement PageClient::effectiveAppearanceIsDark() for GTK port.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::effectiveAppearanceIsDark const): Check if gtk-application-prefer-dark-theme setting is
enabled, or the theme name contains the -dark suffix or the GTK_THEME environment variable contains the :dark suffix.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(themeChanged): Notify the WebPageProxy that the theme has changed.
(webkitWebViewBaseSetToplevelOnScreenWindow): Connect to notify::gtk-application-prefer-dark-theme and notify::gtk-theme-name.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::setUseDarkAppearance): Set gtk-application-prefer-dark-theme setting accordingly.
2019-04-24 Zalan Bujtas <zalan@apple.com>
Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948
<rdar://problem/49927131>
Reviewed by Tim Horton.
Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
after r244291 there's no reason to have it in DrawingArea.
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::didUpdateGeometry):
(WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/DrawingAreaProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeIntrinsicContentSize):
(WebKit::WebPageProxy::setViewLayoutSize):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
2019-04-24 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244228.
https://bugs.webkit.org/show_bug.cgi?id=197262
Causes compat issues (Requested by smfr on #webkit).
Reverted changeset:
"Unreviewed test gardening for Windows."
https://trac.webkit.org/changeset/244228
2019-04-24 Eric Carlson <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
Reviewed by Youenn Fablet.
* Shared/ios/WebIconUtilities.mm:
(WebKit::iconForVideoFile):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::clone const):
2019-04-24 Per Arne Vollan <pvollan@apple.com>
[macOS] Fix syscall sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=197247
<rdar://problem/50026580>
Reviewed by Brent Fulgham.
A missing syscall in the sandbox of the WebContent process is causing a crash.
* WebProcess/com.apple.WebProcess.sb.in:
2019-04-24 John Wilander <wilander@apple.com>
Age out unconverted Ad Click Attributions after one week.
https://bugs.webkit.org/show_bug.cgi?id=197238
<rdar://problem/50177349>
Reviewed by Chris Dumez.
AdClickAttributionManager::storeUnconverted() and
AdClickAttributionManager::convert() now start by calling the new
AdClickAttributionManager::clearExpired() function to remove any
expired, unconverted attributions before continuing.
The rest of the patch is infrastructure to allow tests to expire
all unconverted attributions early.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::storeUnconverted):
(WebKit::AdClickAttributionManager::convert):
(WebKit::AdClickAttributionManager::clearExpired):
(WebKit::AdClickAttributionManager::markAllUnconvertedAsExpiredForTesting):
* NetworkProcess/AdClickAttributionManager.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::markAdClickAttributionsAsExpiredForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::markAdClickAttributionsAsExpiredForTesting):
* NetworkProcess/NetworkSession.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetAdClickAttributionConversionURLForTesting):
(WKPageMarkAdClickAttributionsAsExpiredForTesting):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::markAdClickAttributionsAsExpiredForTesting):
* UIProcess/WebPageProxy.h:
2019-04-24 Wenson Hsieh <wenson_hsieh@apple.com>
Plumb the navigation's request when determining recommended compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=197225
<rdar://problem/48389965>
Reviewed by Alex Christensen.
Adds a new argument to effectiveCompatibilityModeAfterAdjustingPolicies.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
* UIProcess/WebPageProxy.h:
2019-04-24 Tim Horton <timothy_horton@apple.com>
Clean up WKActionSheetAssistant's use of LaunchServices
https://bugs.webkit.org/show_bug.cgi?id=194645
<rdar://problem/47707952>
Reviewed by Andy Estes.
* UIProcess/ios/WKActionSheetAssistant.mm:
(applicationHasAppLinkEntitlements):
(-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]):
(-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
(appLinkForURL): Deleted.
Make this function much more early-returny and flat.
Adopt LS sync SPI instead of using a semaphore ourselves.
Adopt modern open SPI.
2019-04-24 Simon Fraser <simon.fraser@apple.com>
Make it possible to control the renderTreeAsText output by setting options on testRunner
https://bugs.webkit.org/show_bug.cgi?id=197133
Reviewed by Sam Weinig.
Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
that make sense in testing (those that don't dump unstable data like addresses), and plumb
these flags through the various framework layers.
Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
and hand-code DumpRenderTree bindings.
Some cleanup of the TestRunners, using member initializers.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyRenderTreeExternalRepresentation):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::toRenderAsTextFlags):
(WebKit::WebPage::renderTreeExternalRepresentation const):
(WebKit::WebPage::renderTreeExternalRepresentationForPrinting const):
* WebProcess/WebPage/WebPage.h:
2019-04-24 Alex Christensen <achristensen@webkit.org>
WKContentRuleLists should have a maximum FileProtection of CompleteUnlessOpen
https://bugs.webkit.org/show_bug.cgi?id=197078
<rdar://problem/49564348>
Reviewed by Geoff Garen.
r242735 was a fix for crashes when using mmap'd memory in apps with default FileProtection of NSFileProtectionComplete.
It is more memory efficient and just as secure to reduce the FileProtection of these files to NSFileProtectionCompleteUnlessOpen.
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
(WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
(WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting): Deleted.
(WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm: Added.
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
(WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
* Shared/WebCompiledContentRuleList.cpp:
(WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
(WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
(WebKit::WebCompiledContentRuleList::actions const):
(WebKit::WebCompiledContentRuleList::usesCopiedMemory const): Deleted.
* Shared/WebCompiledContentRuleList.h:
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::encode const):
(WebKit::WebCompiledContentRuleListData::decode):
(WebKit::WebCompiledContentRuleListData::size const): Deleted.
(WebKit::WebCompiledContentRuleListData::dataPointer const): Deleted.
* Shared/WebCompiledContentRuleListData.h:
(WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleList.cpp:
(API::ContentRuleList::usesCopiedMemory const): Deleted.
* UIProcess/API/APIContentRuleList.h:
* UIProcess/API/APIContentRuleListStore.cpp:
(API::openAndMapOrCopyContentRuleList):
(API::compiledToFile):
(API::createExtension):
(API::ContentRuleListStore::getContentRuleListSource):
(API::ContentRuleListStore::readContentsOfFile): Deleted.
(API::MappedOrCopiedData::dataPointer const): Deleted.
* UIProcess/API/APIContentRuleListStore.h:
* UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
(API::ContentRuleListStore::readContentsOfFile): Deleted.
* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]): Deleted.
* UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter usesCopiedMemory]): Deleted.
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
* WebKit.xcodeproj/project.pbxproj:
2019-04-24 David Kilzer <ddkilzer@apple.com>
Fix build due to missing SPI declaration of kAXSFullKeyboardAccessEnabledNotification
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Import
AccessibilitySupportSPI.h.
2019-04-24 Chris Dumez <cdumez@apple.com>
URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
https://bugs.webkit.org/show_bug.cgi?id=197214
<rdar://problem/49237544>
Reviewed by Alex Christensen.
URL set by document.open() is communicated with the WebPageProxy (since r244361) but not the
WebFrameProxy. This patch fixes this.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mainFrameURL]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/FrameLoadState.cpp:
(WebKit::FrameLoadState::didExplicitOpen):
* UIProcess/FrameLoadState.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didExplicitOpen):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
2019-04-24 Chris Dumez <cdumez@apple.com>
X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
https://bugs.webkit.org/show_bug.cgi?id=197226
<rdar://problem/50155649>
Reviewed by Alex Christensen.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
2019-04-24 Dean Jackson <dino@apple.com>
Rename _highlightLongPressCanClick and only add gesture recognizer when necessary
https://bugs.webkit.org/show_bug.cgi?id=197231
<rdar://problem/50164234>
Reviewed by Antoine Quint.
Rename _highlightLongPressCanClick to _longPressCanClick since it will be
used in other places.
Only attach the _highlightLongPressGestureRecognizer when we're not
using long presses for preview. This might revert in the future, if we
can set up an appropriate gesture resolution between the two.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _webTouchEvent:preventsNativeGestures:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemControllerDidCancelPreview:]):
2019-04-24 chris fleizach <cfleizach@apple.com>
AX: Remove deprecated Accessibility Object Model events
https://bugs.webkit.org/show_bug.cgi?id=197073
<rdar://problem/50027819>
Reviewed by Ryosuke Niwa.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView dealloc]):
(accessibilityEventsEnabledChangedCallback): Deleted.
(-[WKWebView _updateAccessibilityEventsEnabled]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateAccessibilityEventsEnabled): Deleted.
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateAccessibilityEventsEnabled): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-04-23 John Wilander <wilander@apple.com>
Move Ad Click Attribution from internal feature to experimental feature
https://bugs.webkit.org/show_bug.cgi?id=197218
<rdar://problem/47651691>
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
2019-04-23 Keith Rollin <krollin@apple.com>
Add Xcode version check for Header post-processing scripts
https://bugs.webkit.org/show_bug.cgi?id=197116
<rdar://problem/50058968>
Reviewed by Brent Fulgham.
There are several places in our Xcode projects that post-process
header files after they've been exported. Because of XCBuild, we're
moving to a model where the post-processing is performed at the same
time the header files are exported, rather than as a distinct
post-processing step. This patch disables the distinct step when the
inline processing is available.
In practice, this means prefixing appropriate post-processing Custom
Build phases with:
if [ "${XCODE_VERSION_MAJOR}" -ge "1100" -a "${USE_NEW_BUILD_SYSTEM}" = "YES" ]; then
# In this configuration, post-processing is performed at the same time as copying in the postprocess-header-rule script, so there's no need for this separate step.
exit 0
fi
* WebKit.xcodeproj/project.pbxproj:
2019-04-23 John Wilander <wilander@apple.com>
Remove Ad Click Attribution data when removing website data
https://bugs.webkit.org/show_bug.cgi?id=197215
<rdar://problem/47668988>
Reviewed by Chris Dumez.
This patch adds a new WebsiteDataType called AdClickAttributions and flags
it as owned by the network process.
The new website data type is added to the Cocoa API layer for
website data records management.
When either of the two WebsiteDataStore::removeData() functions calls
NetworkProcess::deleteWebsiteData() or
NetworkProcess::deleteWebsiteDataForOrigins() over IPC, the network
process now calls into AdClickAttributionManager::clear() and
AdClickAttributionManager::clearForRegistrableDomain() respectively,
if the website datatypes include WebsiteDataType::AdClickAttributions.
The patch removes a couple of completion handlers in NetworkSession function
calls are because those are not asynchronous.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::clear):
(WebKit::AdClickAttributionManager::clearForRegistrableDomain):
(WebKit::AdClickAttributionManager::toString const):
* NetworkProcess/AdClickAttributionManager.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::clearAdClickAttribution):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::clearAdClickAttribution):
(WebKit::NetworkSession::clearAdClickAttributionForRegistrableDomain):
* NetworkProcess/NetworkSession.h:
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):
* Shared/WebsiteData/WebsiteDataType.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
(dataTypesToString):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataType):
(WebKit::toWKWebsiteDataTypes):
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]):
2019-04-23 Tim Horton <timothy_horton@apple.com>
Return annotated text checking strings via UIWKDocumentContext
https://bugs.webkit.org/show_bug.cgi?id=197177
<rdar://problem/49064839>
Reviewed by Ryosuke Niwa.
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDocumentEditingContext):
Respect the UIWKDocumentRequestAnnotation flag, returning an attributed
string containing the platform text checking annotations.
2019-04-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244556.
https://bugs.webkit.org/show_bug.cgi?id=197212
Causing build failures on multiple builders (Requested by
ShawnRoberts on #webkit).
Reverted changeset:
"Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
https://bugs.webkit.org/show_bug.cgi?id=197171
https://trac.webkit.org/changeset/244556
2019-04-23 Remy Demarest <rdemarest@apple.com>
Build fix after r244545.
Reviewed by Tim Horton.
* Platform/spi/mac/AppKitSPI.h:
The SPI was an IPI in High Sierra.
2019-04-23 Per Arne Vollan <pvollan@apple.com>
[iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=196740
Reviewed by Megan Gardner.
When an url for a page with an autofocused input field is entered with the software keyboard,
the input field is auto selected, and the software keyboard reappears. This does not happen
when picking the url from favorites. After using the software keyboard to enter the url, the
activity state is being changed to focused. The method '_elementDidFocus' checks whether the
activity state changed, and allows the software keyboard to be shown in this case. To avoid
showing the software keyboard in this case, send the changing activity state bitfield to the
UI process, and check if the focus flag is the only flag set.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2019-04-23 Guy Lewin <guy@lewin.co.il>
Multiple File Input Icon Set Regardless of File List
https://bugs.webkit.org/show_bug.cgi?id=195537
Reviewed by Alexey Proskuryakov.
Add WKOpenPanelResultListenerChooseMediaFiles() to choose files with
icon and display string on iOS file open panels
* UIProcess/API/C/WKOpenPanelResultListener.cpp:
(WKOpenPanelResultListenerChooseMediaFiles):
* UIProcess/API/C/WKOpenPanelResultListener.h:
2019-04-23 Eric Carlson <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
Reviewed by Youenn Fablet.
* Shared/ios/WebIconUtilities.mm:
(WebKit::iconForVideoFile):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::clone const):
2019-04-22 Dean Jackson <dino@apple.com>
Use additional members and protocols from WebKitAdditions in WKContentViewInteraction
https://bugs.webkit.org/show_bug.cgi?id=197184
<rdar://problem/50113848>
Reviewed by Wenson Hsieh.
WebKitAdditions defines some macros to include additional members
and protocols for WKContentViewInteraction.
It also defines some new functions. Provide empty version
of those functions when WebKitAdditions is not available.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _registerPreview]):
(-[WKContentView _unregisterPreview]):
2019-04-23 Tim Horton <timothy_horton@apple.com>
Action sheet shares a stringified URL instead of a URL object
https://bugs.webkit.org/show_bug.cgi?id=197185
<rdar://problem/49962249>
Reviewed by Darin Adler.
* UIProcess/Cocoa/WKShareSheet.h:
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
(-[WKShareSheet presentWithParameters:completionHandler:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showShareSheet):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showShareSheet):
Make it possible to optionally provide WKShareSheet with
a rect to present relative to.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showShareSheet:inRect:completionHandler:]):
(-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
(-[WKContentView _showShareSheet:completionHandler:]): Deleted.
Instead of stringifying the URL and using the text selection assistant's
share method, hand WKShareSheet a proper URL.
2019-04-23 Ryosuke Niwa <rniwa@webkit.org>
[iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
https://bugs.webkit.org/show_bug.cgi?id=197188
Reviewed by Wenson Hsieh.
Commit the scroll tree update before revealing the keyboard via editor state update.
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2019-04-23 Remy Demarest <rdemarest@apple.com>
Fix layout issues occuring when entering full screen mode.
https://bugs.webkit.org/show_bug.cgi?id=197086
<rdar://problem/47733671>.
Reviewed by Darin Adler.
This issue is the result of changing the style mask of the window after entering
full screen mode. Safari adds an invisible toolbar to display the URL of the page
which ends up breaking the layout. Having that window use a style that includes a
titlebar fixes the bug.
* Platform/spi/mac/AppKitSPI.h:
Declare an SPI to be used in WKFullScreenWindowController.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::fullScreenWindow): Make the full screen window show a titlebar
and make the content view underlap the titlebar to match the current behavior.
Remove NSWindowStyleMaskBorderless which has no effects since it is equal to zero.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:webView:page:]): Hide the titlebar
before beginning the animation to full screen.
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Show the title
bar when in full screen instead of a blank bar.
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Hide the title
bar to restore the initial setting.
2019-04-23 John Wilander <wilander@apple.com>
Ad Click Attribution redirects to well-known location should not trigger a conversion if they are blocked by content blockers
https://bugs.webkit.org/show_bug.cgi?id=197183
<rdar://problem/47763188>
Reviewed by Alex Christensen.
Ad Click Attribution conversions are picked up in the redirect handler
in WebKit::NetworkResourceLoader. Content blocking typically happens in
the continued redirect request handling in the web content process and
a blocked request comes back empty.
We need to call the WebKit::NetworkLoadChecker in the network process
for these specific redirects, just like we do for Ping.
The change makes use of the existing function
NetworkLoadChecker::enableContentExtensionsCheck() for this purpose.
In essence, this change makes it possible to block all conversions made
to a "/.well-known/ad-click-attribution/" URL.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::handleAdClickAttributionConversion):
New convenience function.
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
Now calls NetworkLoadChecker::enableContentExtensionsCheck() if
an Ad Click Attribution conversion was found in the redirect URL.
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
If the request was not blocked, it will store any found conversion here.
* NetworkProcess/NetworkResourceLoader.h:
2019-04-23 Don Olmstead <don.olmstead@sony.com>
[CMake][Win] Use target oriented design for WebKit
https://bugs.webkit.org/show_bug.cgi?id=197173
Reviewed by Alex Christensen.
Enumerate public framework headers for WinCairo's WebKit implementation and copy them.
Migrate to use WebKit_DERIVED_SOURCES_DIR.
* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
2019-04-23 Chris Dumez <cdumez@apple.com>
[Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
https://bugs.webkit.org/show_bug.cgi?id=197097
<rdar://problem/50048318>
Reviewed by Alex Christensen.
The issue is that when doing a history navigation with form data, we try to resubmit the form.
We initially use the ReturnCacheDataDontLoad cache policy without prompting the user to get
cached data. If this fails, we sent a DidFailProvisionalLoadForFrame IPC to the UIProcess but
the WebContent process actually retries the load with ReturnCacheDataElseLoad cache policy.
This new load triggers a new decidePolicyForNavigationAction.
This would cause trouble with process-swapping because we normally destroy the
ProvisionalPageProxy as soon as we receive a DidFailProvisionalLoadForFrame IPC from the
provisional process. As a result, the provisional process would not be able to retry.
To address the issue, we add pass a flag with the DidFailProvisionalLoadForFrame IPC to
if the load will continue or not. When this flag is set, the UIProcess does not destroy
the provisional page.
* Scripts/webkit/messages.py:
Minor IPC message handler build fix.
* UIProcess/API/Cocoa/WKURLSchemeTask.mm:
(-[WKURLSchemeTaskImpl _onlyIfCached]):
* UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
Add new _onlyIfCached SPI to WKURLSchemeTaskPrivate to allow for API testing.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::cancel):
Pass WillContinueLoading flag.
(WebKit::ProvisionalPageProxy::validateInput):
Consider IPC with a navigationID of 0 as valid. When the navigation is triggered by the
WebContent process, it sends us a DecidePolicyForNavigationActionAsync IPC with a navigationID
of 0, until the UIProcess can generate a valid identifier.
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
When the WebPageProxy has generated a navigationID for the new WebContent process-initiated
navigation, update m_navigationID so that follow-up IPC is considered valid.
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-04-22 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
https://bugs.webkit.org/show_bug.cgi?id=197175
<rdar://problem/49613013>
Reviewed by Simon Fraser.
Do not generate additional synthetic mouse events (e.g. mouseout in this case) when the content handles the click event. This helps cases when the synthetic mouseout ended up dismissing the dropdown menus.
However it won't regress cases like youtube.com, where sending mouseout is required to have the control bar dismissed on play.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
2019-04-22 Alex Christensen <achristensen@webkit.org>
Deprecate WKContextCreateWithInjectedBundlePath
https://bugs.webkit.org/show_bug.cgi?id=197169
Reviewed by Youenn Fablet.
* UIProcess/API/C/WKContext.h:
2019-04-22 Alex Christensen <achristensen@webkit.org>
REGRESSION(r230681) Do not use stored credentials if WKBundlePageResourceLoadClient.shouldUseCredentialStorage returns false
https://bugs.webkit.org/show_bug.cgi?id=197093
<rdar://problem/49708268>
Reviewed by Chris Dumez.
Only get the StoredCredentialsPolicy from the NetworkLoadChecker if we haven't already been told not to use credentials.
Also add some test infrastructure for clearing persistent credentials added by the test.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeCredential):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::removeCredential):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _removeCredential:forProtectionSpace:completionHandler:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeCredential):
* UIProcess/WebProcessPool.h:
2019-04-22 Chris Dumez <cdumez@apple.com>
Delayed WebProcessLaunch may break the _relatedWebView SPI
https://bugs.webkit.org/show_bug.cgi?id=197160
Reviewed by Alex Christensen.
Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
would relate a WebView to another which has not launched its initial process yet.
To address the issue, when we need a running process for a WebView which has a related view, we need
to make sure the related view has a running process and use that process. Previously, we would share
the "dummy" process instead.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::ensureRunningProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
2019-04-22 David Quesada <david_quesada@apple.com>
Remove linked-on-or-after check for download attribute handling
https://bugs.webkit.org/show_bug.cgi?id=197176
rdar://problem/48459714
Reviewed by Alex Christensen.
There are no apps linked prior to this SDK version that are using the _WKDownload SPI,
so it doesn't make sense to preserve the old behavior of forcing download-attribute
links to start downloads.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2019-04-22 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r244502.
Caused crashes on the bots
Reverted changeset:
"Delayed WebProcessLaunch may break the _relatedWebView SPI"
https://bugs.webkit.org/show_bug.cgi?id=197160
https://trac.webkit.org/changeset/244502
2019-04-22 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r244437.
Still breaks internal tests.
Reverted changeset:
"InjectedBundle parameters often need initialization function
called before unarchiving"
https://bugs.webkit.org/show_bug.cgi?id=189709
https://trac.webkit.org/changeset/244437
2019-04-22 Chris Dumez <cdumez@apple.com>
Delayed WebProcessLaunch may break the _relatedWebView SPI
https://bugs.webkit.org/show_bug.cgi?id=197160
Reviewed by Alex Christensen.
Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
would relate a WebView to another which has not launched its initial process yet.
To address the issue, when we need a running process for a WebView which has a related view, we need
to make sure the related view has a running process and use that process. Previously, we would share
the "dummy" process instead.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::ensureRunningProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
2019-04-22 Ludovico de Nittis <ludovico.denittis@collabora.com>
[GTK] fix gtk_style_context_set_background deprecation
https://bugs.webkit.org/show_bug.cgi?id=196912
Reviewed by Carlos Garcia Campos.
Since gtk 3.18 gtk_style_context_set_background has been deprecated.
Backgrounds are not rendered in the UI process, so it can be
simply removed.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
2019-04-21 Wenson Hsieh <wenson_hsieh@apple.com>
Defer EditorState updates until the next layer tree flush in a few additional circumstances
https://bugs.webkit.org/show_bug.cgi?id=197145
<rdar://problem/50078170>
Reviewed by Darin Adler.
Gets rid of sendPartialEditorStateAndSchedulePostLayoutUpdate(), in favor of always scheduling a full editor
state update after the next compositing flush.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged):
(WebKit::WebPage::setNeedsFontAttributes):
(WebKit::WebPage::didChangeOverflowScrollPosition):
(WebKit::WebPage::didChangeSelection):
(WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
(WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::updateVisibleContentRects):
2019-04-21 Chris Dumez <cdumez@apple.com>
Regression(r243767) WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset
https://bugs.webkit.org/show_bug.cgi?id=197144
Reviewed by Darin Adler.
WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset since it was introduced in
r243767. This leads to leaking Navigation objects in the UIProcess when reusing a previously
suspended process because such process will no longer send the DidDestroyNavigation IPC.
It turns out that resetting the flags causes API tests such as ProcessSwap.QuickBackForwardNavigationWithPSON
to ASSERT. This is because when the UIProcess quickly navigate back and forth without waiting for policy
decisions, we may end up getting the policy decision for a particular navigation *after* we've sent the
DidDestroyNavigation.
As a result, this patch reverts r243767 and fixes in the assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
another way. We initially assumed that the logic in WebPageProxy::didDestroyNavigation() was failing to
ignore the DidDestroyNavigation from the previous process after a swap due to a race, maybe because it was
sometimes received too late and m_provisionalPage was already cleared. However, this would not make sense
since the test is crashing consistently and the page would no longer be able to receive IPC from the
previous process *after* we've committed the provisional process/page.
The real issue was that the DidDestroyNavigation IPC was received *before* we could construct the
provisional page, which is why the logic in WebPageProxy::didDestroyNavigation() was failing to ignore
the bad IPC. In WebPageProxy::receivedNavigationPolicyDecision(), we were calling receivedPolicyDecision()
(which would send the DidReceivePolicyDecision to the previous WebProcess) and then continueNavigationInNewProcess()
in order to construct the provisional page. I personally did not expect we could receive IPC between the
calls to receivedNavigationPolicyDecision() and receivedPolicyDecision(), since we are not yielding and since
the DidReceivePolicyDecision IPC is asynchronous. However, this is exactly what was happening in the context
of this test. The reason is that the DidReceivePolicyDecision IPC was getting wrapped in a synchronous message
and sent as synchronous message due to the Connection::m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting
flag which seems to get set in the test due to some EventSender IPC. I believe this is because the test uses
EventSender to do a click on a link which triggers the navigation.
To address the issue, I now call receivedNavigationPolicyDecision() *after* continueNavigationInNewProcess()
to make sure that we always start the provisional load in the new process before we tell the previous process
to stop loading. This way, there is no way we get IPC from the previous process about the current navigation
before we have a provisional page.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didDestroyNavigation):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
(WebKit::WebFrame::documentLoaderDetached):
* WebProcess/WebPage/WebFrame.h:
2019-04-20 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* UIProcess/API/Cocoa/WKWebView.mm:
(deviceOrientation):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController initWithWebView:]):
(-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
(-[WKFullScreenViewController _statusBarFrameDidChange:]):
2019-04-19 John Wilander <wilander@apple.com>
Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
https://bugs.webkit.org/show_bug.cgi?id=197108
<rdar://problem/49918702>
Reviewed by Alex Christensen.
This patch introduces a new NSURLSession in WebKit::NetworkSessionCocoa called
m_ephemeralStatelessCookielessSession. As its name implies, it's ephemeral,
stateless, and has a NSHTTPCookieAcceptPolicyNever cookie policy.
The new session can be invoked with the new enum value of
WebCore::StoredCredentialsPolicy called EphemeralStatelessCookieless.
WebKit::AdClickAttributionManager::fireConversionRequest() makes use of
the new session for its conversion requests.
This patch also makes sure that Ad Click Attributions cannot be stored in
ephemeral sessions and already stored attributions cannot be converted in
ephemeral sessions.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::fireConversionRequest):
(WebKit::AdClickAttributionManager::toString const):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
Calls NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession() lazily.
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession):
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
* Shared/WebCoreArgumentCoders.h:
2019-04-19 Daniel Bates <dabates@apple.com>
Use RetainPtr and rename +autocorrectionRectsWithRects:lastRect: to +autocorrectionRectsWithFirstCGRect:lastCGRect:
https://bugs.webkit.org/show_bug.cgi?id=197122
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Renamed; formerly named +autocorrectionRectsWithRects:lastRect:.
While I am here use else-branch to initialize firstRect and lastRect just to make the code closer to the optimal
assembly. Also use Vector::{isEmpty, first, last}() instead of using the index operator overload and size() for
emptiness checks. The code is more readable at the cost being ever so slightly slower (due to the overflow checks
in first() and last()), but this code is likely not hot enough for it to matter.
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): Update for renaming.
(+[WKAutocorrectionRects autocorrectionRectsWithFirstCGRect:lastCGRect:]): Ditto.
(+[WKAutocorrectionRects autocorrectionRectsWithRects:lastRect:]): Deleted.
2019-04-19 Daniel Bates <dabates@apple.com>
-[WKAutocorrectionContext emptyAutocorrectionContext:] generates invalid empty context
https://bugs.webkit.org/show_bug.cgi?id=197119
Reviewed by Wenson Hsieh.
Use the existing EditingRange type to represent the location and length of the marked text
range for an autocorrection instead of managing integers. This type avoid the need to handle
the special case for an empty range represented as NSMakeRange(NSNotFound, 0). Currently
WKAutocorrectionContext incorrectly represents the empty range as NSMakeRange(WTF::notFound, 0).
While I am here, simplify the existing WebAutocorrectionContext encoder/decoder code and rename
+[WKAutocorrectionContext autocorrectionContextWithContext:] to +autocorrectionContextWithWebContext
to better reflect the expected source of the conversion: a Web-type.
* Shared/ios/WebAutocorrectionContext.h:
(WebKit::WebAutocorrectionContext::encode const): Reformat while I am here to make this logic easy
to amend without losing SVN history.
(WebKit::WebAutocorrectionContext::decode): Simplify the code while I am here.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleAutocorrectionContext:]): Update for renaming.
(+[WKAutocorrectionContext emptyAutocorrectionContext]): Update for renaming.
(+[WKAutocorrectionContext autocorrectionContextWithWebContext:]): Renamed; formerly named autocorrectionContextWithContext.
(+[WKAutocorrectionContext autocorrectionContextWithContext:]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::autocorrectionContext): Update to make use of EditingRange. Also instantiate
the struct and return it, initializing its fields individually instead of using the constructor to
make this code less error prone. It's easy to introduce an error with the constructor notation when
amending the the struct because so many of the arguments are of the same data type. Individually
initializing the struct fields makes it less likely for an ordering mistake to be introduced.
2019-04-19 Dean Jackson <dino@apple.com>
Add more _WKElementActionTypes and provide API to create with custom types
https://bugs.webkit.org/show_bug.cgi?id=197117
<rdar://problem/50059548>
Reviewed by Tim Horton.
We were missing a few obvious types that are well-known
browser actions, and/or should be visible in share sheets.
Also, clean up the API for constructing new types.
* UIProcess/API/Cocoa/_WKElementAction.h: Add new types for opening
in new tabs, windows and downloading.
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction elementActionWithType:title:actionHandler:]): New constructor
with type, title and action.
(+[_WKElementAction elementActionWithType:]): Call new method.
2019-04-18 Daniel Bates <dabates@apple.com>
Use existing KeyEventCodesIOS constants instead of duplicating them
https://bugs.webkit.org/show_bug.cgi?id=197081
Rubber-stamped by Wenson Hsieh.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]): While I am here, remove the case for the space key
as it is identical to the default switch case.
2019-04-19 Keith Rollin <krollin@apple.com>
Add postprocess-header-rule scripts
https://bugs.webkit.org/show_bug.cgi?id=197072
<rdar://problem/50027299>
Reviewed by Brent Fulgham.
Several projects have post-processing build phases where exported
headers are tweaked after they've been copied. This post-processing is
performed via scripts called postprocess-headers.sh. For reasons
related to XCBuild, we are now transitioning to a build process where
the post-processing is performed at the same time as the
exporting/copying. To support this process, add similar scripts named
postprocess-header-rule, which are geared towards processing a single
file at a time rather than all exported files at once. Also add a
build rule that makes use of these scripts. These scripts and build
rules are not used at the moment; they will come into use in an
imminent patch.
Note that I've named these postprocess-header-rule rather than
postprocess-header-rule.sh. Scripts in Tools/Scripts do not have
suffixes indicating how the tool is implemented. Scripts in
per-project Scripts folders appear to be mixed regarding the use of
suffixes. I'm opting here to follow the Tools/Scripts convention, with
the expectation that over time we completely standardize on that.
* Scripts/postprocess-header-rule: Added.
* WebKit.xcodeproj/project.pbxproj:
2019-04-19 Brady Eidson <beidson@apple.com>
Deprecate WebKit2 plug-in support.
<rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
Reviewed by Andy Estes.
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):
(-[WKPreferences javaEnabled]):
(-[WKPreferences setJavaEnabled:]):
(-[WKPreferences plugInsEnabled]):
(-[WKPreferences setPlugInsEnabled:]):
2019-04-19 Chris Dumez <cdumez@apple.com>
Minor PSON release logging improvements
https://bugs.webkit.org/show_bug.cgi?id=197104
Reviewed by Darin Adler.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
2019-04-19 Tim Horton <timothy_horton@apple.com>
YouTube and Twitter embeds don't load in News
https://bugs.webkit.org/show_bug.cgi?id=197111
<rdar://problem/50010081>
Reviewed by Timothy Hatcher.
* WebProcess/com.apple.WebProcess.sb.in:
Adjust this sandbox exception to include both platforms.
2019-04-19 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
https://bugs.webkit.org/show_bug.cgi?id=197102
<rdar://problem/49864669>
Reviewed by Ryosuke Niwa.
If the quirk for disabling autocorrection and autocapitalization in hidden editable areas is active, then check
whether the focused element is hidden, and turn off autocorrection and autocapitalization if needed.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
2019-04-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244447.
https://bugs.webkit.org/show_bug.cgi?id=197103
Caused build failures with Internal and Opensource builders
(Requested by ShawnRoberts on #webkit).
Reverted changeset:
"Deprecate WebKit2 plug-in support."
https://bugs.webkit.org/show_bug.cgi?id=197080
https://trac.webkit.org/changeset/244447
2019-04-18 Brady Eidson <beidson@apple.com>
Deprecate WebKit2 plug-in support.
<rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
Reviewed by Andy Estes.
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):
(-[WKPreferences javaEnabled]):
(-[WKPreferences setJavaEnabled:]):
(-[WKPreferences plugInsEnabled]):
(-[WKPreferences setPlugInsEnabled:]):
2019-04-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244434.
https://bugs.webkit.org/show_bug.cgi?id=197089
caused 1 API test failure (Requested by zalan on #webkit).
Reverted changeset:
"Regression (r244291): Broken API Test
AutoLayoutRenderingProgressRelativeOrdering"
https://bugs.webkit.org/show_bug.cgi?id=196948
https://trac.webkit.org/changeset/244434
2019-04-18 Wenson Hsieh <wenson_hsieh@apple.com>
Add new compatibility mode API on WKNavigation
https://bugs.webkit.org/show_bug.cgi?id=197069
<rdar://problem/50025800>
Reviewed by Tim Horton.
Adds a new property on WKNavigation.
* Shared/WebCompatibilityMode.h:
Drive-by fix: make this enum class 8 bits wide.
* UIProcess/API/APINavigation.h:
(API::Navigation::setEffectiveCompatibilityMode):
(API::Navigation::effectiveCompatibilityMode const):
Add a new member variable to API::Navigation.
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigation.mm:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
* UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
Add various hooks into WebKitAdditions.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
Set API::Navigation's effective compatibility mode.
(WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
Renamed and refactored this method to return the effective compatibility mode, chosen while adjusting website
policies.
(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode): Deleted.
* UIProcess/WebPageProxy.h:
2019-04-18 Don Olmstead <don.olmstead@sony.com>
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
<rdar://problem/37510435>
Reviewed by Alex Christensen.
WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
problems with WebKit's usage of WebCore headers. All include directories directly
referencing the WebCore source tree we're removed from the CMake files. Any includes
of WebCore headers using "*.h" were modified to <WebCore/*.h>
Removed generation of forwarding headers for WebCore using the perl script.
* CMakeLists.txt:
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Scripts/generate-forwarding-headers.pl:
* UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
* UIProcess/API/wpe/WebKitColorPrivate.h:
* UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
* UIProcess/win/PageClientImpl.cpp:
2019-04-18 Chris Dumez <cdumez@apple.com>
[iOS] Improve detection of when web views go to background / foreground
https://bugs.webkit.org/show_bug.cgi?id=197035
<rdar://problem/45281182>
Reviewed by Tim Horton.
Improve detection of when web views go to background / foreground on iOS.
* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker): Deleted.
(WebKit::ApplicationStateTracker::~ApplicationStateTracker): Deleted.
(WebKit::ApplicationStateTracker::applicationDidEnterBackground): Deleted.
(WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): Deleted.
(WebKit::ApplicationStateTracker::applicationWillEnterForeground): Deleted.
2019-04-18 Jer Noble <jer.noble@apple.com>
Refactoring: Pull all fullscreen code out of Document and into its own helper class
https://bugs.webkit.org/show_bug.cgi?id=197017
Reviewed by Eric Carlson.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
(WebKit::WebFullScreenManager::didExitFullScreen):
(WebKit::WebFullScreenManager::setAnimatingFullScreen):
(WebKit::WebFullScreenManager::requestExitFullScreen):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_webkit_cancel_fullscreen):
(webkit_dom_document_webkit_exit_fullscreen):
(webkit_dom_document_get_webkit_is_fullscreen):
(webkit_dom_document_get_webkit_fullscreen_keyboard_input_allowed):
(webkit_dom_document_get_webkit_current_fullscreen_element):
(webkit_dom_document_get_webkit_fullscreen_element):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
2019-04-18 Megan Gardner <megan_gardner@apple.com>
Update UIKit when a cut causes a selection change
https://bugs.webkit.org/show_bug.cgi?id=197047
<rdar://problem/36311563>
Reviewed by Wenson Hsieh.
We need to let UIKit know when a cut causes a selection change (always),
so that is can appropriately update the button on the keyboard bar.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cutForWebView:]):
2019-04-18 Brent Fulgham <bfulgham@apple.com>
InjectedBundle parameters often need initialization function called before unarchiving
https://bugs.webkit.org/show_bug.cgi?id=189709
<rdar://problem/44573653>
Reviewed by Ryosuke Niwa.
Handle the case where the InjectedBundle parameters do not successfully decode because they contain
an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
after the bundle initialiation function runs, which gives the embedding program the opportunity to
register additional classes that are safe for serialization.
Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
to be serialized by the InjectedBundle.
Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
Revise 'initialize' to call this new method.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Use the new method.
(WebKit::InjectedBundle::decodeBundleParameters): Added.
(WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
'classesForCoder' method to unarchive the passed bundle parameters, rather than the
NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
NSDictionary object may itself hold other kinds of objects.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
(WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.
2019-04-18 Zalan Bujtas <zalan@apple.com>
Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948
<rdar://problem/49927131>
Reviewed by Tim Horton.
Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
after r244291 there's no reason to have it in DrawingArea.
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::didUpdateGeometry):
(WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/DrawingAreaProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeIntrinsicContentSize):
(WebKit::WebPageProxy::setViewLayoutSize):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
2019-04-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r244299.
Breaks internal tests.
Reverted changeset:
"InjectedBundle parameters often need initialization function
called before unarchiving"
https://bugs.webkit.org/show_bug.cgi?id=189709
https://trac.webkit.org/changeset/244299
2019-04-18 Shawn Roberts <sroberts@apple.com>
Unreviewed manual rollout of r244248 and r244409
Causing assertion failures on Mac WK2 Debug builds
https://bugs.webkit.org/show_bug.cgi?id=195623
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::prefetchCache): Deleted.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/PrefetchCache.cpp: Removed.
* NetworkProcess/cache/PrefetchCache.h: Removed.
* Shared/WebPreferences.yaml:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-04-18 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: enable WebGL2 for inspector page
https://bugs.webkit.org/show_bug.cgi?id=196932
<rdar://problem/49916213>
Reviewed by Timothy Hatcher.
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
2019-04-17 Devin Rousso <drousso@apple.com>
Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
https://bugs.webkit.org/show_bug.cgi?id=197044
Reviewed by Joseph Pecoraro.
* UIProcess/WebInspectorUtilities.h:
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::trackInspectorPage):
(WebKit::untrackInspectorPage):
Determine the level of the inspector page by looking to see if the page being inspected is
in the inspector page map. If so, we must be inspecting an inspector page and should use
that inspector page's inspection level as the value to increment.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
2019-04-17 Tim Horton <timothy_horton@apple.com>
Adopt different scroll view flashing SPI
https://bugs.webkit.org/show_bug.cgi?id=197043
<rdar://problem/49996476>
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
2019-04-17 Tim Horton <timothy_horton@apple.com>
REGRESSION (r241988): Switching tabs is slow
https://bugs.webkit.org/show_bug.cgi?id=197037
<rdar://problem/49951473>
Reviewed by Simon Fraser.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
r241988 changed to wait for a WebPageProxy message to a given DrawingArea ID,
but WebPageProxy messages are identified by their WebPageProxy ID.
Revert that one change. The rest of the patch looks OK.
2019-04-17 Rob Buis <rbuis@igalia.com>
Link prefetch not useful for top-level navigation
https://bugs.webkit.org/show_bug.cgi?id=195623
Reviewed by Alex Christensen.
Fix macOS and iOS Debug WK2 bots ASSERTS after r367404, by simply
not sending the DidReceiveResponse message.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
2019-04-17 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r244400.
Caused testing to exit early with assertionon Debug WK2
Reverted changeset:
"UI↔Web deadlock when printing with a JavaScript alert
visible"
https://bugs.webkit.org/show_bug.cgi?id=196839
https://trac.webkit.org/changeset/244400
2019-04-17 Brady Eidson <beidson@apple.com>
Link clicks in PDFs shouldn't send referrer headers.
<rdar://problem/21142581> and https://bugs.webkit.org/show_bug.cgi?id=196980
Reviewed by Tim Horton.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::clickedLink):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2019-04-17 Andy Estes <aestes@apple.com>
[iOS] Support multiple file selection in UIDocumentPickerViewController
https://bugs.webkit.org/show_bug.cgi?id=197014
<rdar://problem/49963514>
Reviewed by Tim Horton.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showDocumentPickerMenu]):
Allowed multiple file selection in our UIDocumentPickerViewController when
_allowMultipleFiles is YES.
(displayStringForDocumentsAtURLs):
(-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
Changed to support multiple file selection. When more than one file is selected, use
WebCore::multipleFileUploadText() as the display string.
2019-04-17 Alex Christensen <achristensen@webkit.org>
Make WebCompiledContentRuleListData non-default-constructible, move its nonserialized member to API::ContentRuleList
https://bugs.webkit.org/show_bug.cgi?id=197033
Reviewed by Tim Horton.
This is just cleanup that makes the code nicer without changing behavior.
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::encode const):
(WebKit::WebCompiledContentRuleListData::decode):
* Shared/WebCompiledContentRuleListData.h:
(WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
* UIProcess/API/APIContentRuleList.h:
* UIProcess/API/APIContentRuleListStore.cpp:
(API::createExtension):
2019-04-17 John Wilander <wilander@apple.com>
Add prioritization of ad click conversions and cleaning of sent ad click conversions
https://bugs.webkit.org/show_bug.cgi?id=196934
<rdar://problem/49917773>
Reviewed by Chris Dumez.
In this description, by "pair" I mean { AdClickAttribution::Source, AdClickAttribution::Destination }.
This patch adds handling of prioritization of conversions according to these rules:
- If we have a matching unconverted attribution, convert it. This consumes the conversion.
- If we have no previously converted attribution for this pair, just store.
- If we have a previously converted attribution for this pair, replace it if the new one has higher priority.
- If we had no matching unconverted attribution but do have a previously converted attribution for this
pair, re-convert the previously converted attribution to make sure the highest priority gets set.
This handling is in part done by dividing the previous m_adClickAttributionMap into
m_unconvertedAdClickAttributionMap and m_convertedAdClickAttributionMap, which now use a std::pair
as key instead of a nested HashMap.
This patch also changes AdClickAttributionManager::firePendingConversionRequests() so that it now
removes attributions which have been sent out.
Finally, AdClickAttributionManager::clear() no longer clears m_conversionBaseURLForTesting and
m_isRunningTest since doing so caused test flakiness. It is now up to the test case that sets these
members to also clear them when done.
* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::storeUnconverted):
(WebKit::AdClickAttributionManager::convert):
(WebKit::AdClickAttributionManager::firePendingConversionRequests):
(WebKit::AdClickAttributionManager::clear):
(WebKit::AdClickAttributionManager::toString const):
(WebKit::AdClickAttributionManager::setConversionURLForTesting):
(WebKit::AdClickAttributionManager::ensureDestinationMapForSource): Deleted.
(WebKit::AdClickAttributionManager::store): Deleted.
* NetworkProcess/AdClickAttributionManager.h:
(WebKit::AdClickAttributionManager::AdClickAttributionManager):
(WebKit::AdClickAttributionManager::setConversionURLForTesting): Deleted.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::storeAdClickAttribution):
2019-04-17 Tim Horton <timothy_horton@apple.com>
UI↔Web deadlock when printing with a JavaScript alert visible
https://bugs.webkit.org/show_bug.cgi?id=196839
<rdar://problem/49157642>
Reviewed by Andy Estes.
* Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
(IPC::Connection::sendSyncReply):
(IPC::Connection::dispatchSyncMessage):
* Platform/IPC/Connection.h:
(IPC::Connection::hasOutstandingOutgoingSynchronousReplies const):
Keep track of whether we owe the other side of the connection any
delayed sync replies.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webViewPrintFormatter]):
Most actions one can take with a _WKWebViewPrintFormatter involve
synchronously messaging the Web Content process with an infinite timeout.
Doing so while the Web Content process is awaiting a reply to a deferred-reply
synchronous message (like, say, an alert()) results in an app-destroying deadlock.
Instead of that, return a nil _WKWebViewPrintFormatter, indicating to the client
that we can't print right now.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _wk_pageCountForPrintFormatter:]):
(-[WKContentView _wk_printedDocument]):
The above isn't sufficient, though, because a sync message could arrive and
be handled between creation and use of the _WKWebViewPrintFormatter.
So, we also bail with a zero page count and null CGPDFDocument immediately
before we would send a sync message to the Web Content process. Clients
handle this less gracefully (e.g. showing a zero page PDF), but it is
very rare compared to the above case.
2019-04-17 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
https://bugs.webkit.org/show_bug.cgi?id=196988
<rdar://problem/49955328>
Reviewed by Simon Fraser.
Tapping on elements with cretain aria role attributes should trigger synthetic click the same way it does on form control elements.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::isAriaRoleForImmediateClick):
(WebKit::nodeAlwaysRequiresClick):
(WebKit::WebPage::handleSyntheticClick):
2019-04-17 Alex Christensen <achristensen@webkit.org>
WKRetainPtr's adoption constructor should be private
https://bugs.webkit.org/show_bug.cgi?id=197019
Reviewed by Tim Horton.
RefPtr and RetainPtr have already done this. It makes us use nicer syntax.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/API/cpp/WKRetainPtr.h:
(WebKit::WKRetainPtr::WKRetainPtr):
(WebKit::adoptWK):
2019-04-17 Alex Christensen <achristensen@webkit.org>
Fix crash during teardown of PingLoad
https://bugs.webkit.org/show_bug.cgi?id=197024
<rdar://problem/49973077>
Reviewed by Jer Noble.
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::initialize):
Early return if weakThis is null.
2019-04-17 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r243926): [iOS] Release assertion when computing editor state during an overflow scroll triggered by layout
https://bugs.webkit.org/show_bug.cgi?id=197012
<rdar://problem/49908848>
Reviewed by Simon Fraser.
We hit the release assertion due to the following sequence of events:
- Dispatch a queued event (in this case, a scroll event)
- Invoke the scroll event listener, which modifies layout in some way
- This scrolls an overflow scrollable container under the scope of layout
- Overflow scrolling then calls didChangeSelection and triggers an editor state update, which updates layout
In the case where the selection is in the main frame, we bail early due to the check for recursive layout (i.e.
frameView->layoutContext().isInRenderTreeLayout()). However, in the case where the selection is inside a
subframe, we end up skipping past this check, since the subframe's FrameView isn't currently laying out, and so
we end up hitting the release assertion underneath the early return.
To fix this, simply defer editor state updates due to overflow scrolling until the next remote layer tree commit
instead of computing and sending the information immediately. While this only defers editor state updates during
overflow scrolling, <rdar://problem/47258878> tracks making editor state updates deferred in the general case.
Test: editing/selection/overflow-scroll-while-selecting-text.html
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::overflowScrollPositionChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeOverflowScrollPosition):
(WebKit::WebPage::didChangeSelection):
(WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
* WebProcess/WebPage/WebPage.h:
2019-04-17 Chris Dumez <cdumez@apple.com>
Remember device orientation permission for the duration of the browsing session
https://bugs.webkit.org/show_bug.cgi?id=196992
<rdar://problem/49946067>
Reviewed by Alex Christensen.
Implement caching of device orientation permission decisions on the WebDeviceOrientationAndMotionAccessController,
which is owned by the WebsiteDataStore. This way, if we already prompted the user of a given origin, we will
remember the previous decision for the duration of the session and not prompt again.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(toDeviceOrientationOrMotionPermissionState):
(-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
(toWKWebsiteDeviceOrientationAndMotionAccessPolicy):
(-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp: Added.
(WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowDeviceOrientationAndMotionAccess):
(WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const):
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h: Copied from Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::deviceOrientationAndMotionAccessController):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebPage/WebPage.h:
2019-04-16 Andy Estes <aestes@apple.com>
[iOSMac] Use UIDocumentPickerViewController for picking files
https://bugs.webkit.org/show_bug.cgi?id=196999
<rdar://problem/49961414>
Reviewed by Tim Horton.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showDocumentPickerMenu]):
Changed to present a UIDocumentPickerViewController on iOSMac.
(-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
(-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
Replaced a deprecated delegate method implementation.
2019-04-16 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [WebKit2] Add support for honoring -[UIMenuItem dontDismiss]
https://bugs.webkit.org/show_bug.cgi?id=196919
<rdar://problem/41630459>
Reviewed by Tim Horton.
Adds modern WebKit support for -dontDismiss by implementing a couple of new platform hooks. Covered by a new
layout test: editing/selection/ios/selection-after-changing-text-with-callout-menu.html.
* Platform/spi/ios/UIKitSPI.h:
Declare the private -dontDismiss property of UIMenuItem.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
Additionally teach the web view (not just the content view) to respond to the hook. This matters in the case
where the WebKit client (most notably, Mail) overrides WKWebView methods to define custom actions in the menu
controller. This scenario is exercised by the new layout test.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
If an action was performed where callout bar fading was ignored, then in WebKit, don't allow selection changes
to fade the callout bar until after the next remote layer tree commit.
(-[WKContentView _updateChangedSelection:]):
Stop suppressing selection updates when showing B/I/U controls, now that we can properly honor the -dontDismiss
property. This was originally introduced in <rdar://problem/15199925>, presumably to ensure that B/I/U buttons
(which have -dontDismiss set to YES) don't trigger selection change and end up dismissing themselves; however,
if triggering B/I/U actually changes the selection rects, this also means that the selection rects on-screen
would be stale after triggering these actions. This effect is most noticeable when bolding text.
(-[WKContentView shouldAllowHidingSelectionCommands]):
2019-04-16 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed non-unified build fix after r244307.
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2019-04-16 Megan Gardner <megan_gardner@apple.com>
Allow sharing from imageSheet on an image document
https://bugs.webkit.org/show_bug.cgi?id=196891
<rdar://problem/25377386>
Reviewed by Tim Horton.
Allow sharing from an image sheet generated from an image document
by storing the image URL and using it as a fallback for the URL.
Store it as an image on WKElementAction to not accidentally trigger
any actions that should actually be associated with pure URLs.
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
(-[_WKActivatedElementInfo imageURL]):
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]): Deleted.
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): Deleted.
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
(-[WKActionSheetAssistant showLinkSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
2019-04-16 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add a way for Apple-internal clients to opt into recommended compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196977
<rdar://problem/49871194>
Reviewed by Tim Horton.
Add a helper method to query whether the navigation client should bypass policy safeguards when determining the
recommended compatibility mode. We bypass policy safeguards in Cocoa platforms if the navigation delegate
implements the new navigation delegate API.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
2019-04-16 Per Arne Vollan <pvollan@apple.com>
-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=196991
<rdar://problem/45507423>
Reviewed by Brent Fulgham.
The credentials are stored in the Network process. To enable fetching credentials from the Network process,
a proper process access type needs to be set for the credential Website data type.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
2019-04-16 Alex Christensen <achristensen@webkit.org>
REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
https://bugs.webkit.org/show_bug.cgi?id=196995
Reviewed by Brady Eidson.
Always call CompletionHandlers. Otherwise things hang or assert.
I added an API test that asserts without this change so we don't regress this again.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
2019-04-16 Chris Dumez <cdumez@apple.com>
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>
Reviewed by Geoff Garen.
Whenever the UIProcess is notified of an explicit document.open() call, update the
PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
knows it committed a load (i.e. It is no longer showing the initially empty document).
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didExplicitOpen):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-04-16 Chris Dumez <cdumez@apple.com>
Show prompt for device orientation access if the client does not implement the corresponding API delegate
https://bugs.webkit.org/show_bug.cgi?id=196971
<rdar://problem/49945840>
Reviewed by Alex Christensen.
Show prompt for device orientation access if the client does not implement the corresponding
API delegate, instead of rejecting access by default.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/Cocoa/WKOrientationAccessAlert.h: Added.
* UIProcess/Cocoa/WKOrientationAccessAlert.mm: Added.
(WebKit::presentOrientationAccessAlert):
* WebKit.xcodeproj/project.pbxproj:
2019-04-16 Zalan Bujtas <zalan@apple.com>
REGRESSION(r243557)[ContentChangeObserver] Need to double tap text formatting elements in MS Word web app
https://bugs.webkit.org/show_bug.cgi?id=196975
<rdar://problem/49489849>
Reviewed by Simon Fraser.
This patch ensures that we always proceed with synthetic click on form elements.
Covered by existing tests.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-04-16 Timothy Hatcher <timothy@apple.com>
FrameView base background color always starts white.
https://bugs.webkit.org/show_bug.cgi?id=196976
Reviewed by Beth Dakin.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Set m_backgroundColor before calling
WebFrame::createWithCoreMainFrame so the call to create the FrameView
for the empty page in transitionToCommittedForNewPage() gets
the correct color from WebPage.
2019-04-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, fix the build with recent SDKs.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::WKWebViewState::store):
2019-04-16 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244321.
https://bugs.webkit.org/show_bug.cgi?id=196968
Causing all WK2 Debug builds to exit early after Assertion
failures. (Requested by ShawnRoberts on #webkit).
Reverted changeset:
"URL set by document.open() is not communicated to the
UIProcess"
https://bugs.webkit.org/show_bug.cgi?id=196941
https://trac.webkit.org/changeset/244321
2019-04-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: CRASH when reopening tab with docked inspector on crashed page
https://bugs.webkit.org/show_bug.cgi?id=196954
<rdar://problem/48716433>
Reviewed by Ryosuke Niwa.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2019-04-15 Chris Dumez <cdumez@apple.com>
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>
Reviewed by Geoffrey Garen.
Whenever the UIProcess is notified of an explicit document.open() call, update the
PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
knows it committed a load (i.e. It is no longer showing the initially empty document).
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didExplicitOpen):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-04-15 Alex Christensen <achristensen@webkit.org>
Stop using hyphenationFactor
https://bugs.webkit.org/show_bug.cgi?id=196949
<rdar://problem/49779594>
Reviewed by Geoffrey Garen.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
I added this use of hyphenationFactor in r241124 but the other changes in that revision make the use of hyphenationFactor redundant.
There is a reason to remove it in the radar.
2019-04-15 Alex Christensen <achristensen@webkit.org>
Forward declare WKWebView in _WKDiagnosticLoggingDelegate.h
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
This fixes builds where _WKDiagnosticLoggingDelegate.h is the only WebKit header included, such as my work on rdar://problem/35175989
2019-04-15 Jer Noble <jer.noble@apple.com>
Add a DiagnosticLogging method taking an arbitrary dictionary of values.
https://bugs.webkit.org/show_bug.cgi?id=196773
Reviewed by Alex Christensen.
In addition to adding the new logging delegate method (and piping everything into it),
add a new APIObject class to represent a signed integer.
* Shared/API/APINumber.h:
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/Cocoa/WKNSNumber.mm:
(-[WKNSNumber dealloc]):
(-[WKNSNumber objCType]):
(-[WKNSNumber getValue:]):
(-[WKNSNumber longLongValue]):
(-[WKNSNumber _apiObject]):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* UIProcess/API/APIDiagnosticLoggingClient.h:
* UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.mm:
(WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/WebPageDiagnosticLoggingClient.cpp:
(WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageDiagnosticLoggingClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2019-04-15 Dean Jackson <dino@apple.com>
Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>
Build fix for iOS platforms that don't have link preview.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
2019-04-15 Brent Fulgham <bfulgham@apple.com>
InjectedBundle parameters often need initialization function called before unarchiving
https://bugs.webkit.org/show_bug.cgi?id=189709
<rdar://problem/44573653>
Reviewed by Ryosuke Niwa.
Handle the case where the InjectedBundle parameters do not successfully decode because they contain
an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
after the bundle initialiation function runs, which gives the embedding program the opportunity to
register additional classes that are safe for serialization.
Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
to be serialized by the InjectedBundle.
Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
Revise 'initialize' to call this new method.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Use the new method.
(WebKit::InjectedBundle::decodeBundleParameters): Added.
(WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
'classesForCoder' method to unarchive the passed bundle parameters, rather than the
NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
NSDictionary object may itself hold other kinds of objects.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
(WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.
2019-04-15 Dean Jackson <dino@apple.com>
Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>
Reviewed by Antoine Quint.
A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.
Add a property to toggle if we should add a long press gesture
recognizer.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(shouldUsePreviewForLongPress):
(-[WKContentView shouldUsePreviewForLongPress]):
2019-04-15 Don Olmstead <don.olmstead@sony.com>
[CMake] WebCore derived sources should only be referenced inside WebCore
https://bugs.webkit.org/show_bug.cgi?id=196904
Reviewed by Konstantin Tokarev.
Remove reference to DERIVED_SOURCES_WEBCORE_DIR in PlatformMac.cmake.
* PlatformMac.cmake:
2019-04-15 Zalan Bujtas <zalan@apple.com>
DrawingArea should only capture painting related milestones
https://bugs.webkit.org/show_bug.cgi?id=196926
<rdar://problem/48003845>
Reviewed by Tim Horton.
While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
(WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::addMilestonesToDispatch):
(WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
(WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
2019-04-15 John Wilander <wilander@apple.com>
Send delayed Ad Click Attribution conversion requests to the click source
https://bugs.webkit.org/show_bug.cgi?id=196838
<rdar://problem/47650157>
Reviewed by Chris Dumez and Youenn Fablet.
This patch schedules a conversion request with appropriate data going to the
click source as a result of an ad click conversion.
WebKit::AdClickAttributionManager makes use of existing WebKit::PingLoad
infrastructure to make the request. This will probably be reworked into a
dedicated load class further on.
New test infrastructure allows for an override of both the conversion URL
and the 24-48 hour timer.
* NetworkProcess/AdClickAttributionManager.cpp: Added.
(WebKit::AdClickAttributionManager::ensureDestinationMapForSource):
(WebKit::AdClickAttributionManager::store):
(WebKit::AdClickAttributionManager::startTimer):
Convenience function to support test override.
(WebKit::AdClickAttributionManager::convert):
This function now sets the timer.
(WebKit::AdClickAttributionManager::fireConversionRequest):
Fire an individual request.
(WebKit::AdClickAttributionManager::firePendingConversionRequests):
This is the timer function that iterates over all pending attributions.
(WebKit::AdClickAttributionManager::clear):
Now clears the two new test settings members.
(WebKit::AdClickAttributionManager::toString const):
* NetworkProcess/AdClickAttributionManager.h: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.h.
(WebKit::AdClickAttributionManager::AdClickAttributionManager):
(WebKit::AdClickAttributionManager::setPingLoadFunction):
(WebKit::AdClickAttributionManager::setOverrideTimerForTesting):
(WebKit::AdClickAttributionManager::setConversionURLForTesting):
* NetworkProcess/NetworkAdClickAttribution.cpp: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.cpp.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::storeAdClickAttribution):
(WebKit::NetworkProcess::dumpAdClickAttribution):
(WebKit::NetworkProcess::clearAdClickAttribution):
(WebKit::NetworkProcess::setAdClickAttributionOverrideTimerForTesting):
(WebKit::NetworkProcess::setAdClickAttributionConversionURLForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::setAdClickAttributionOverrideTimerForTesting):
(WebKit::NetworkSession::setAdClickAttributionConversionURLForTesting):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::m_blobFiles):
(WebKit::PingLoad::initialize):
The PingLoad constructor is now split in two to allow for construction
without a WebKit::NetworkConnectionToWebProcess object. The body of
the constructor was moved into the new initialize() function which is
shared between constructors.
* NetworkProcess/PingLoad.h:
* Sources.txt:
Removed NetworkProcess/NetworkAdClickAttribution.cpp and added
NetworkProcess/NetworkAdClickAttribution.cpp.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetAdClickAttributionOverrideTimerForTesting):
(WKPageSetAdClickAttributionConversionURLForTesting):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::dumpAdClickAttribution): Deleted.
(WebKit::NetworkProcessProxy::clearAdClickAttribution): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dumpAdClickAttribution):
(WebKit::WebPageProxy::clearAdClickAttribution):
(WebKit::WebPageProxy::setAdClickAttributionOverrideTimerForTesting):
(WebKit::WebPageProxy::setAdClickAttributionConversionURLForTesting):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::dumpAdClickAttribution): Deleted.
(WebKit::WebProcessPool::clearAdClickAttribution): Deleted.
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:
2019-04-15 Devin Rousso <drousso@apple.com>
WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
https://bugs.webkit.org/show_bug.cgi?id=196872
<rdar://problem/49233240>
Reviewed by Joseph Pecoraro.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
Rather than try to "force" the cookie to be set on the current active URL, use the cookie
itself to figure out which domain it should be set on.
2019-04-15 Philippe Normand <pnormand@igalia.com>
[GTK][WPE] Add enable-media websetting
https://bugs.webkit.org/show_bug.cgi?id=196863
Reviewed by Michael Catanzaro.
It can be useful for headless browsers, for instance. The setting is enabled by default.
* Shared/WebPreferences.yaml:
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_media):
(webkit_settings_set_enable_media):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
2019-04-14 Rob Buis <rbuis@igalia.com>
Link prefetch not useful for top-level navigation
https://bugs.webkit.org/show_bug.cgi?id=195623
Reviewed by Youenn Fablet.
Cache cross-domain top-level prefetches in a dedicated cache. When a navigation
to the same url is done within a threshold (5 seconds), reuse the
prefetch cache entry, move it to the disk cache and navigate to
the url, meaning no extra network trip is needed. When not used within
the threshold period, the prefetch entry will be erased using a timer.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::prefetchCache):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/PrefetchCache.cpp: Added.
(WebKit::PrefetchCache::Entry::Entry):
(WebKit::PrefetchCache::PrefetchCache):
(WebKit::PrefetchCache::~PrefetchCache):
(WebKit::PrefetchCache::clear):
(WebKit::PrefetchCache::take):
(WebKit::PrefetchCache::store):
(WebKit::PrefetchCache::sessionPrefetchMap const):
(WebKit::PrefetchCache::clearExpiredEntries):
* NetworkProcess/cache/PrefetchCache.h: Added.
(WebKit::PrefetchCache::Entry::response const):
(WebKit::PrefetchCache::Entry::releaseBuffer):
* Shared/WebPreferences.yaml:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-04-14 Andy Estes <aestes@apple.com>
[Cocoa] WKCustomProtocolLoader should store a WeakPtr to its LegacyCustomProtocolManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=196893
<rdar://problem/48318983>
Reviewed by Anders Carlsson.
In addition to manually invalidating each WKCustomProtocolLoader's _customProtocolManagerProxy
pointer when the LegacyCustomProtocolManagerClient is invalidated, use a WeakPtr in case the
LegacyCustomProtocolManagerProxy is ever destroyed without first invalidating the client.
Also add null pointer checks to NSURLConnectionDelegate methods, which might be called after
the LegacyCustomProtocolManagerProxy has been destroyed.
* UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
(-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader cancel]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::LegacyCustomProtocolManagerClient::startLoading):
(WebKit::LegacyCustomProtocolManagerClient::invalidate):
(-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Deleted.
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
2019-04-14 Don Olmstead <don.olmstead@sony.com>
[CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=196742
Reviewed by Konstantin Tokarev.
Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
* CMakeLists.txt:
* PlatformWin.cmake:
Remove use of DERIVED_SOURCES_JAVASCRIPTCORE_DIR.
2019-04-13 Chris Dumez <cdumez@apple.com>
[ Mac Debug ] TestWebKitAPI.ProcessSwap.ReuseSuspendedProcessForRegularNavigationRetainBundlePage is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196548
<rdar://problem/49567254>
Reviewed by Darin Adler.
Update ProvisionalPageProxy methods to more consistently ignore unexpected IPC from the process. Previously,
some of the methods were doing this, but some other like didFailProvisionalLoadForFrame() weren't and this
was leading to this flaky crash. The issue is that if we do the load in an existing process that was recently
doing, there may be leftover IPC for the same pageID and this IPC gets received by the ProvisionalPageProxy
even though it is from a previous navigation. For this reason, the ProvisionalPageProxy should ignore all
incoming IPC that is not for its associated navigation.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didPerformClientRedirect):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
(WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
(WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::didPerformServerRedirect):
(WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
2019-04-13 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, try to fix the internal build after r244239
Force the bots to regenerate WKWebpagePreferences.h by touching the file. Adds a `Foundation/Foundation.h`
import that was missing anyways.
* UIProcess/API/Cocoa/WKWebpagePreferences.h:
2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com>
Enable modern compatibility mode by default in WKWebView on some devices
https://bugs.webkit.org/show_bug.cgi?id=196883
<rdar://problem/49864527>
Reviewed by Tim Horton.
Make some minor adjustments to new API.
* Shared/WebCompatibilityMode.h:
Rename WebCompatibilityMode::Default to WebCompatibilityMode::Recommended.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
Now that the role of the UseModernCompatibilityModeByDefault debug preference is limited to bypassing linked-on-
or-after and app bundle compatibility hacks, we no longer make this default to true in iOSMac.
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
Rename the withPreferences: label to just preferences:.
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/ios/WebPageProxyIOS.mm:
2019-04-12 Brian Burg <bburg@apple.com>
WebDriver: fix typo in EnterFullscreen.js in error-handling code
https://bugs.webkit.org/show_bug.cgi?id=196882
<rdar://problem/49867122>
Reviewed by Devin Rousso.
* UIProcess/Automation/atoms/EnterFullscreen.js:
(enterFullscreen):
2019-04-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed fix for non-unified build.
* Shared/PrintInfo.cpp:
Add missing include from r244202.
2019-04-12 Saam barati <sbarati@apple.com>
Sometimes we need to user fewer CPUs in our threading calculations
https://bugs.webkit.org/show_bug.cgi?id=196794
<rdar://problem/49389497>
Reviewed by Yusuke Suzuki.
* WebProcess/com.apple.WebProcess.sb.in:
2019-04-12 Devin Rousso <drousso@apple.com>
WebDriver: evaluating javascript shouldn't fail if a dialog is shown
https://bugs.webkit.org/show_bug.cgi?id=196847
<rdar://problem/49609396>
Reviewed by Brian Burg.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog):
2019-04-12 Ross Kirsling <ross.kirsling@sony.com>
WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=196845
Reviewed by Ryosuke Niwa.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
* NetworkProcess/NetworkDataTask.cpp:
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
* NetworkProcess/NetworkHTTPSUpgradeChecker.h: Include wtf/Forward.h for String and CompletionHandler fwd decls.
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkResourceLoadMap.cpp:
* NetworkProcess/NetworkResourceLoadMap.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.h:
* Shared/WebCompiledContentRuleListData.cpp:
* Shared/gtk/WebEventFactory.cpp:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/Downloads/DownloadProxyMap.cpp:
* UIProcess/InspectorTargetProxy.cpp:
* UIProcess/PageClient.h:
* UIProcess/ProcessAssertion.cpp:
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageInspectorTargetAgent.h:
* UIProcess/geoclue/GeoclueGeolocationProvider.cpp:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetDatabaseQuota):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
Add missing includes / forward declarations to address compiler errors on GTK / WinCairo.
2019-04-12 Eric Carlson <eric.carlson@apple.com>
Update AudioSession route sharing policy
https://bugs.webkit.org/show_bug.cgi?id=196776
<rdar://problem/46501611>
Reviewed by Jer Noble.
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]):
2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com>
WebsitePolicies doesn't copy its media source policy in WebsitePolicies::copy
https://bugs.webkit.org/show_bug.cgi?id=196862
Reviewed by Darin Adler.
Add a missing bit of code to copy m_mediaSourcePolicy over when making a copy of WebsitePolicies. This doesn't
have any observable effect, since m_mediaSourcePolicy isn't currently exposed as SPI on WKWebpagePreferences.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
2019-04-12 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Make -webkit-overflow-scrolling be a no-op
https://bugs.webkit.org/show_bug.cgi?id=196803
rdar://problem/49078202
Reviewed by Antti Koivisto.
Flip LegacyOverflowScrollingTouchEnabled to false.
* Shared/WebPreferences.yaml:
2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Software keyboard is shown too frequently on some websites
https://bugs.webkit.org/show_bug.cgi?id=195856
<rdar://problem/49191395>
Reviewed by Darin Adler.
On some websites, hidden editable elements are very frequently focused upon user interaction. Currently, this
causes the software keyboard to pop in and out unexpectedly; luckily, these same sites also apply
inputmode="none" to the hidden editable element, which ought to ensure that the software keyboard doesn't appear
when the element is focused.
However, since we disabled support for inputmode="none" in r240497, the software keyboard is no longer
suppressed, and becomes a big nuissance. r240497 removed support for this feature because, when using a hardware
keyboard, pressing the globe key no longer showed UI for switching languages. However, support for inputmode
none makes a much larger impact when a software keyboard is used (since the entire software keyboard animates in
and out), whereas a hardware keyboard only displays an input accessory view. For this reason, we can mitigate
this bug without reintroducing <rdar://problem/47406553> by re-enabling inputmode="none", but only when a
hardware keyboard is not attached.
* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):
Don't show the keyboard if inputmode is none and a hardware keyboard is not attached.
(-[WKContentView _hardwareKeyboardAvailabilityChanged]):
Reload input views if the inputmode is none to ensure that if a hardware keyboard is attached while editing an
element with inputmode="none", we'll show the input accessory view once again.
2019-04-12 Antoine Quint <graouts@apple.com>
Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196830
<rdar://problem/49124313>
Reviewed by Wenson Hsieh.
We add a new policy to determine whether simulated mouse events dispatch are allowed.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* Shared/WebsiteSimulatedMouseEventsDispatchPolicy.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:
2019-04-12 Chris Dumez <cdumez@apple.com>
[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196781
<rdar://problem/49789381>
Reviewed by Darin Adler.
When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::invalidate):
(WebKit::DownloadProxyMap::processDidClose): Deleted.
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):
2019-04-11 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] REGRESSION(r243860): Many tests failing
https://bugs.webkit.org/show_bug.cgi?id=196791
Reviewed by Joanmarie Diggs.
Calling updateAccessibilityTree() on document loaded was causing a re-layout because of the backing store update
that confused all those tests. We shouldn't need to update the accessibility tree on document load, it should
happen automatically when root object is attached/detached. This patch emits children-changed::add when the root
object wrapper is attached and children-changed::remove when the root object is detached. That way ATs are
notified of the changes in the accessibility tree.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Remove call to WebPage::updateAccessibilityTree().
* WebProcess/WebPage/WebPage.h: Remove updateAccessibilityTree().
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
(coreRootObjectWrapperDetachedCallback): Emit children-changed::remove.
(rootWebAreaWrapper): Helper to get the root WebArea wrapper.
(accessibilityRootObjectWrapper): Set the parent here when root object is created and emit children-changed::add.
(webkitWebPageAccessibilityObjectRefChild): Dot no set the parent here, it's now set when the root object is created.
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Remove webkitWebPageAccessibilityObjectRefresh().
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
2019-04-11 Megan Gardner <megan_gardner@apple.com>
Update 'Save Image' to more clear instructions
https://bugs.webkit.org/show_bug.cgi?id=196833
<rdar://problem/47446845>
Reviewed by Wenson Hsieh.
Just updating to a new string.
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
2019-04-11 Chris Dumez <cdumez@apple.com>
Unable to run system Safari with trunk WebKit
https://bugs.webkit.org/show_bug.cgi?id=196777
<rdar://problem/49784574>
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Add a linkedOnAfter check so that throwing exceptions when related web views use a different
data store only happens for apps rebuilt using recent SDK.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
- By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
be controlled by the caller.
- In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
0 value for sdkVersion.
2019-04-11 Zalan Bujtas <zalan@apple.com>
Add @page margin support
https://bugs.webkit.org/show_bug.cgi?id=196680
<rdar://problem/45217707>
Reviewed by Tim Horton.
* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode const):
(WebKit::PrintInfo::decode):
* Shared/PrintInfo.h:
* Shared/WebPreferences.yaml:
* Shared/gtk/PrintInfoGtk.cpp:
(WebKit::PrintInfo::PrintInfo):
* Shared/mac/PrintInfoMac.mm:
(WebKit::PrintInfo::PrintInfo):
* UIProcess/API/C/WKPage.cpp:
(WKPageComputePagesForPrinting):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageAtRuleSupportEnabled):
(WKPreferencesGetPageAtRuleSupportEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/GenericCallback.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::computedPagesCallback):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WKPrintingView.mm:
(pageDidComputePageRects):
(-[WKPrintingView _askPageToComputePageRects]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::computePagesForPrinting):
(WebKit::WebPage::computePagesForPrintingImpl):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
2019-04-11 Dean Jackson <dino@apple.com>
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
<rdar://problem/49822339>
Reviewed by Tim Horton.
Use the new helper to map MIME type to UTI.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
* UIProcess/ios/WKSystemPreviewView.mm:
(getUTIForSystemPreviewMIMEType):
2019-04-11 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION (r244182): RemoteLayerTreeDrawingArea::flushLayers() should not be reentrant
https://bugs.webkit.org/show_bug.cgi?id=196825
Reviewed by Simon Fraser.
Ensure the layer transactions IDs are sequential. So bail out of
RemoteLayerTreeDrawingArea::flushLayers() if reentrancy is detected.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2019-04-11 Wenson Hsieh <wenson_hsieh@apple.com>
Allow the MediaSource API to be enabled via website policy
https://bugs.webkit.org/show_bug.cgi?id=196429
<rdar://problem/48774333>
Reviewed by Tim Horton.
Adds support for using WebsitePolicies to determine whether to enable the MediaSource API.
* Shared/WebPreferences.yaml:
Disengage the mediaSourceEnabled internal preference from the corresponding WebCore setting; to ensure that
setting the preference to `true` still results in enabling the MediaSource API, we instead make it such that
turning on mediaSourceEnabled causes WebsitePolicies to set its WebsiteMediaSourcePolicy to Enable.
In the future, we should deprecate and remove this preference, in favor of simply setting preferred
compatibility mode on WKWebpagePreferences.
* Shared/WebPreferences.yaml:
* Shared/WebsiteMediaSourcePolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
Add plumbing for m_mediaSourcePolicy in the set of website policies.
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
Update the document loader with the given media source policy. There are two possibilities when applying the set
of policies to the document loader; either the document loader is already attached to a Frame, or the document
loader is yet to be attached to a Frame.
In the first case, we update Frame's settings on the spot, by calling the new applyPoliciesToSettings helper
method. In the second scenario, we stash the policy state on DocumentLoader; when the DocumentLoader is attached
to a Frame, we'll then update the Frame's settings using DocumentLoader's policy.
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
Move code that adjusts website policies after deciding policies for the navigation action from NavigationClient
::decidePolicyForNavigationAction to the completion handler of the policy listener. This allows us to respect
default website policies on the web view configuration, even when using the C API to set the navigation client,
and also allows us to have a single call site for adjustPoliciesForCompatibilityMode. This also enables our
layout tests to opt into modern compatibility mode by default, when specifying modern compatibility mode on
webpage preferences.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
2019-04-11 Antti Koivisto <antti@apple.com>
REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
https://bugs.webkit.org/show_bug.cgi?id=196813
<rdar://problem/49393264>
Reviewed by Simon Fraser.
No test, can't repro.
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
Null check the nodes.
2019-04-10 Chris Dumez <cdumez@apple.com>
Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
https://bugs.webkit.org/show_bug.cgi?id=196784
Reviewed by Antti Koivisto.
When we enter accelerated compositing mode in the new process, we supposed to *close* the last
SuspendedPageProxy, not destroy it. This was causing flakiness in the test because it was testing
that we were using the SuspendedPageProxy's process for a cross-site link navigation, which is
an optimization. This optimization was partly broken by r244144 as the SuspendedPageProxy would
not sometimes be gone by the time we need it.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
2019-04-10 Alex Christensen <achristensen@webkit.org>
WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
https://bugs.webkit.org/show_bug.cgi?id=196809
<rdar://49800762>
Reviewed by Brady Eidson.
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):
2019-04-10 Tim Horton <timothy_horton@apple.com>
REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
https://bugs.webkit.org/show_bug.cgi?id=196797
<rdar://problem/48484715>
Reviewed by Simon Fraser.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Validate the set of modifier keys pressed when handling a key event for scrolling:
Ignore key events with multiple modifier keys pressed.
Ignore key events with an invalid modifier key pressed for a given primary key.
2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
a single call to Page::updateRendering(). This new function implements
"Update the rendering" step of the HTML Event Loop specification
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::layerFlushTimerFired):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
-- Call Page::updateRendering() to make sure that "Update the rendering"
happens immediately before updating the page.
-- Move the call to RemoteLayerBackingStoreCollection::willFlushLayers()
to be exactly before flushing the layers. This fixes the assertion
ASSERT(m_inLayerFlush) which was firing when running a layout test.
RemoteLayerTreeDrawingArea::flushLayers() now can call itself through
TestRunner::notifyDone(). flushLayers() was calling willFlushLayers()
twice before calling didFlushLayers().
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layoutIfNeeded):
(WebKit::WebPage::updateRendering):
(WebKit::WebPage::willDisplayPage): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: save sheet should be anchored underneath the tab bar when detached
https://bugs.webkit.org/show_bug.cgi?id=196722
<rdar://problem/49613280>
Reviewed by Timothy Hatcher.
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::changeSheetRect): Added.
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::sheetRect const): Added.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::setSheetRect): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/wpe/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::changeSheetRect): Added.
* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
(WebKit::RemoteWebInspectorProxy::sheetRect const): Added.
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::setSheetRect): Added.
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(-[WKRemoteWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
2019-04-10 Andy Estes <aestes@apple.com>
[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=196785
<rdar://problem/48240051>
Reviewed by Tim Horton.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:mimeType:]):
2019-04-10 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r244146.
Caused a few DeviceOrientation API test failures on iOS
Reverted changeset:
"Unable to run system Safari with trunk WebKit"
https://bugs.webkit.org/show_bug.cgi?id=196777
https://trac.webkit.org/changeset/244146
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
https://bugs.webkit.org/show_bug.cgi?id=196725
<rdar://problem/49669810>
Reviewed by Timothy Hatcher.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::showMainResourceForFrame):
2019-04-10 Youenn Fablet <youenn@apple.com>
Clear Cache Storage structures before removing all related files
https://bugs.webkit.org/show_bug.cgi?id=196650
Reviewed by Alex Christensen.
Previously, we were clearing files in parallel to clearing the internal CacheStorage structures.
To make things more deterministic, clear files/folders directly
after CachesStorage structures have finished being cleared.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
2019-04-10 Alex Christensen <achristensen@webkit.org>
Add SPI WKNavigationResponse._downloadAttribute
https://bugs.webkit.org/show_bug.cgi?id=196755
<rdar://49587365>
Reviewed by Brady Eidson.
* UIProcess/API/APINavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-04-10 Youenn Fablet <youenn@apple.com>
SWClientConnection should not double hop to fire some events
https://bugs.webkit.org/show_bug.cgi?id=196735
Reviewed by Alex Christensen.
Removed unnecessary method.
* WebProcess/Storage/WebSWClientConnection.cpp:
* WebProcess/Storage/WebSWClientConnection.h:
2019-04-10 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix iokit-get-properties sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196782
<rdar://problem/49497720>
Reviewed by Brent Fulgham.
Add iokit properties to the WebContent sandbox on iOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-04-10 Tim Horton <timothy_horton@apple.com>
Add modern API for overriding the page's specified viewport configuration
https://bugs.webkit.org/show_bug.cgi?id=167734
<rdar://problem/30331795>
Reviewed by Simon Fraser.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Plumb overrideViewportArguments in WebPageCreationParameters, so that
if the process crashes (or swaps) they are maintained.
* UIProcess/API/Cocoa/WKWebView.mm:
(viewportArgumentsFromDictionary):
(-[WKWebView _overrideViewportWithArguments:]):
Add SPI to set override viewport arguments. Parse them into a ViewportArguments
object and use the existing (now improved) overrideViewportArguments mechanism
to take over the page's viewport arguments.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setOverrideViewportArguments):
* WebProcess/WebPage/WebPage.cpp:
Plumb overrideViewportArguments around more.
2019-04-10 Jiewen Tan <jiewen_tan@apple.com>
Add runJavaScriptInFrame for WebPageProxy/WebPage
https://bugs.webkit.org/show_bug.cgi?id=196750
<rdar://problem/49755738>
Reviewed by Youenn Fablet.
Tests of the new method will be covered by the internal counterpart.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadData):
* UIProcess/WebFrameProxy.h:
Add a comment.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
Merge the above two runJavaScriptInMainFrame*.
(WebKit::WebPageProxy::runJavaScriptInFrame):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataInFrame):
Add an assertion.
(WebKit::WebPage::runJavaScript):
(WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
(WebKit::WebPage::runJavaScriptInFrame):
(WebKit::WebPage::runJavaScriptInMainFrame): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-04-10 Chris Dumez <cdumez@apple.com>
Unable to run system Safari with trunk WebKit
https://bugs.webkit.org/show_bug.cgi?id=196777
<rdar://problem/49784574>
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Add a linkedOnAfter check so that throwing exceptions when related web views use a different
data store only happens for apps rebuilt using recent SDK.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
- By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
be controlled by the caller.
- In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
0 value for sdkVersion.
2019-04-10 Chris Dumez <cdumez@apple.com>
Regression(r240562) Audio sometimes keeps playing in previous process after a process-swap
https://bugs.webkit.org/show_bug.cgi?id=196774
<rdar://problem/49460572>
Reviewed by Alex Christensen.
r240562 added logic to prevent flashing on navigation. When we receive the DidFailToSuspendAfterProcessSwap
IPC from the previous process, we would delay closing the WebPage in that process until EnterAcceleratedCompositingMode
IPC is received from the new process. The issue is that this was racy as we would receive the EnterAcceleratedCompositingMode
IPC from the new process *before* receiving the DidFailToSuspendAfterProcessSwap IPC from the previous process, which which
case we would fail to close the WebPage and audio could keep playing.
To address the issue, the WebPageProxy keeps track of its last suspended page and notifies it whenever it receives the
EnterAcceleratedCompositingMode IPC. If the suspended page already received the DidFailToSuspendAfterProcessSwap IPC, it
will close the page. Otherwise, it will set a boolean data member indicating that we should not delay page closing when
the DidFailToSuspendAfterProcessSwap is eventually received.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
2019-04-10 Timothy Hatcher <timothy@apple.com>
WKScrollView background color does not match WKWebView before content is loaded.
https://bugs.webkit.org/show_bug.cgi?id=196745
rdar://problem/49750810
Reviewed by Megan Gardner.
* UIProcess/API/Cocoa/WKWebView.mm:
(scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
(-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
(-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
_contentView.backgroundColor and it has changed.
2019-04-10 Megan Gardner <megan_gardner@apple.com>
Fix text autoscrolling when typing in modern webkit
https://bugs.webkit.org/show_bug.cgi?id=196718
<rdar://problem/49225507>
Reviewed by Tim Horton.
For staging only. We need to turn off UIKit's scrolling behavior to land
the changes we are making. To keep from the build ever breaking,
I am temporarily circumventing the changes in UIKit. This will be removed
once the next UIKit submission happens.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]):
(-[WKContentView setUpTextSelectionAssistant]):
2019-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
[iOSMac] Opt into modern compatibility mode by default
https://bugs.webkit.org/show_bug.cgi?id=196763
<rdar://problem/49038732>
Reviewed by Tim Horton.
Achieve this by limiting legacy compatibility mode by default to non-iOSMac iOS only.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-04-10 Alex Christensen <achristensen@webkit.org>
RemoteObjectRegistry message receiver should be removed when WebPage::close is called instead of waiting until dealloc
https://bugs.webkit.org/show_bug.cgi?id=196744
<rdar://49415309>
Reviewed by Chris Dumez.
This is a similar problem to the one I fixed in r241306 so I piggy-backed on the same test.
When you do a cross site navigation but the previous page is in a suspended process then you navigate back,
you can get two WebPage objects in the same process with the same IDs. WebPage::close has been called
on the old one which is supposed to make it so all the message receivers associated with it have been removed
so we don't have any loss of communication, but we missed the RemoteObjectRegistry messages, which are owned
by the ObjC bundle object wrapping the WebPage (which can keep it alive if a strong reference to it is held).
To fix the assertion that happens in this case and the resulting communication breakage, teach the WebPage about
these messages so it can tear down the message receiver with the others it removes at close time.
* Shared/API/Cocoa/RemoteObjectRegistry.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController dealloc]):
(-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::addRemoteObjectRegistry):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPage.h:
2019-04-10 Chris Dumez <cdumez@apple.com>
Unreviewed, drop SuspendedPageProxy data member that is unused after r244075.
* UIProcess/SuspendedPageProxy.h:
2019-04-10 Antoine Quint <graouts@apple.com>
Enable Pointer Events on watchOS
https://bugs.webkit.org/show_bug.cgi?id=196771
<rdar://problem/49040909>
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
2019-04-10 Brady Eidson <beidson@apple.com>
Background tabs are not fully reactivated after a link is opened from an external application.
<rdar://problem/49533278> and https://bugs.webkit.org/show_bug.cgi?id=196705
Reviewed by Chris Dumez.
If an app unparents a WKWebView right after activation but before the "applicationWillEnterForeground" notification
is dispatched, then that WKWebView is in a broken state with a frozen layer tree.
The WKApplicationStateTrackingView logic needs to be a little more resilient.
* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]): When clearing the window, remember the current background state.
(-[WKApplicationStateTrackingView didMoveToWindow]): If our last observed background state doesn't match the current
background state then fake the relevant notification.
(-[WKApplicationStateTrackingView _applicationDidEnterBackground]): Remember that we've observed a backgrounding.
(-[WKApplicationStateTrackingView _applicationWillEnterForeground]): Remember that we've observed a foregrounding.
2019-04-10 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, build fix for r244097
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::resume):
Added guards for ENABLE(SERVICE_WORKER)
2019-04-09 Keith Rollin <krollin@apple.com>
Unreviewed build maintenance -- update .xcfilelists.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-04-09 Zalan Bujtas <zalan@apple.com>
[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
https://bugs.webkit.org/show_bug.cgi?id=196743
<rdar://problem/43897551>
Reviewed by Tim Horton.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setViewLayoutSize):
2019-04-09 Youenn Fablet <youenn@apple.com>
Close service worker database on network process suspension
https://bugs.webkit.org/show_bug.cgi?id=196623
<rdar://problem/48930869>
Reviewed by Alex Christensen.
Close service worker database when preparing to suspend.
On resume, push changes if any is needed.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::cancelPrepareToSuspend):
(WebKit::NetworkProcess::processDidResume):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _sendNetworkProcessWillSuspendImminently]):
(-[WKProcessPool _sendNetworkProcessDidResume]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently):
(WebKit::WebProcessPool::sendNetworkProcessDidResume):
* UIProcess/WebProcessPool.h:
2019-04-09 Daniel Bates <dabates@apple.com>
[iPad] Should open popover when the spacebar is pressed
https://bugs.webkit.org/show_bug.cgi?id=196360
<rdar://problem/49389129>
Reviewed by Brent Fulgham.
Pressing the spacebar should open the popover for a focused popup button (e.g. <select>) on iOS
just like it does on the Mac.
For now, we keep the iPhone behavior of blurring the element when the Done button is pressed and
hence pressing spacebar does nothing (because there is no focused element).
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessoryOpen]): Added. Extracted the logic from -_elementDidFocus to scroll to
the focused element, update the accessory and then tell the accessory to begin editing.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Write in terms of -accessoryOpen.
* UIProcess/ios/forms/WKFormPeripheralBase.mm:
(-[WKFormPeripheralBase handleKeyEvent:]): Interpret the spacebar when the peripheral is closed (!_editing)
and call -accessoryOpen to ultimately call back to this peripheral to tell it to begin editing,
which will cause the popover to appear again.
2019-04-09 Chris Dumez <cdumez@apple.com>
Unreviewed, fix webkitpy failure after r244085.
Use a list instead of a set for header includes so that the order is
maintained.
* Scripts/webkit/messages.py:
2019-04-09 Andy Estes <aestes@apple.com>
[Apple Pay] Add release logging to PaymentCoordinator
https://bugs.webkit.org/show_bug.cgi?id=196738
Reviewed by Alex Christensen.
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::isAlwaysOnLoggingAllowed const):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
2019-04-09 Jer Noble <jer.noble@apple.com>
[Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
https://bugs.webkit.org/show_bug.cgi?id=196659
Reviewed by Chris Dumez.
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
* Platform/spi/ios/AssertionServicesSPI.h:
* Shared/Cocoa/ProcessTaskStateObserver.h: Added.
(WebKit::ProcessTaskStateObserver::setClient):
(WebKit::ProcessTaskStateObserver::client):
(WebKit::ProcessTaskStateObserver::taskState const):
* Shared/Cocoa/ProcessTaskStateObserver.mm: Added.
(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
(WebKit::toProcessTaskStateObserverTaskState):
(WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::setTaskState):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
* UIProcess/ProcessAssertion.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
* UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::shouldBeRunnable const):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::reasonForState):
(WebKit::toBKSProcessAssertionReason):
(WebKit::ProcessAssertion::ProcessAssertion):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::processTaskStateDidChange):
2019-04-09 Alex Christensen <achristensen@webkit.org>
Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
https://bugs.webkit.org/show_bug.cgi?id=196665
<rdar://45115669>
Reviewed by Geoff Garen.
It is insufficient to just not navigate the subframe. We must leave the page that contained it.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
2019-04-09 John Wilander <wilander@apple.com>
Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
https://bugs.webkit.org/show_bug.cgi?id=196558
<rdar://problem/47650245>
Reviewed by Youenn Fablet.
So called pixel requests have traditionally been used to send ad click
attribution data to click sources. The privacy implications of such
pixel requests are severe which is in part why browsers have started to
block cookies from being sent in such third-party requests.
To allow for a smooth transition to more privacy-friendly ad click
attribution, we should allow servers to make a redirect to
https://click-source.example/.well-known/ad-click-attribution/ to
trigger a so called conversion.
This patch checks for the well-known location in the path component of
the redirect URL. If the request indeed goes to the well-known location,
we parse the conversion data and send it to the storage in the network
session.
* NetworkProcess/NetworkAdClickAttribution.cpp:
(WebKit::NetworkAdClickAttribution::convert):
Reporting function.
* NetworkProcess/NetworkAdClickAttribution.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
Now checks for the well-known location through a call to
WebCore::AdClickAttribution::parseConversionRequest().
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::convertAdClickAttribution):
Piping to WebKit::NetworkAdClickAttribution::convert().
* NetworkProcess/NetworkSession.h:
2019-04-09 Chris Dumez <cdumez@apple.com>
[iOS] WebContent processes should be marked as "Foreground Running" when their view is visible
https://bugs.webkit.org/show_bug.cgi?id=196695
<rdar://problem/48073787>
Reviewed by Tim Horton.
In order for WebContent processes to get marked as "Foreground Running" when their view
is visible on iOS, we now construct a _UILayerHostView in the UIProcess and add it as
a subview of the WKContentView. The _UILayerHostView's visibility target is the
WebContent process currently associated with the view.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
(WebKit::PageClient::didCreateContextForVisibilityPropagation):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::contextIDForVisibilityPropagation):
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCreateContextForVisibilityPropagation):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView _setupVisibilityPropagationView]):
(-[WKContentView _processDidExit]):
(-[WKContentView _didRelaunchProcess]):
(-[WKContentView _processDidCreateContextForVisibilityPropagation]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2019-04-09 Sihui Liu <sihui_liu@apple.com>
Remove unnecessary network process assertion for IDB close
https://bugs.webkit.org/show_bug.cgi?id=196693
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createIDBServer):
(WebKit::NetworkProcess::notifyHoldingLockedFiles): Deleted.
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
2019-04-09 Chris Dumez <cdumez@apple.com>
Loads using loadHTMLString() cause flashing when process-swapping
https://bugs.webkit.org/show_bug.cgi?id=196714
<rdar://problem/49637354>
Reviewed by Antti Koivisto.
Our logic to decide if we should construct a SuspendedPageProxy on process-swap was assuming
a SuspendedPageProxy is only useful for PageCache and would therefore not create one if PageCache
is disabled or if there is no associated WebBackForwardListItem. However, constructing a
SuspendedPageProxy is also useful to prevent flashing when process-swapping as we need to keep
displaying the layer of the previous process until there is something meaningful to show in the
new process.
This patch makes it so that we now construct a SuspendedPageProxy on process-swap, even if
PageCache is disabled or if there is no associated WebBackForwardListItem. The process in
question will not be useful for PageCache but it will avoid flashing. The SuspendedPageProxy's
process may also get used for future navigations to the same site (as demonstrated by the
API test) which is beneficial for performance.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
2019-04-08 Don Olmstead <don.olmstead@sony.com>
[CMake][WinCairo] Separate copied headers into different directories
https://bugs.webkit.org/show_bug.cgi?id=196655
Reviewed by Michael Catanzaro.
* CMakeLists.txt:
* PlatformWin.cmake:
2019-04-08 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Do not allow starting selection drags when selection views are not visible
https://bugs.webkit.org/show_bug.cgi?id=196686
<rdar://problem/49399192>
Reviewed by Tim Horton.
Currently, on iOS, it's possible to start dragging selected text in a web view even if the selection itself is
not visible. This can happen if the user selects some text, focuses a native text field, and then long presses
the previously selected text. This is because the text is still selected in the document since we don't clear
the selection when resigning first responder on iOS, despite the fact that the native selection view is no
longer present.
To fix this, we add plumbing to specify the set of allowed drag source actions when requesting drag start; this
set of allowed drag source actions only includes DragSourceActionSelection if the selection view can be visible
(i.e. the content view is first responder, and isn't suppressing text interactions). We then update WebPage's
allowed drag source actions with this given set of actions, while sending "dragstart" to the page.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
Only bail out of text selection in text that is already selected if the web view allows dragging text selections
(i.e. the web view is first responder, and is not suppressing text interactions).
(-[WKContentView _allowedDragSourceActions]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
Pass the set of allowed drag source actions when requesting a drag start or adding items to an existing session.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
Plumb the allowed drag source actions from the UI process (WKContentView) over to the web process (WebPage).
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::dragSourceActionMaskForPoint):
Instead of always returning Any, consult WebPage's allowed drag source actions.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::allowedDragSourceActions const):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDragStart):
(WebKit::WebPage::requestAdditionalItemsForDragSession):
Set WebPage's allowed drag source actions to the given set of actions when sending a drag start to the page.
2019-04-08 Justin Fan <justin_fan@apple.com>
[Web GPU] Fix Web GPU experimental feature on iOS
https://bugs.webkit.org/show_bug.cgi?id=196632
Reviewed by Myles C. Maxfield.
Add feature conditionals for iOS 11.
Properly make Web GPU available on iOS 11+.
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig:
2019-04-08 Alex Christensen <achristensen@webkit.org>
Fix selector name after r243834
https://bugs.webkit.org/show_bug.cgi?id=196549
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
I forgot the colon in the setter's name.
2019-04-08 Antti Koivisto <antti@apple.com>
Compute touch actions for touch point from remote layer tree regions
https://bugs.webkit.org/show_bug.cgi?id=196701
Reviewed by Simon Fraser.
Add a function for finding the right layer and getting the touch actions in UI process side.
The code is not used yet.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::touchActionsForPoint):
Use the same code as overlap hit testing for collecting the candidate layers for the touch point,
taking event regions into account.
Return the touch actions from the deepest event sensitive layer hit.
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
Modernize.
2019-04-08 Brent Fulgham <bfulgham@apple.com>
Make HSTS list handling more robust against unexpected content
https://bugs.webkit.org/show_bug.cgi?id=196552
<rdar://problem/43403817>
Reviewed by Chris Dumez.
Crash logs indicate we sometimes encounter null key values during processing.
This patch adds some debug assertions to catch this in test environments, and
allows the code to skip the bad entries if encountered.
It also avoids calling CFDictionaryApplyFunction when the HSTS policies returned
by _CFNetworkCopyHSTSPolicies is nullptr, which is a possible return value.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::filterPreloadHSTSEntry):
(WebKit::NetworkProcess::getHostNamesWithHSTSCache):
2019-04-05 Brian Burg <bburg@apple.com>
Web Automation: clean up some WebAutomationSession methods to use modern async IPC
https://bugs.webkit.org/show_bug.cgi?id=196168
Reviewed by Devin Rousso.
Modern WebKit IPC is capable of providing completion handlers and can track callback IDs.
So, most messages between WebAutomationSession and its proxy can use this facility and stop
keeping track of callback IDs manually. This makes most code easier to read on both the
sender and receiver side.
There are two cases that could not be converted:
- For evaluateJavaScript, we cannot use async IPC because WebAutomationSession expects to
be able to cancel all pending replies when a page navigates away, the web process crashes,
or when handling an alert.
- For takeScreenshot, there is not currently support in the modern async IPC code paths for
sending the result back. ShareableBitmap and friends lack a modern decoder implementation.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::selectOptionElement):
(WebKit::WebAutomationSession::getAllCookies):
(WebKit::WebAutomationSession::deleteSingleCookie):
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
(WebKit::WebAutomationSession::didResolveChildFrame): Deleted.
(WebKit::WebAutomationSession::didResolveParentFrame): Deleted.
(WebKit::WebAutomationSession::didComputeElementLayout): Deleted.
(WebKit::WebAutomationSession::didSelectOptionElement): Deleted.
(WebKit::WebAutomationSession::didGetCookiesForFrame): Deleted.
(WebKit::WebAutomationSession::didDeleteCookie): Deleted.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
(WebKit::WebAutomationSessionProxy::selectOptionElement):
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
2019-04-08 Alex Christensen <achristensen@webkit.org>
REGRESSION(236463) DownloadManager can call a null CompletionHandler
https://bugs.webkit.org/show_bug.cgi?id=196414
<rdar://problem/48389434>
Reviewed by Geoff Garen.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
DownloadManager::continueDecidePendingDownloadDestination is being called when there is no completion handler.
r236463 introduced an unchecked code path that can allow this to happen.
2019-04-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243956.
https://bugs.webkit.org/show_bug.cgi?id=196688
Broke API Test SafeBrowsing.WKWebViewGoBackIFrame (Requested
by aakashjain on #webkit).
Reverted changeset:
"Clicking "Go Back" from a safe browsing warning from an
iframe should navigate the WKWebView back to the previous
page"
https://bugs.webkit.org/show_bug.cgi?id=196665
https://trac.webkit.org/changeset/243956
2019-04-07 Geoffrey Garen <ggaren@apple.com>
Remove stray byte added by r241131
https://bugs.webkit.org/show_bug.cgi?id=196682
Reviewed by Alexey Proskuryakov.
Sublime Text thinks WKWebView.mm is binary instead of text.
According to online documentation and bisecting, this is because r241131
introduced a stray byte (probably a null byte?) into the file.
I fixed this with Cmd-C Cmd-V.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
2019-04-06 Wenson Hsieh <wenson_hsieh@apple.com>
Hide next and previous form control buttons when WKWebView is editable
https://bugs.webkit.org/show_bug.cgi?id=196672
<rdar://problem/35625321>
Reviewed by Tim Horton.
Adopt new UIKit SPI to hide or show next and previous controls in the form accessory view when changing
editability.
Test: KeyboardInputTests.FormNavigationAssistantBarButtonItems
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setEditable:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateAccessory]):
(-[WKContentView _didChangeWebViewEditability]):
2019-04-06 Antti Koivisto <antti@apple.com>
Combine event and touch action regions into a single class
https://bugs.webkit.org/show_bug.cgi?id=196644
<rdar://problem/49643614>
Reviewed by Darin Adler.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::eventRegion const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setEventRegion):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setEventRegion):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2019-04-05 Yongjun Zhang <yongjun_zhang@apple.com>
We should pass minimumEffectiveDeviceWidth to web process on new page creation.
https://bugs.webkit.org/show_bug.cgi?id=196077
<rdar://problem/49108202>
Reviewed by Chris Dumez.
When a new web view is created, it is possible we don't have the web content process till a load
is requested. This patch stashes minimumEffectiveDeviceWidth in WebPageProxy.cpp and passes that
value down to web process via WebPageCreationParameters when a new process is created, just like
we did for other values like viewportConfigurationLayoutSizeScaleFactor or viewportConfigurationViewLayoutSize.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Encode viewportConfigurationMinimumEffectiveDeviceWidth value.
(WebKit::WebPageCreationParameters::decode): Decode viewportConfigurationMinimumEffectiveDeviceWidth value.
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm: Now that we stash the minimumEffectiveDeviceWidth value in WebPageProxy, we
don't need the iVar in WKWebView any more.
(-[WKWebView _dispatchSetViewLayoutSize:]): Use _page->minimumEffectiveDeviceWidth().
(-[WKWebView _setViewScale:]): Ditto.
(-[WKWebView _setMinimumEffectiveDeviceWidth:]): Ditto.
(-[WKWebView _minimumEffectiveDeviceWidth]): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Also add viewportConfigurationMinimumEffectiveDeviceWidth to
web process creation parameter.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::minimumEffectiveDeviceWidth const): Returns m_viewportConfigurationMinimumEffectiveDeviceWidth.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Pass parameters.viewportConfigurationMinimumEffectiveDeviceWidth
to web process.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Take viewportConfigurationMinimumEffectiveDeviceWidth value from the parameter and
set that to viewport configuration.
2019-04-05 Jer Noble <jer.noble@apple.com>
[Cocoa] Deactivate the audio session before the WebProcess suspends.
https://bugs.webkit.org/show_bug.cgi?id=196658
Reviewed by Eric Carlson.
Notify the PlatformMediaSessionManager when the process suspends or resumes.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
2019-04-05 Sihui Liu <sihui_liu@apple.com>
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>
Reviewed by Chris Dumez.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
2019-04-05 Alex Christensen <achristensen@webkit.org>
Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
https://bugs.webkit.org/show_bug.cgi?id=196665
<rdar://45115669>
Reviewed by Geoff Garen.
It is insufficient to just not navigate the subframe. We must leave the page that contained it.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
2019-04-05 Alex Christensen <achristensen@webkit.org>
Undeprecate WKNavigationData
https://bugs.webkit.org/show_bug.cgi?id=196559
<rdar://44927425>
Reviewed by Geoff Garen.
* UIProcess/API/Cocoa/WKNavigationData.h:
It is used to communicate information from FrameLoaderClient::updateGlobalHistory() to the application.
This use in WKBrowsingContextHistoryDelegate is definitely still deprecated, but its use in
WKHistoryDelegatePrivate does not have an adequate replacement yet, so it must remain undeprecated SPI.
2019-04-05 Sihui Liu <sihui_liu@apple.com>
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>
Reviewed by Chris Dumez.
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processWillSuspendImminently):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
2019-04-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243833.
https://bugs.webkit.org/show_bug.cgi?id=196645
This change breaks build of WPE and GTK ports (Requested by
annulen on #webkit).
Reverted changeset:
"[CMake][WTF] Mirror XCode header directories"
https://bugs.webkit.org/show_bug.cgi?id=191662
https://trac.webkit.org/changeset/243833
2019-04-05 David Kilzer <ddkilzer@apple.com>
REGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode project
<https://bugs.webkit.org/show_bug.cgi?id=193951>
<rdar://problem/47621366>
Fixes the following build warnings:
Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installhdrs/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installapi/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_install/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
* WebKit.xcodeproj/project.pbxproj: Remove duplicate entry for
_WKInspectorWindow.h. In r240685, a second Headers entry was
added, but the first one was never removed.
2019-04-05 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
https://bugs.webkit.org/show_bug.cgi?id=196593
<rdar://problem/49599153>
Reviewed by Michael Catanzaro.
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
(accessibilityRootObjectWrapper): Cast wrapper() as AtkObject.
2019-04-04 Simon Fraser <simon.fraser@apple.com>
Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
https://bugs.webkit.org/show_bug.cgi?id=196635
Reviewed by Antti Koivisto.
Remove WKBundleSetAsyncFrameScrollingEnabled().
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAsyncFrameScrollingEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2019-04-04 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
https://bugs.webkit.org/show_bug.cgi?id=195584
Reviewed by Zalan Bujtas.
Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.
AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
a delegate, and that will take care of the requestedScrollPosition update.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2019-04-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r243888.
Introduced layout test crashes.
Reverted changeset:
"[macOS][iOS] Add filter to syscall sandbox rule"
https://bugs.webkit.org/show_bug.cgi?id=196613
https://trac.webkit.org/changeset/243888
2019-04-04 Youenn Fablet <youenn@apple.com>
Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
https://bugs.webkit.org/show_bug.cgi?id=196543
Reviewed by Alex Christensen.
Renamed methods used to set cache storage quota to be storage generic
since they will apply to all storage.
Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
to NetworkProcess (start-up time and new WebsiteDataStore time).
Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::initializeStorageQuota):
(WebKit::NetworkProcess::setCacheStorageParameters):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetPerOriginStorageQuota):
(WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _perOriginStorageQuota]):
(-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
(-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
(-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::perOriginStorageQuota const):
(WebKit::WebsiteDataStore::setPerOriginStorageQuota):
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
(WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
(WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
(WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.
2019-04-04 Wenson Hsieh <wenson_hsieh@apple.com>
Changing default website policies shouldn't change default website policies in subsequent navigations
https://bugs.webkit.org/show_bug.cgi?id=196562
<rdar://problem/49573377>
Reviewed by Tim Horton.
Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
default policies to change in subsequent navigations. Among other things, this prevents clients from passing
a modified version of the default website policies into the decision handler without impacting future
navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
of the default website policies to the navigation delegate when deciding navigation policies.
Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
Add a helper method to copy a set of website policies.
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2019-04-04 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wreturn-type warning
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):
2019-04-04 Per Arne Vollan <pvollan@apple.com>
[macOS] Fix sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196616
<rdar://problem/49498040>
Reviewed by Brent Fulgham.
Fix some observed sandbox violations in the WebContent process on macOS.
* WebProcess/com.apple.WebProcess.sb.in:
2019-04-04 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Host should be able to mute screen capture and camera/microphone independently
https://bugs.webkit.org/show_bug.cgi?id=196555
<rdar://problem/47303865>
Reviewed by Youenn Fablet.
* UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setPageMuted:]):
(-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
(-[WKWebView _muteMediaCapture]): Deleted, it was unused.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
a log comment typo.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
(WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
(WebKit::WebPageProxy::setMuted): Ditto.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.
2019-04-04 Per Arne Vollan <pvollan@apple.com>
[macOS][iOS] Add filter to syscall sandbox rule
https://bugs.webkit.org/show_bug.cgi?id=196613
<rdar://problem/49531420>
Reviewed by Brent Fulgham.
This will restrict the existing sandbox rule for the syscall.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2019-04-04 Youenn Fablet <youenn@apple.com>
Service Worker Process does not have the right domain name
https://bugs.webkit.org/show_bug.cgi?id=196585
Reviewed by Chris Dumez.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
Updated extraInitializationData to go from "security-origin" to "registrable-domain".
2019-04-04 Chris Dumez <cdumez@apple.com>
Temporarily disable delayed WebProcess launch on iOS to address PLT regression
https://bugs.webkit.org/show_bug.cgi?id=196604
<rdar://problem/49074131>
Reviewed by Geoffrey Garen.
Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
is while I figure out how to enable this on iOS without regressed PLT.
* UIProcess/WebProcessPool.h:
2019-04-04 Miguel Gomez <magomez@igalia.com>
[CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
https://bugs.webkit.org/show_bug.cgi?id=188839
Reviewed by Žan Doberšek.
Even if a platform layer has changed, don't wait for a main thread callback to finish the
CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::stopUpdates):
(WebKit::CompositingRunLoop::updateCompleted):
(WebKit::CompositingRunLoop::updateTimerFired):
(WebKit::CompositingRunLoop::compositionCompleted): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
(WebKit::ThreadedCompositor::displayRefreshMonitor):
(WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Cleanup WebPageAccessibilityObjectAtk
https://bugs.webkit.org/show_bug.cgi?id=196537
Reviewed by Michael Catanzaro.
Several changes and cleanups:
- Add WebKit prefix so that style checker doesn't complain about GObject conventions.
- Rename the header to remove the Atk prefix to match the cpp file and class name.
- Use pragma once.
- Use nullptr instead of 0.
- Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
- Return generic AtkObject* from constructor.
* SourcesGTK.txt:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
(accessibilityRootObjectWrapper):
(webkitWebPageAccessibilityObjectInitialize):
(webkitWebPageAccessibilityObjectGetIndexInParent):
(webkitWebPageAccessibilityObjectGetNChildren):
(webkitWebPageAccessibilityObjectRefChild):
(webkit_web_page_accessibility_object_class_init):
(webkitWebPageAccessibilityObjectNew):
(webkitWebPageAccessibilityObjectRefresh):
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
* WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::updateAccessibilityTree):
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
https://bugs.webkit.org/show_bug.cgi?id=196535
Reviewed by Michael Catanzaro.
This way the properties are not cached. Right now, if number of children is queried before the socket is
embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
(webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Embed the AtkSocket as soon as we receive the plug ID
https://bugs.webkit.org/show_bug.cgi?id=196534
Reviewed by Michael Catanzaro.
We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
can simply embed the socket when the plug ID is received.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseGetAccessible):
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree):
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
https://bugs.webkit.org/show_bug.cgi?id=193914
Reviewed by Michael Catanzaro.
Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
root accessibility object wrapper.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
2019-04-03 Simon Fraser <simon.fraser@apple.com>
Simplify some "programmaticScroll" code paths
https://bugs.webkit.org/show_bug.cgi?id=196589
Reviewed by Zalan Bujtas.
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
2019-04-03 Chris Dumez <cdumez@apple.com>
The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
https://bugs.webkit.org/show_bug.cgi?id=196588
<rdar://problem/49365787>
Reviewed by Ryosuke Niwa.
The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
This can lead to returning stale frames to the client if it asks for those.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
2019-04-03 Simon Fraser <simon.fraser@apple.com>
Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
https://bugs.webkit.org/show_bug.cgi?id=196587
Reviewed by Zalan Bujtas.
This argument was unused.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestScroll):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestScroll):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestScroll):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestScroll):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::requestScroll):
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestScroll):
* UIProcess/win/PageClientImpl.h:
2019-04-03 Myles C. Maxfield <mmaxfield@apple.com>
-apple-trailing-word is needed for browser detection
https://bugs.webkit.org/show_bug.cgi?id=196575
Unreviewed.
* Configurations/FeatureDefines.xcconfig:
2019-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Add a WebKit internal feature flag to always enable modern compatibility mode by default
https://bugs.webkit.org/show_bug.cgi?id=196526
<rdar://problem/49532923>
Reviewed by Tim Horton.
Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
enabled for all apps on the system.
* Shared/WebPreferences.yaml:
2019-04-03 Alex Christensen <achristensen@webkit.org>
Fix internal build after r243829
https://bugs.webkit.org/show_bug.cgi?id=196549
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Some SDK's don't include this selector in the header.
Use NSSelectorFromString.
2019-04-03 Don Olmstead <don.olmstead@sony.com>
[CMake][WTF] Mirror XCode header directories
https://bugs.webkit.org/show_bug.cgi?id=191662
Reviewed by Konstantin Tokarev.
Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
builds.
* CMakeLists.txt:
2019-04-03 Alex Christensen <achristensen@webkit.org>
Add SPI to disable legacy TLS fallback
https://bugs.webkit.org/show_bug.cgi?id=196549
<rdar://44979744>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setAllowsTLSFallback:]):
(-[WKWebsiteDataStore _allowsTLSFallback]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
(WebKit::WebsiteDataStore::setAllowsTLSFallback):
(WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::allowsTLSFallback const):
(WebKit::WebsiteDataStore::networkingHasBegun):
(WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.
2019-04-03 Myles C. Maxfield <mmaxfield@apple.com>
Remove support for -apple-trailing-word
https://bugs.webkit.org/show_bug.cgi?id=196525
Reviewed by Zalan Bujtas.
This CSS property is nonstandard and not used.
* Configurations/FeatureDefines.xcconfig:
2019-04-03 Alex Christensen <achristensen@webkit.org>
Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
https://bugs.webkit.org/show_bug.cgi?id=196476
Reviewed by Chris Dumez.
Re-apply a change I reverted in r241754 now that it's safe to do so.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
2019-04-03 Daniel Bates <dabates@apple.com>
[iOS] Should be able to dismiss picker or popover using the keyboard
https://bugs.webkit.org/show_bug.cgi?id=196272
<rdar://problem/48943170>
Reviewed by Wenson Hsieh.
Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.
* SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
(-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
(-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
(-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
do not resign first responder status as the page activation state should not be changed.
(-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
respectively. If the input peripheral does not handle it then do what we do now.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
-isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
we are always editable because it is not possible to perform a selection operation when we have a popover open.
Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
* UIProcess/ios/forms/WKFormColorControl.h:
* UIProcess/ios/forms/WKFormColorControl.mm:
(-[WKColorPopover controlEndEditing]): Dismiss the popover.
(-[WKFormColorControl initWithView:]): Modified to call base class initializer.
(-[WKFormColorControl assistantView]): Deleted.
(-[WKFormColorControl beginEditing]): Deleted.
(-[WKFormColorControl endEditing]): Deleted.
* UIProcess/ios/forms/WKFormInputControl.h:
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl initWithView:]): Modified to call base class initializer.
(-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
(-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
(-[WKFormInputControl beginEditing]): Deleted.
(-[WKFormInputControl endEditing]): Deleted.
(-[WKFormInputControl assistantView]): Deleted.
* UIProcess/ios/forms/WKFormPeripheral.h:
* UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
* UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
(-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
(-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
(-[WKFormPeripheralBase endEditing]): Ditto.
(-[WKFormPeripheralBase assistantView]): Ditto.
(-[WKFormPeripheralBase control]): Return the control.
(-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
Command + .).
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
(-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
(-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
(-[WKFormSelectControl assistantView]): Deleted.
(-[WKFormSelectControl beginEditing]): Deleted.
(-[WKFormSelectControl endEditing]): Deleted.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover controlEndEditing]): Dismiss the popover.
* WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.
2019-04-03 Youenn Fablet <youenn@apple.com>
Resetting quota should take into account third party origins
https://bugs.webkit.org/show_bug.cgi?id=196462
Reviewed by Geoffrey Garen.
When clearing the storage quota, we were resetting it to the default value
without taking care of whether third party or not.
Updated the code to ensure that the default quota is computed based on the origin.
Updated existing test to cover this case.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::clearStorageQuota):
(WebKit::NetworkProcess::setCacheStorageParameters):
(WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
(WebKit::NetworkProcess::storageQuotaManager):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
(WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
(WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):
2019-04-03 Michael Catanzaro <mcatanzaro@igalia.com>
Get rid of HTMLInputElement::setEditingValue
https://bugs.webkit.org/show_bug.cgi?id=196402
Reviewed by Darin Adler.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_html_input_element_set_editing_value):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_set_editing_value):
2019-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Add a WebKit internal feature flag to always enable modern compatibility mode by default
https://bugs.webkit.org/show_bug.cgi?id=196526
<rdar://problem/49532923>
Reviewed by Antoine Quint.
* Shared/WebPreferences.yaml:
2019-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce and add plumbing for a website policy for meta viewport tag handling
https://bugs.webkit.org/show_bug.cgi?id=196285
Reviewed by Tim Horton.
Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
viewport tag and use native web page parameters instead of the default parameters.
* Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
Add additional plumbing for the policy flag.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration):
Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
Eventually, the policy should completely replace the former preference once no internal clients depend on it.
2019-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Add plumbing for a compatibility mode preference in WebKit
https://bugs.webkit.org/show_bug.cgi?id=196005
Reviewed by Tim Horton.
Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
(API::WebsitePolicies) for compatibility mode.
* Shared/WebCompatibilityMode.h: Added.
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit.xcodeproj/project.pbxproj:
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] Hidden pages are not suspended after a web view resize
https://bugs.webkit.org/show_bug.cgi?id=196487
Reviewed by Žan Doberšek.
When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
switching tabs. For that we need to resume painting but we are not suspending it again after the update.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
synchronous update if needed.
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
Web Inspector: [GTK] Copy copies to nowhere
https://bugs.webkit.org/show_bug.cgi?id=181228
Reviewed by Michael Catanzaro.
The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
the web process.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
(WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
* UIProcess/gtk/WebContextMenuProxyGtk.h:
2019-04-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
https://bugs.webkit.org/show_bug.cgi?id=196284
<rdar://problem/47228232>
Reviewed by Tim Horton.
Tests for both of these APIs will be added in a subsequent patch.
* Shared/API/Cocoa/WebKit.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::defaultWebsitePolicies const):
(API::PageConfiguration::setDefaultWebsitePolicies):
* UIProcess/API/APIPageConfiguration.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
navigation action.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration defaultWebpagePreferences]):
(-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
* UIProcess/API/Cocoa/WKWebpagePreferences.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
Invoke the new WKWebpagePreferences-based navigation delegate method.
* WebKit.xcodeproj/project.pbxproj:
* mac/postprocess-framework-headers.sh:
* mac/replace-webkit-additions-in-framework-headers.sh: Added.
Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
ensures headers attempting to include from WebKitAdditions have these additional statements removed.
2019-04-02 Geoffrey Garen <ggaren@apple.com>
Eliminate plugin sandbox exceptions
https://bugs.webkit.org/show_bug.cgi?id=196510
Reviewed by Chris Dumez.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeSandbox):
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
* UIProcess/Plugins/PluginInfoStore.h:
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::shouldUsePlugin):
(WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
2019-04-02 Alex Christensen <achristensen@webkit.org>
Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
https://bugs.webkit.org/show_bug.cgi?id=196503
Reviewed by Chris Dumez.
In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
has been called, we can still destroy a navigation when we are continuing a navigation in another process. To prevent this,
have the process not send the message when it knows the navigation is continuing in another process.
Also make the use of unchecked navigation pointers more robust by checking it for nullity.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
(WebKit::WebFrame::documentLoaderDetached):
* WebProcess/WebPage/WebFrame.h:
2019-04-02 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix iokit-get-properties sandbox violation in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=196500
<rdar://problem/49497788>
Reviewed by Brent Fulgham.
Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
'artwork-scale-factor' is causing sandbox violations.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-04-02 Chris Dumez <cdumez@apple.com>
[WK2] Add support for Window's beforeprint / afterprint events
https://bugs.webkit.org/show_bug.cgi?id=196478
Reviewed by Alex Christensen.
Add support for Window's beforeprint / afterprint events as per:
- https://html.spec.whatwg.org/#dom-print
Blink and Gecko already support this.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::endPrinting):
2019-04-02 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
https://bugs.webkit.org/show_bug.cgi?id=196496
<rdar://problem/49521634>
Reviewed by Chris Dumez.
r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
-decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
Objective-C object (which is now WKWebpagePreferences, after my change).
To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
handler.
Tests: WebKit.WebsitePoliciesWithBridgingCast
WebKit.WebsitePoliciesWithUnexpectedType
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2019-04-01 Chris Dumez <cdumez@apple.com>
Unreviewed, drop debug logging landed as part of r242903 by mistake.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-04-01 Remy Demarest <rdemarest@apple.com>
Add SPI to give injected bundles access to displayed PDFDocuments
https://bugs.webkit.org/show_bug.cgi?id=196471
<rdar://problem/48080768>
Reviewed by Tim Horton.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
(WKBundlePageGetPDFDocumentInFrame):
2019-04-01 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit2] Introduce a public version of WKWebsitePolicies
https://bugs.webkit.org/show_bug.cgi?id=195989
<rdar://problem/47228232>
Reviewed by Tim Horton.
Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
_WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.
No change in behavior.
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
Wrap API::WebsitePolicies with WKWebpagePreferences.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateWebsitePolicies:]):
* UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
* UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.
Introduce WKWebpagePreferences.
(+[WKWebpagePreferences defaultPreferences]):
(-[WKWebpagePreferences dealloc]):
(-[WKWebpagePreferences init]):
(-[WKWebpagePreferences _setContentBlockersEnabled:]):
(-[WKWebpagePreferences _contentBlockersEnabled]):
(-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
(-[WKWebpagePreferences _allowedAutoplayQuirks]):
(-[WKWebpagePreferences _setAutoplayPolicy:]):
(-[WKWebpagePreferences _autoplayPolicy]):
(-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
(-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
(-[WKWebpagePreferences _setPopUpPolicy:]):
(-[WKWebpagePreferences _popUpPolicy]):
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
(-[WKWebpagePreferences _websiteDataStore]):
(-[WKWebpagePreferences _setWebsiteDataStore:]):
(-[WKWebpagePreferences _setCustomUserAgent:]):
(-[WKWebpagePreferences _customUserAgent]):
(-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
(-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
(-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
(-[WKWebpagePreferences _customNavigatorPlatform]):
(-[WKWebpagePreferences _apiObject]):
* UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.
Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
WKWebpagePreferences.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
WKWebpagePreferences.
(-[_WKWebsitePolicies init]):
(-[_WKWebsitePolicies webpagePreferences]):
(-[_WKWebsitePolicies setContentBlockersEnabled:]):
(-[_WKWebsitePolicies contentBlockersEnabled]):
(-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
(-[_WKWebsitePolicies allowedAutoplayQuirks]):
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):
(-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
(-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
(-[_WKWebsitePolicies setPopUpPolicy:]):
(-[_WKWebsitePolicies popUpPolicy]):
(-[_WKWebsitePolicies customHeaderFields]):
(-[_WKWebsitePolicies setCustomHeaderFields:]):
(-[_WKWebsitePolicies websiteDataStore]):
(-[_WKWebsitePolicies setWebsiteDataStore:]):
(-[_WKWebsitePolicies setCustomUserAgent:]):
(-[_WKWebsitePolicies customUserAgent]):
(-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
(-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
(-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
(-[_WKWebsitePolicies customNavigatorPlatform]):
(-[_WKWebsitePolicies description]):
(-[_WKWebsitePolicies _apiObject]):
(-[_WKWebsitePolicies dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* WebKit.xcodeproj/project.pbxproj:
2019-04-01 Wenson Hsieh <wenson_hsieh@apple.com>
Unable to copy and paste a PDF from Notes into Mail compose body
https://bugs.webkit.org/show_bug.cgi?id=196442
<rdar://problem/48573098>
Reviewed by Tim Horton.
Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.
This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
2019-04-01 Tim Horton <timothy_horton@apple.com>
Make UIWKDocumentContext rects per-character instead of per-word
https://bugs.webkit.org/show_bug.cgi?id=196459
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDocumentEditingContext):
Switch to CharacterIterator instead of TextIterator directly, to get
per-character rects as the API requests.
2019-04-01 Chris Dumez <cdumez@apple.com>
UIProcess crash when a prewarmed process is terminated
https://bugs.webkit.org/show_bug.cgi?id=196451
<rdar://problem/49245471>
Reviewed by Geoffrey Garen.
Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
true after r243384. For example, prewarmed WebContent processe do not get a data store
until they actually get used.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _prewarmedProcessIdentifier]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::networkProcessIdentifier):
(WebKit::WebProcessPool::prewarmedProcessIdentifier):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
* UIProcess/WebProcessProxy.h:
2019-04-01 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Add more websitedatastore directories to web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=196447
Reviewed by Michael Catanzaro.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
2019-04-01 Per Arne Vollan <pvollan@apple.com>
[macOS] Crash when loading Twitter with autoplay video enabled.
https://bugs.webkit.org/show_bug.cgi?id=196446
<rdar://problem/49060359>
Reviewed by Brent Fulgham.
This is caused by a syscall violation.
* WebProcess/com.apple.WebProcess.sb.in:
2019-04-01 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
https://bugs.webkit.org/show_bug.cgi?id=196297
Reviewed by Michael Catanzaro.
More information can be found here: https://www.exploit-db.com/exploits/46594
Note that this sandbox never made it into production so does not
warrant any CVE specific to WebKit.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::setupSeccomp):
2019-03-31 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Crash when changing inputmode for certain types of focusable elements
https://bugs.webkit.org/show_bug.cgi?id=196431
<rdar://problem/49454962>
Reviewed by Tim Horton.
The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
is only set for certain types of elements that require user input (e.g. text fields, editable content, select
menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
focused element doesn't fall into one of the aforementioned categories.
To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
element. See below for more details.
Test: fast/forms/change-inputmode-crash.html
* WebProcess/WebPage/WebPage.cpp:
(WebKit::isTextFormControlOrEditableContent):
Clean up some existing logic by introducing a helper method for determining whether an element should
propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
of checking against the tag name.
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::focusedElementDidChangeInputMode):
2019-03-31 Sam Weinig <weinig@apple.com>
Remove more i386 specific configurations
https://bugs.webkit.org/show_bug.cgi?id=196430
Reviewed by Alexey Proskuryakov.
* Configurations/BaseTarget.xcconfig:
WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
* Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
2019-03-31 Andy Estes <aestes@apple.com>
[iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
https://bugs.webkit.org/show_bug.cgi?id=196433
<rdar://problem/49293305>
Reviewed by Tim Horton.
Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
decision behavior. The configuration setting defaults to YES for clients linked on or after
this WebKit change and NO otherwise.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
* Shared/WebPreferences.yaml:
* Shared/ios/QuickLookDocumentData.cpp:
(WebKit::QuickLookDocumentData::isEmpty const):
* Shared/ios/QuickLookDocumentData.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
(-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/Cocoa/VersionChecks.h:
* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
(WebKit::WebPreviewLoaderClient::didReceiveDataArray):
2019-03-30 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Subframe load should not reset content observation on the mainframe
https://bugs.webkit.org/show_bug.cgi?id=196408
<rdar://problem/49436797>
Reviewed by Simon Fraser.
Hover intent fails when an unrelated frame commits a load the same time.
cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
(If the current frame navigates away, willDetachPage takes care of canceling the observation.)
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cancelPotentialTap):
(WebKit::WebPage::cancelPotentialTapInFrame):
2019-03-29 John Wilander <wilander@apple.com>
Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
https://bugs.webkit.org/show_bug.cgi?id=196407
<rdar://problem/47859936>
Reviewed by Brent Fulgham.
The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
moved Resource Load Statistics from the UI process to the network process. One
of the endpoints is the message RequestStorageAccessUnderOpener which underpins
our compatibility fix for federated logins using popups. This patch redirects
these IPC calls to the network process and cleans up some assumptions around
them.
* CMakeLists.txt:
Removed the old IPC receiver.
* DerivedSources.make:
Removed the old IPC receiver.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
This is no longer needed since there is a dedicated update mechanism
that actually sends the update.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
Two new IPC receivers to pipe the calls to the network process.
(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
this purpose.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
Removed the old IPC receiver.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleResourceLoadStatisticsNotifyObserver):
Function name update.
* WebProcess/WebProcess.cpp:
Now calls IPC to the network process instead of the UI process.
2019-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Delete WebMetal implementation in favor of WebGPU
https://bugs.webkit.org/show_bug.cgi?id=195418
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2019-03-29 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Add Server Trust Evaluation Support.
https://bugs.webkit.org/show_bug.cgi?id=191646
Reviewed by Fujii Hironori.
Tests: http/tests/ssl/iframe-upgrade.https.html
http/tests/ssl/mixedContent/insecure-websocket.html
http/tests/ssl/upgrade-origin-usage.html
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidFailWithError):
(WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2019-03-29 Cathie Chen <cathiechen@igalia.com>
Implement ResizeObserver.
https://bugs.webkit.org/show_bug.cgi?id=157743
Reviewed by Simon Fraser.
Add WebPreferences and FeatureDefines for ResizeObserver.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
2019-03-28 Timothy Hatcher <timothy@apple.com>
CFDictionary encoder crashes on non-string keys.
https://bugs.webkit.org/show_bug.cgi?id=196388
rdar://problem/49339242
Reviewed by Ryosuke Niwa.
Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
size for dictionaries and arrays when unknown keys or values are skipped.
Allow null array encoding and decoding like dictionary already allowed.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
2019-03-28 John Wilander <wilander@apple.com>
Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
https://bugs.webkit.org/show_bug.cgi?id=196281
<rdar://problem/48938748>
Reviewed by Alex Christensen.
The move of Resource Load Statistics to the network process requires that it
calls the UI process when clearing website data (previously the other way
around). This patch achieves that.
Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
filters its WebsiteDataTypes down to just the ones applicable for the UI
process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
IPC.
NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
the UI process side makes use of the re-introduced
WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
data records and call WebsiteDataStore::removeData(). The re-introduced
WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
https://trac.webkit.org/changeset/242056/webkit, then under the name
WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
was dead code was the lack of IPC call that this patch adds.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
are WebsiteDataTypes applicable to the UI process.
* NetworkProcess/NetworkProcess.h:
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):
(WebKit::WebsiteData::filter):
Convenience functions to manage process ownership of website data types.
* Shared/WebsiteData/WebsiteData.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsHasLocalStorage):
Test infrastructure, called by the TestRunner.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
New function to be called from the network process.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::matches const):
Now matches with WebCore::RegistrableDomain instead of a string.
(WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
Replaced by WebsiteDataRecord::matches().
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
Re-introduced. It was removed as dead code in r242056.
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
Test infrastructure, called by the TestRunner.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-03-28 Jiewen Tan <jiewen_tan@apple.com>
API::Data::createWithoutCopying should do a null check before calling CFRelease
https://bugs.webkit.org/show_bug.cgi?id=196276
<rdar://problem/48059859>
Reviewed by Alex Christensen.
* Shared/Cocoa/APIDataCocoa.mm:
(API::Data::createWithoutCopying):
2019-03-28 Per Arne Vollan <pvollan@apple.com>
[iOS] Automatic focus of input field is flaky
https://bugs.webkit.org/show_bug.cgi?id=196302
Reviewed by Brent Fulgham.
Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
[UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
(WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::isInHardwareKeyboardMode):
(WebKit::WebPageProxy::applicationWillEnterForeground):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
2019-03-28 Tim Horton <timothy_horton@apple.com>
Fix the build.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showImageSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2019-03-28 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
https://bugs.webkit.org/show_bug.cgi?id=186276
Reviewed by Carlos Garcia Campos.
Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
setting the error parameter. This is illegal because it is an API guarantee (and a GObject
convention) that if an error parameter exists, it should be set whenever a function call
returns NULL. Epiphany correctly dereferences the error in this case without checking if it
is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
array of length 1 containing a NUL character. This isn't great, but there's not really any
better solution without deprecating the API or returning an error code to indicate an empty
resource, and it at least fixes the Epiphany crash.
This does not fix bug #186276, in which this function incorrectly returns no data when it
ought to. But that is a different bug. Now, at least we won't crash when no data is
available.
* UIProcess/API/glib/WebKitWebResource.cpp:
(resourceDataCallback):
2019-03-28 Daniel Bates <dabates@apple.com>
[iPad] Tapping on a popup form control may not show a popover
https://bugs.webkit.org/show_bug.cgi?id=196322
<rdar://problem/49229632>
Reviewed by Wenson Hsieh.
Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
needs to call -inputView when it actually needs to display the input view (the keyboard). For
popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
as part of the logic in the UI process to focus a new element before we call -reloadInputViews.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
(-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
end the input sessions and nullify the input peripheral before we tell the web process to switch
focus as opposed to letting this happen after the web process tells us it focused a new element.
(createInputPeripheralWithView): Added.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
first responder because creating the peripheral has known side-effects: for popup buttons it
tells the popup controller to present the popover. For key input to popovers to work from the get-go,
the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
for more details.
2019-03-28 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Silence lot of warnings when compiling with clang
https://bugs.webkit.org/show_bug.cgi?id=196310
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
override clause.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
missing override clause.
2019-03-27 Ryosuke Niwa <rniwa@webkit.org>
[macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
https://bugs.webkit.org/show_bug.cgi?id=196336
Reviewed by Tim Horton.
The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
This resulted in RenderMenuList::m_popupIsVisible to be never reset.
Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::hidePopupMenu):
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::hide):
2019-03-27 Dean Jackson <dino@apple.com>
[ARKit] Black view when opening a 3D model usdz file in new tab
https://bugs.webkit.org/show_bug.cgi?id=196333
<rdar://problem/47693367>
Reviewed by Tim Horton.
When opening a new WKSystemPreviewView, we were exiting if there was no
presentingViewController. This code was unnecessary, and causing blank
content when opening a new tab.
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
Remove the code looking for a presentingViewController.
2019-03-27 Wenson Hsieh <wenson_hsieh@apple.com>
Need a way to include WebKitAdditions code in WebKit API headers
https://bugs.webkit.org/show_bug.cgi?id=196173
Reviewed by Tim Horton.
Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
using `#import`s of the form:
```
#if USE(APPLE_INTERNAL_SDK)
#import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
#endif
```
The resulting header in the built products directory will contain the contents of the imported file inserted in
place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
the additions header content will be imported by the usual means.
* mac/postprocess-framework-headers.sh:
* mac/replace-webkit-additions-includes.py: Added.
Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
with the text content of the additions files. The replacement script first searches in the built products
directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.
(read_content_from_webkit_additions):
(main):
2019-03-27 Andy Estes <aestes@apple.com>
REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
https://bugs.webkit.org/show_bug.cgi?id=196317
Reviewed by Dan Bernstein.
Removed some remnants of the Storage Process.
* Configurations/BaseTarget.xcconfig:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
* WebKit.xcodeproj/project.pbxproj:
2019-03-27 Keith Rollin <krollin@apple.com>
Include the CFNetworking task UUID to the NSError when a resource-load fails
https://bugs.webkit.org/show_bug.cgi?id=196156
Reviewed by Alex Christensen.
In order to help track the connection between a failed resource-load
and a user-visible error message, include the CFNetworking task UUID
in the associated error as an element of the userInfo property. This
can then be pulled out and reported in the logging at the point the
error is reported to the user.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2019-03-27 Chris Dumez <cdumez@apple.com>
[ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=195425
<rdar://problem/48682403>
Reviewed by Alex Christensen.
When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
in which it was previously loaded. However, we were failing to check if the WebProcess in question was
still running so we could potentially try to use a process that's already exited.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2019-03-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Always dispatch the synthetic click asynchronously
https://bugs.webkit.org/show_bug.cgi?id=196278
<rdar://problem/49299968>
Reviewed by Simon Fraser.
This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::dispatchSyntheticMouseMove):
(WebKit::WebPage::handleSyntheticClick):
2019-03-27 Tim Horton <timothy_horton@apple.com>
Fix some more deprecation warnings in WKDrawingView
https://bugs.webkit.org/show_bug.cgi?id=196282
<rdar://problem/47637608>
Reviewed by Wenson Hsieh.
* Platform/spi/ios/PencilKitSPI.h:
* SourcesCocoa.txt:
* UIProcess/ios/PencilKitSoftLink.h:
* UIProcess/ios/PencilKitSoftLink.mm:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/WKDrawingCoordinator.h:
* UIProcess/ios/WKDrawingCoordinator.mm:
(-[WKDrawingCoordinator initWithContentView:]):
(-[WKDrawingCoordinator currentInk]):
(-[WKDrawingCoordinator undoManagerForInkPicker:]):
(-[WKDrawingCoordinator containingViewForInkPicker:]):
(-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
(-[WKDrawingCoordinator inkPickerDidChangeInk:]):
(-[WKDrawingCoordinator installInkPickerForDrawing:]):
(-[WKDrawingCoordinator uninstallInkPicker]):
(-[WKDrawingCoordinator inkPicker]): Deleted.
(-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
(-[WKDrawingCoordinator didChangeInk:]): Deleted.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView _canvasViewWillBeginDrawing:]):
* UIProcess/ios/WKInkPickerView.h: Removed.
* UIProcess/ios/WKInkPickerView.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:
Adopt the new names.
2019-03-27 Carlos Garcia Campos <cgarcia@igalia.com>
Geolocation request not complete when watch request was started in a different web process
https://bugs.webkit.org/show_bug.cgi?id=195996
Reviewed by Alex Christensen.
In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
don't have a known position, the request will be completed when
WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
processes.
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
(WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
* UIProcess/WebGeolocationManagerProxy.h:
(WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
* WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
(WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.
2019-03-26 Brent Fulgham <bfulgham@apple.com>
[macOS] Correct kerberos-related sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196279
<rdar://problem/48622502>
Reviewed by Per Arne Vollan.
We need to allow communications with a Kerberos-related service on macOS
until <rdar://problem/35542803> is fixed.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2019-03-26 Chris Dumez <cdumez@apple.com>
[macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
https://bugs.webkit.org/show_bug.cgi?id=196277
<rdar://problem/49127581>
Reviewed by Alex Christensen.
When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
thread. Other auxiliary processes such as the NetworkProcess would end up calling
platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
unreliable as demonstrated by the test app attached to the radar.
Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.
* Shared/AuxiliaryProcess.cpp:
* Shared/Cocoa/AuxiliaryProcessCocoa.mm:
(WebKit::AuxiliaryProcess::platformStopRunLoop):
* Shared/ios/AuxiliaryProcessIOS.mm:
(WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
2019-03-26 Keith Rollin <krollin@apple.com>
Inhibit CFNetwork logging in private sessions
https://bugs.webkit.org/show_bug.cgi?id=196268
<rdar://problem/48210793>
Reviewed by Alex Christensen.
Before performing any logging, the NetworkProcess checks to see if
it's performing an operation associated with a private (ephemeral)
browsing session. If so, it skips the logging. However, networking
layers below the NetworkProcess don't know about private browsing, so
they would still perform their own logging. CFNetwork now has a flag
that lets us control that, so set it to False if private browsing.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::configurationForSessionID):
2019-03-26 Chris Dumez <cdumez@apple.com>
Add basic layout test coverage for File Picker on iOS
https://bugs.webkit.org/show_bug.cgi?id=196265
Reviewed by Wenson Hsieh.
Add layout test infrastructure to test the file picker on iOS.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _dismissFilePicker]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dismissFilePicker]):
(-[WKContentView _contentsOfUserInterfaceItem:]):
* UIProcess/ios/forms/WKFileUploadPanel.h:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel currentAvailableActionTitles]):
2019-03-26 Daniel Bates <dabates@apple.com>
[iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
https://bugs.webkit.org/show_bug.cgi?id=196264
Reviewed by Wenson Hsieh.
Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
that may support text selection on initial focus because we do not have an up-to-date selection rect at that
time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.
* UIProcess/ios/WKContentViewInteraction.mm:
(mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
List all the input types in the switch block and remove the default case to force the compiler to check that we
covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
for future input types that we may add.
(rectToRevealWhenZoomingToFocusedElement): Update for renaming.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
(shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.
2019-03-26 Wenson Hsieh <wenson_hsieh@apple.com>
Implement async paste method on UIWKInteractionViewProtocol
https://bugs.webkit.org/show_bug.cgi?id=196267
<rdar://problem/49236346>
Reviewed by Tim Horton.
Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
handler when pasting is finished.
Test: UIPasteboardTests.PasteWithCompletionHandler
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView pasteWithCompletionHandler:]):
2019-03-26 Per Arne Vollan <pvollan@apple.com>
[macOS] Fix sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196262
<rdar://problem/47738015>
Reviewed by Brent Fulgham.
Fix various observed sandbox violations.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-26 Tomoki Imai <Tomoki.Imai@sony.com>
Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
https://bugs.webkit.org/show_bug.cgi?id=195879
Reviewed by Carlos Garcia Campos.
The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.
It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
(WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode
2019-03-26 Antoine Quint <graouts@apple.com>
Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
https://bugs.webkit.org/show_bug.cgi?id=196254
<rdar://problem/49124334>
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2019-03-26 Philippe Normand <pnormand@igalia.com>
[WPE][Qt] Uninitialized racy ViewBackend
https://bugs.webkit.org/show_bug.cgi?id=196247
Reviewed by Carlos Garcia Campos.
* UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.
2019-03-26 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix typo in GLib geolocation API after r243285.
gelocation -> geolocation.
* UIProcess/API/glib/WebKitGeolocationManager.cpp:
(webkit_geolocation_manager_class_init):
(webkit_geolocation_manager_update_position):
(webkit_geolocation_manager_failed):
(webkit_gelocation_manager_update_position): Deleted.
(webkit_gelocation_manager_failed): Deleted.
* UIProcess/API/gtk/WebKitGeolocationManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitGeolocationManager.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
2019-03-26 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Disable process warming
https://bugs.webkit.org/show_bug.cgi?id=196208
Reviewed by Chris Dumez.
Fixes crash caused by r243384.
Process warming is incompatible with our launcher as it expects a valid
WebsiteDataStore at initialization time for sandbox permissions.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):
2019-03-25 Alex Christensen <achristensen@webkit.org>
Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
https://bugs.webkit.org/show_bug.cgi?id=196213
Reviewed by Geoff Garen.
A release assertion added in r230225 was reachable. I reached it in a unit test that responds to a challenge
with a SecIdentityRef wrapped in an NSCredential.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode):
2019-03-25 Chris Dumez <cdumez@apple.com>
Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
https://bugs.webkit.org/show_bug.cgi?id=196205
<rdar://problem/49083324>
Reviewed by Geoffrey Garen.
Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
wild cards (e.g. "image/*") that are defined in the HTML specification:
- https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
Previously, we would fail to convert those to UTIs.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
2019-03-25 Tim Horton <timothy_horton@apple.com>
Remove some now-unnecessary dynamic class lookup
https://bugs.webkit.org/show_bug.cgi?id=196237
Reviewed by Simon Fraser.
* Shared/DocumentEditingContext.mm:
(WebKit::DocumentEditingContext::toPlatformContext):
2019-03-25 Tim Horton <timothy_horton@apple.com>
Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
https://bugs.webkit.org/show_bug.cgi?id=196224
Reviewed by Simon Fraser.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator invalidate]):
(perpendicularAbsoluteUnitVector):
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
(-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
(-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
(-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
(-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
(-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
(-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.
2019-03-25 Fujii Hironori <Hironori.Fujii@sony.com>
Enable IPC sending and receiving non-default-constructible types
https://bugs.webkit.org/show_bug.cgi?id=196132
<rdar://problem/49229221>
Unreviewed build fix for WinCairo port.
error C2440: '=': cannot convert from 'int' to 'HANDLE'
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
(WebKit::SharedMemory::Handle::operator=): Ditto.
2019-03-25 Fujii Hironori <Hironori.Fujii@sony.com>
[Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
https://bugs.webkit.org/show_bug.cgi?id=196190
Reviewed by Žan Doberšek.
This assertion assumes the pre-committed and the committed scenes
are identical. But, the pre-committed scene is updated in the main
thread. Removed the false assertion.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
assertion. Removed layers of committed scene, not pre-committed
scene.
2019-03-25 Brady Eidson <beidson@apple.com>
Add socket-delegate to another entitlements config
rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227
Reviewed by Geoffrey Garen.
* Configurations/Network-iOSMac.entitlements:
2019-03-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243465.
https://bugs.webkit.org/show_bug.cgi?id=196226
the test doesn't build (Requested by thorton on #webkit).
Reverted changeset:
"Do not terminate the NetworkProcess if a third party
application sends a NSCredential with a SecIdentityRef"
https://bugs.webkit.org/show_bug.cgi?id=196213
https://trac.webkit.org/changeset/243465
2019-03-25 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
https://bugs.webkit.org/show_bug.cgi?id=196126
rdar://problem/49095791
Reviewed by Tim Horton.
I fumbled the commit after the enum rename. Make this actually work.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2019-03-25 Simon Fraser <simon.fraser@apple.com>
Zoom on macOS is centered around a point lower than the cursor
https://bugs.webkit.org/show_bug.cgi?id=196225
rdar://problem/49213574
Reviewed by Tim Horton.
The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
coordinates, but we end up setting the transform on the RenderView's layer, so we need
to subtract the topContentInset.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::handleMagnificationGestureEvent):
2019-03-25 Alex Christensen <achristensen@webkit.org>
Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
https://bugs.webkit.org/show_bug.cgi?id=196213
Reviewed by Geoff Garen.
A release assertion added in r230225 was reachable. I reached it in a unit test that responds to a challenge
with a SecIdentityRef wrapped in an NSCredential.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode):
2019-03-25 Chris Dumez <cdumez@apple.com>
Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
https://bugs.webkit.org/show_bug.cgi?id=196210
<rdar://problem/48681326>
Reviewed by Geoffrey Garen.
Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.
This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
communicate via DrawingArea IPC.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::setIsSuspended):
* WebProcess/WebPage/WebPage.h:
2019-03-25 Alex Christensen <achristensen@webkit.org>
Enable IPC sending and receiving non-default-constructible types
https://bugs.webkit.org/show_bug.cgi?id=196132
Reviewed by Geoff Garen.
* Platform/IPC/ArgumentCoder.h:
* Platform/IPC/ArgumentCoders.h:
(IPC::TupleEncoder::encode):
(IPC::tupleFromTupleAndObject):
(IPC::TupleDecoderImpl::decode):
(IPC::TupleDecoderImpl<Type>::decode):
(IPC::TupleDecoder::decode):
(IPC::TupleDecoder<0>::decode):
(IPC::TupleCoder::encode): Deleted.
(IPC::TupleCoder::decode): Deleted.
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithReply):
(IPC::TupleMover::move):
(IPC::moveTuple):
(IPC::Connection::sendSync):
* Platform/IPC/Decoder.h:
(IPC::Decoder::decode):
(IPC::Decoder::operator>>):
* Platform/IPC/HandleMessage.h:
(IPC::handleMessage):
(IPC::handleMessageSynchronous):
(IPC::handleMessageSynchronousWantsConnection):
(IPC::handleMessageAsync):
* Platform/SharedMemory.h:
* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/Messages-expected.h:
* Scripts/webkit/MessagesSuperclass-expected.h:
* Scripts/webkit/messages.py:
* Shared/Databases/IndexedDB/WebIDBResult.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
* Shared/ShareableBitmap.h:
* Shared/ShareableResource.h:
* Shared/UpdateInfo.h:
* Shared/WebEvent.h:
* Shared/WebProcessCreationParameters.cpp:
* Shared/WebProcessCreationParameters.h:
* Shared/mac/SecItemResponseData.cpp:
(WebKit::SecItemResponseData::SecItemResponseData):
(WebKit::SecItemResponseData::decode):
* Shared/mac/SecItemResponseData.h:
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
2019-03-25 Tim Horton <timothy_horton@apple.com>
Animated keyboard scrolling is extremely chaotic
https://bugs.webkit.org/show_bug.cgi?id=196164
<rdar://problem/48702444>
Reviewed by Simon Fraser.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
Consume keyboard events instead of interpreting them traditionally
if WKKeyboardScrollingAnimator is animating.
* UIProcess/ios/WKKeyboardScrollingAnimator.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
(-[WKKeyboardScrollingAnimator handleKeyEvent:]):
(-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
(-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
(-[WKKeyboardScrollingAnimator displayLinkFired:]):
(-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
Expose the current state of interactive scrolling, and rename the related member.
2019-03-25 Keith Rollin <krollin@apple.com>
Add WebKit logging for first paint and other interesting layout milestones
https://bugs.webkit.org/show_bug.cgi?id=196159
<rdar://problem/49128952>
Reviewed by Simon Fraser.
Add some logging to indicate what layout milestones have been reached.
This should help us determine if there's a client, rendering, layout,
or some other issue when page content does not appear in the client
window.
The logging is being added to
WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
a nice central place to capture layout milestones. However, it will
only log notifications that are being sent to clients. It does not
indicate all milestones that have occurred. That is, it does not
report milestones that are filtered out due to client disinterest.
There doesn't seem to be a good central place to capture all
milestones, regardless of client interest.
* Platform/Logging.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2019-03-25 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Remove network access from web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=189967
Reviewed by Michael Catanzaro.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::createFlatpakInfo):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/FlatpakLauncher.cpp:
(WebKit::flatpakSpawn):
2019-03-25 Andy Estes <aestes@apple.com>
[Apple Pay] Call +canMakePayments on a work queue
https://bugs.webkit.org/show_bug.cgi?id=196179
<rdar://problem/45388749>
Reviewed by Brady Eidson.
Calling +canMakePayments on either PKPaymentAuthorizationController or
PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
expensive to call on the main thread. On iOS, these calls are made in the network process,
and on Mac in the UI process.
Call these methods on a work queue to avoid main thread spins.
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::canMakePayments):
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2019-03-25 Andy Estes <aestes@apple.com>
[Apple Pay] Remove the AvailablePaymentNetworks synchronous message
https://bugs.webkit.org/show_bug.cgi?id=196180
Reviewed by Youenn Fablet.
Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
without an entitlement. Therefore, we can call it from the web process directly rather than
synchronously messaging the entitled UI or networking process.
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::availablePaymentNetworks):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
(WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
(-[WKAccessibilityWebPageObjectBase setWebPage:]):
2019-03-25 Chris Dumez <cdumez@apple.com>
Unreviewed, tiny fix after r243388 to address API test failures on iOS
m_processType was properly initialized on macOS but not iOS.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):
2019-03-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
https://bugs.webkit.org/show_bug.cgi?id=194208
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewWillStartLoad): Block updates of active URL.
(webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.
2019-03-25 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Remove NavigatorContentUtils in WebCore/Modules
https://bugs.webkit.org/show_bug.cgi?id=196070
Reviewed by Alex Christensen.
NavigatorContentUtils was to support the custom scheme spec [1].
However, in WebKit side, no port has supported the feature in
WebKit layer after EFL port was removed. So there has been the
only IDL implementation of the NavigatorContentUtils in WebCore.
So we don't need to keep the implementation in WebCore anymore.
[1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.
2019-03-24 Zan Dobersek <zdobersek@igalia.com>
Unreviewed WPE build fix.
* UIProcess/wpe/WebPasteboardProxyWPE.cpp:
Add an explicit CompletionHandler.h include to avoid a trip-up in
unified builds.
2019-03-24 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
https://bugs.webkit.org/show_bug.cgi?id=196192
Unreviewed for WinCairo port.
* Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".
2019-03-24 Andy Estes <aestes@apple.com>
[watchOS] Remove unused Proximity Networking code
https://bugs.webkit.org/show_bug.cgi?id=196188
Reviewed by Tim Horton.
* Configurations/WebKit.xcconfig:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformPrepareToSuspend):
(WebKit::NetworkProcess::platformProcessDidResume):
(WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
(WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
* NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
* NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
* NetworkProcess/watchos/NetworkProximityManager.h: Removed.
* NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
* SourcesCocoa.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
(-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebKit.xcodeproj/project.pbxproj:
2019-03-23 Chris Dumez <cdumez@apple.com>
Unreviewed, fix typo in comment added in r243379.
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup setDelegate:]):
2019-03-23 Simon Fraser <simon.fraser@apple.com>
REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
https://bugs.webkit.org/show_bug.cgi?id=137043
rdar://problem/16595330
Reviewed by Zalan Bujtas.
Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
to the UI process, and use it to set UIScrollView indicators visible or not.
The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
tests, so would never get called.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2019-03-23 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Taping on a form control should always result in click.
https://bugs.webkit.org/show_bug.cgi?id=196177
Reviewed by Simon Fraser.
This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
the mousemove brings up some hover content.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-03-23 Andy Estes <aestes@apple.com>
[Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
https://bugs.webkit.org/show_bug.cgi?id=196163
<rdar://problem/48787564>
Reviewed by Anders Carlsson.
Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
PKPaymentAuthorizationController alternatives.
While we're here, we should also transition to calling
+paymentServicesMerchantURLForAPIType:completion: on both
PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.
* Platform/cocoa/PaymentAuthorizationViewController.mm:
(-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
* Platform/cocoa/WKPaymentAuthorizationDelegate.h:
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
(-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
(-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
* Platform/ios/PaymentAuthorizationController.mm:
(-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2019-03-23 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK build after r243409.
Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
file list changes.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.
2019-03-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove build time dependency on Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=195994
Reviewed by Michael Catanzaro.
Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitGeolocationManager.cpp:
(_WebKitGeolocationPosition::_WebKitGeolocationPosition):
(webkitGeolocationManagerStop):
(webkitGeolocationManagerSetEnableHighAccuracy):
(webkitGeolocationManagerDispose):
(webkit_geolocation_manager_class_init):
* UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
(WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
(WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
(WebKit::GeoclueGeolocationProvider::start):
(WebKit::GeoclueGeolocationProvider::stop):
(WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
(WebKit::GeoclueGeolocationProvider::destroyManagerLater):
(WebKit::GeoclueGeolocationProvider::destroyManager):
(WebKit::GeoclueGeolocationProvider::setupManager):
(WebKit::GeoclueGeolocationProvider::createClient):
(WebKit::GeoclueGeolocationProvider::setupClient):
(WebKit::GeoclueGeolocationProvider::startClient):
(WebKit::GeoclueGeolocationProvider::stopClient):
(WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
(WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
(WebKit::GeoclueGeolocationProvider::createLocation):
(WebKit::GeoclueGeolocationProvider::locationUpdated):
(WebKit::GeoclueGeolocationProvider::didFail):
* UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
2019-03-22 Simon Fraser <simon.fraser@apple.com>
Undo collision with r243390.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(stringForSSLProtocol):
2019-03-22 Simon Fraser <simon.fraser@apple.com>
Fix internal builds.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(stringForSSLProtocol):
2019-03-22 Keith Rollin <krollin@apple.com>
Enable ThinLTO support in Production builds
https://bugs.webkit.org/show_bug.cgi?id=190758
<rdar://problem/45413233>
Reviewed by Daniel Bates.
Enable building with Thin LTO in Production when using Xcode 10.2 or
later. This change results in a 1.45% progression in PLT5. Full
Production build times increase about 2-3%. Incremental build times
are more severely affected, and so LTO is not enabled for local
engineering builds.
LTO is enabled only on macOS for now, until rdar://problem/49013399,
which affects ARM builds, is fixed.
To change the LTO setting when building locally:
- If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
command line.
- If building with `build-webkit`, specify --lto-mode={none,thin,full}
on the command line.
- If building with `build-root`, specify --lto={none,thin,full} on the
command line.
- If building with Xcode, create a LocalOverrides.xcconfig file at the
top level of your repository directory (if needed) and define
WK_LTO_MODE to full, thin, or none.
* Configurations/Base.xcconfig:
2019-03-22 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r243388.
* WebProcess/WebProcess.h:
2019-03-22 Per Arne Vollan <pvollan@apple.com>
[macOS] Fix sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=196153
<rdar://problem/49123855>
Reviewed by Brent Fulgham.
The sandbox on macOS is blocking the mach lookup.
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-21 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, fix the build with recent SDKs.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(stringForSSLProtocol):
2019-03-22 Chris Dumez <cdumez@apple.com>
Implement WebProcess freezer opt-in completely on WebContent process side
https://bugs.webkit.org/show_bug.cgi?id=196149
Reviewed by Brady Eidson.
Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
to involve the UIProcess with this and rely on IPC which may be fragile.
In the future, we may want to set freezable state from the UIProcess when the API supports
it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
likely best not to rely on IPC and process coordination for this.
* UIProcess/WebProcessProxy.cpp:
(WebKit::globalPageMap):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::setIsInProcessCache):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::removeProvisionalPageProxy):
(WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
(WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setIsInProcessCache):
(WebKit::WebProcess::markIsNoLongerPrewarmed):
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::setFreezable): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateProcessName):
(WebKit::WebProcess::shouldFreezeOnSuspension const):
(WebKit::WebProcess::updateFreezerStatus):
2019-03-22 Chris Dumez <cdumez@apple.com>
Prewarmed processes should be usable with any website data store
https://bugs.webkit.org/show_bug.cgi?id=196104
Reviewed by Alex Christensen.
Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
to lauch and initialize a WebProcess. When the process finally gets used and we thus
know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
to the process to that it can do its data store-specific initialization.
This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
can then be used for any WebsiteDataStore when we need them.
This is also used by our dummy WebProcessProxy since it does not have a backing process and
thus has no associated WebsiteDataStore.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebProcessDataStoreParameters.h: Added.
(WebKit::WebProcessDataStoreParameters::encode const):
(WebKit::WebProcessDataStoreParameters::decode):
* UIProcess/API/C/WKContext.cpp:
(WKContextWarmInitialProcess):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _warmInitialProcess]):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::prewarmProcess):
(WebKit::WebProcessPool::processForRegistrableDomain):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToOneProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::create):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::setWebsiteDataStore):
(WebKit::WebProcessProxy::addExistingWebPage):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::websiteDataStore const):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
* WebProcess/MediaCache/WebMediaKeyStorageManager.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setWebsiteDataStoreParameters):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/WebProcessSupplement.h:
(WebKit::WebProcessSupplement::initialize):
(WebKit::WebProcessSupplement::setWebsiteDataStore):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
* WebProcess/win/WebProcessWin.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
2019-03-22 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
https://bugs.webkit.org/show_bug.cgi?id=196126
rdar://problem/49095791
Reviewed by Antti Koivisto.
The scrolling tree doesn't have an accurate picture of the main view's scroll position
during pinch-zooming, so don't have it apply layer positions if a transient zoom is
in progress.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2019-03-22 Antti Koivisto <antti@apple.com>
Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
https://bugs.webkit.org/show_bug.cgi?id=196100
<rdar://problem/49117933>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
(WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):
Make more generic and save the associated positioning behavior.
(WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
(WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
(WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::isScrolledBy):
Stationary relationship means the layer won't scroll the scroller.
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
2019-03-22 Chris Dumez <cdumez@apple.com>
REGRESSION (r243094): ePub files do not render or open in Books
https://bugs.webkit.org/show_bug.cgi?id=196119
<rdar://problem/49121686>
Reviewed by Brady Eidson.
Do not delay the WebProcess launch until a load when contructing a web view and the client
may observe when its injected bundle is loaded via WKProcessGroupDelegate's
didCreateConnectionToWebProcessPlugIn.
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup setDelegate:]):
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorProcessPool):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
2019-03-22 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
https://bugs.webkit.org/show_bug.cgi?id=196140
Reviewed by Chris Dumez.
Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
process launched.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
using it.
2019-03-22 Timothy Hatcher <timothy@apple.com>
Change macosx() to macos() in WK_API... and JSC_API... macros.
https://bugs.webkit.org/show_bug.cgi?id=196106
Reviewed by Brian Burg.
* Shared/API/Cocoa/WKBrowsingContextHandle.h:
* Shared/API/Cocoa/WKDragDestinationAction.h:
* Shared/API/Cocoa/WKMain.h:
* Shared/API/Cocoa/_WKFrameHandle.h:
* Shared/API/Cocoa/_WKHitTestResult.h:
* Shared/API/Cocoa/_WKNSWindowExtras.h:
* Shared/API/Cocoa/_WKRemoteObjectInterface.h:
* Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/NSAttributedString.h:
* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKBackForwardListItem.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
* UIProcess/API/Cocoa/WKContentRuleList.h:
* UIProcess/API/Cocoa/WKContentRuleListStore.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKErrorPrivate.h:
* UIProcess/API/Cocoa/WKFrameInfo.h:
* UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKOpenPanelParameters.h:
* UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKScriptMessage.h:
* UIProcess/API/Cocoa/WKSecurityOrigin.h:
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKURLSchemeHandler.h:
* UIProcess/API/Cocoa/WKURLSchemeTask.h:
* UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/API/Cocoa/WKUserScript.h:
* UIProcess/API/Cocoa/WKUserScriptPrivate.h:
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/WKWindowFeatures.h:
* UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKApplicationManifest.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationDelegate.h:
* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKFindOptions.h:
* UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
* UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
* UIProcess/API/Cocoa/_WKInspector.h:
* UIProcess/API/Cocoa/_WKInspectorWindow.h:
* UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* UIProcess/API/Cocoa/_WKLayoutMode.h:
* UIProcess/API/Cocoa/_WKLinkIconParameters.h:
* UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKSessionState.h:
* UIProcess/API/Cocoa/_WKTextInputContext.h:
* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.h:
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
* UIProcess/API/Cocoa/_WKUserContentWorld.h:
* UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
* UIProcess/API/Cocoa/_WKUserStyleSheet.h:
* UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
* UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/API/Cocoa/WKWebProcess.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
* WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
* WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
* WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
* WebProcess/InjectedBundle/API/mac/WKDOMText.h:
* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2019-03-22 Yousuke Kimoto <Yousuke.Kimoto@sony.com>
Unreviewed build fix.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
2019-03-22 Tim Horton <timothy_horton@apple.com>
Fix the build after r243354
https://bugs.webkit.org/show_bug.cgi?id=196138
<rdar://problem/49145951>
* Platform/spi/ios/UIKitSPI.h:
* Shared/DocumentEditingContext.mm:
(WebKit::DocumentEditingContext::toPlatformContext):
* UIProcess/ios/WKContentViewInteraction.mm:
2019-03-21 Simon Fraser <simon.fraser@apple.com>
Clean up some TiledCoreAnimationDrawingArea members
https://bugs.webkit.org/show_bug.cgi?id=196124
Reviewed by Tim Horton.
The giant m_transform was unused.
Group the bools etc.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
2019-03-21 Brady Eidson <beidson@apple.com>
Certain WebProcesses should opt-out of the freezer.
<rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062
Reviewed by Andy Estes.
WebProcesses should opt-in and opt-out of the freezer as is appropriate.
By default a WebProcess is freezer eligible.
If any of the following become true then it should become ineligible:
- The WebProcess is a pre-warmed process.
- The WebProcess is in the process cache.
- The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)
The most complicated part of the above is guaranteeing that any operation that changes
the active pages hosted by the process causes a recalculation of the freezer opt-in state.
To do that this replaces the basic WebPageProxyMap with a custom class.
* UIProcess/WebProcessProxy.cpp:
(WebKit::globalPageMap):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::validateFreezerStatus):
(WebKit::WebProcessProxy::setIsInProcessCache):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
(WebKit::WebProcessProxy::didFinishLaunching):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
(WebKit::WebProcessProxy::WebPageProxyMap::size const):
(WebKit::WebProcessProxy::WebPageProxyMap::values):
(WebKit::WebProcessProxy::WebPageProxyMap::values const):
(WebKit::WebProcessProxy::WebPageProxyMap::begin):
(WebKit::WebProcessProxy::WebPageProxyMap::end):
(WebKit::WebProcessProxy::WebPageProxyMap::get):
(WebKit::WebProcessProxy::WebPageProxyMap::contains const):
(WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
(WebKit::WebProcessProxy::WebPageProxyMap::set):
(WebKit::WebProcessProxy::WebPageProxyMap::take):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setFreezable):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-03-21 Tim Horton <timothy_horton@apple.com>
Adopt UIWKDocumentContext
https://bugs.webkit.org/show_bug.cgi?id=196040
<rdar://problem/48642440>
Reviewed by Ryosuke Niwa.
* Platform/spi/ios/UIKitSPI.h:
* Scripts/webkit/messages.py:
* Shared/DocumentEditingContext.h: Added.
* Shared/DocumentEditingContext.mm: Added.
(WebKit::toNSRange):
(WebKit::DocumentEditingContext::toPlatformContext):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
(IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
Add DocumentEditingContext(Request), and coders.
Also expose DocumentEditingContext::toPlatformContext, which populates
a UIWKDocumentContext with the relevant values.
* SourcesCocoa.txt:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toWebDocumentRequestOptions):
(toWebRequest):
(-[WKContentView adjustSelectionWithDelta:completionHandler:]):
(-[WKContentView requestDocumentContext:completionHandler:]):
(-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::adjustSelectionWithDelta):
(WebKit::WebPageProxy::requestDocumentEditingContext):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Plumb DocumentEditingContext(Request) around.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::adjustSelectionWithDelta):
Adjust the current selection given deltas to apply to the location and length.
(WebKit::visiblePositionAdjacentToVisiblePosition):
(WebKit::visiblePositionForPointInRootViewCoordinates):
(WebKit::WebPage::requestDocumentEditingContext):
Retrieve the relevant part of the selection, as well as the context,
given either the selection, or a rect.
If we're collecting context for a rect, we split the context between
before and after (except for the part that intersects the selection).
The three strings will always be directly adjacent, and any of the three
can sometimes be null.
2019-03-21 James Magahern <jmagahern@apple.com>
Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
https://bugs.webkit.org/show_bug.cgi?id=195726
rdar://problem/48582449
Reviewed by Megan Gardner.
We just need to add another clause to WKContentViewInteraction's
canPreventGestureRecognizer whitelist.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2019-03-21 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Turn on async overflow scrolling by default
https://bugs.webkit.org/show_bug.cgi?id=196011
rdar://problem/48453859
Reviewed by Antti Koivisto.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-03-21 Alex Christensen <achristensen@webkit.org>
Remove last use of LegacySync IPC messages
https://bugs.webkit.org/show_bug.cgi?id=196113
Reviewed by Chris Dumez.
Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchMessage):
* Platform/IPC/HandleMessage.h:
(IPC::handleMessageSynchronous):
(IPC::handleMessageSynchronousWantsConnection):
(IPC::handleMessageLegacySync): Deleted.
(IPC::handleMessageDelayed): Deleted.
(IPC::handleMessageDelayedWantsConnection): Deleted.
* PluginProcess/PluginControllerProxy.messages.in:
* PluginProcess/WebProcessConnection.messages.in:
* Scripts/webkit/LegacyMessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncWebPageMessage):
* Scripts/webkit/MessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncMessage):
* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestSyncMessage::send):
(Messages::WebPage::TestSynchronousMessage::send):
(WebKit::WebPage::didReceiveSyncMessage):
(Messages::WebPage::TestDelayedMessage::send): Deleted.
* Scripts/webkit/MessagesSuperclass-expected.h:
(Messages::WebPage::TestSynchronousMessage::name):
(Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
(Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
(Messages::WebPage::TestDelayedMessage::name): Deleted.
(Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
(Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
* Scripts/webkit/messages.py:
* Scripts/webkit/messages_unittest.py:
* Scripts/webkit/test-legacy-messages.in:
* Scripts/webkit/test-messages.in:
* Scripts/webkit/test-superclass-messages.in:
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/WebFullScreenManagerProxy.messages.in:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/WebProcessPool.messages.in:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/WebStorage/StorageManager.messages.in:
* UIProcess/mac/SecItemShimProxy.messages.in:
* WebProcess/Plugins/PluginProcessConnection.messages.in:
* WebProcess/Plugins/PluginProxy.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::syncTerminateWorker):
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.messages.in:
2019-03-21 Brian Burg <bburg@apple.com>
Web Automation: support uploading non-local file paths
https://bugs.webkit.org/show_bug.cgi?id=196081
<rdar://problem/45819897>
Reviewed by Devin Rousso and Joseph Pecoraro.
To support cases where supplied file paths do not exist on the session host, add support for
receiving file contents via Automation.setFilesToSelectForFileUpload.
* UIProcess/Automation/Automation.json: Add new parameter.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
that WebCore knows to look at the revised paths where the file contents have been saved.
(WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.
2019-03-21 Youenn Fablet <youenn@apple.com>
Cache API and IDB space usages should be initialized on first quota check
https://bugs.webkit.org/show_bug.cgi?id=195707
Reviewed by Chris Dumez.
When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
For IDB, the creation is synchronous but it may not be synchronous for Cache API.
For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
Once added, the temporary quota user is removed.
The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.
In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::QuotaUserInitializer::initialize):
(WebKit::QuotaUserInitializer::~QuotaUserInitializer):
(WebKit::QuotaUserInitializer::QuotaUserInitializer):
(WebKit::NetworkProcess::storageQuotaManager):
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::initializeQuotaUser):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clear):
2019-03-21 Per Arne Vollan <pvollan@apple.com>
[iOS][macOS] Fix sandbox call violations
https://bugs.webkit.org/show_bug.cgi?id=195809
<rdar://problem/48829655>
Reviewed by Brent Fulgham.
An additional syscall needs to be added to the sandbox allow list.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-21 Eric Carlson <eric.carlson@apple.com>
Add UI process WebRTC runtime logging.
https://bugs.webkit.org/show_bug.cgi?id=196020
<rdar://problem/49071443>
Reviewed by Youenn Fablet.
* Platform/Logging.cpp:
(WebKit::getLogChannel): New.
* Platform/Logging.h:
* Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
Add runtime logging.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
(WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
(WebKit::convertEnumerationToString):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
(WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::convertEnumerationToString): Add an enum specialization for logging.
* UIProcess/UserMediaPermissionRequestProxy.h:
(WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logger):
(WebKit::WebPageProxy::configureLoggingChannel):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::configureLoggingChannel):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::configureLoggingChannel):
* WebProcess/WebPage/WebPage.h:
2019-03-21 Alex Christensen <achristensen@webkit.org>
Stop using LegacySync messages in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=196056
Reviewed by Chris Dumez.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::loadRecentSearches):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::backForwardGoToItem):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleSynchronousMessage):
(WebKit::WebPageProxy::hasInsecureContent):
(WebKit::WebPageProxy::accessibilityScreenToRootView):
(WebKit::WebPageProxy::rootViewToAccessibilityScreen):
(WebKit::WebPageProxy::printFrame):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::backForwardItemAtIndex):
(WebKit::WebPageProxy::backForwardBackListCount):
(WebKit::WebPageProxy::backForwardForwardListCount):
(WebKit::WebPageProxy::canUndoRedo):
(WebKit::WebPageProxy::executeUndoRedo):
(WebKit::WebPageProxy::checkTextOfParagraph):
(WebKit::WebPageProxy::checkSpellingOfString):
(WebKit::WebPageProxy::checkGrammarOfString):
(WebKit::WebPageProxy::spellingUIIsShowing):
(WebKit::WebPageProxy::getGuessesForWord):
(WebKit::WebPageProxy::substitutionsPanelIsShowing):
(WebKit::WebPageProxy::showCorrectionPanel):
(WebKit::WebPageProxy::dismissCorrectionPanel):
(WebKit::WebPageProxy::dismissCorrectionPanelSoon):
(WebKit::WebPageProxy::recordAutocorrectionResponse):
(WebKit::WebPageProxy::dictationAlternatives):
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
(WebKit::WebPageProxy::speechSynthesisVoiceList):
(WebKit::WebPageProxy::printMainFrame): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::createPluginContainer):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::interpretKeyEvent):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::getIsSpeaking):
(WebKit::WebPageProxy::executeSavedCommandBySelector):
(WebKit::WebPageProxy::showPDFContextMenu):
2019-03-21 Alex Christensen <achristensen@webkit.org>
Stop using LegacySync messages in WebPage
https://bugs.webkit.org/show_bug.cgi?id=196057
Reviewed by Chris Dumez.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::getCenterForZoomGesture):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::readSelectionFromPasteboard):
(WebKit::WebPage::getStringSelectionForPasteboard):
(WebKit::WebPage::getDataSelectionForPasteboard):
(WebKit::WebPage::shouldDelayWindowOrderingEvent):
(WebKit::WebPage::acceptsFirstMouse):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::replaceSelectionWithPasteboardData):
(WebKit::WebPage::readSelectionFromPasteboard):
(WebKit::WebPage::getStringSelectionForPasteboard):
(WebKit::WebPage::getDataSelectionForPasteboard):
(WebKit::WebPage::shouldDelayWindowOrderingEvent):
(WebKit::WebPage::acceptsFirstMouse):
2019-03-21 Alex Christensen <achristensen@webkit.org>
Stop using LegacySync messages in WebPasteboardProxy
https://bugs.webkit.org/show_bug.cgi?id=196060
Reviewed by Chris Dumez.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardTypes):
(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
(WebKit::WebPasteboardProxy::getPasteboardStringForType):
(WebKit::WebPasteboardProxy::getPasteboardStringsForType):
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::pasteboardCopy):
(WebKit::WebPasteboardProxy::getPasteboardChangeCount):
(WebKit::WebPasteboardProxy::getPasteboardUniqueName):
(WebKit::WebPasteboardProxy::getPasteboardColor):
(WebKit::WebPasteboardProxy::getPasteboardURL):
(WebKit::WebPasteboardProxy::addPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardURL):
(WebKit::WebPasteboardProxy::setPasteboardColor):
(WebKit::WebPasteboardProxy::setPasteboardStringForType):
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
(WebKit::WebPasteboardProxy::getNumberOfFiles):
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
(WebKit::WebPasteboardProxy::informationForItemAtIndex):
* UIProcess/WebPasteboardProxy.cpp:
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
(WebKit::WebPasteboardProxy::readFromClipboard):
* UIProcess/wpe/WebPasteboardProxyWPE.cpp:
(WebKit::WebPasteboardProxy::getPasteboardTypes):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):
2019-03-21 Andy Estes <aestes@apple.com>
[iOS] Apple Pay should be available in documents with no user agent scripts
https://bugs.webkit.org/show_bug.cgi?id=196061
<rdar://problem/48649391>
Reviewed by Brady Eidson.
* Shared/AuxiliaryProcess.h:
* Shared/Cocoa/AuxiliaryProcessCocoa.mm:
(WebKit::AuxiliaryProcess::parentProcessHasEntitlement):
Added a convenience function for checking parent process entitlements.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
Implemented supportsUnrestrictedApplePay by checking for the
com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
APPLE_PAY_REMOTE_UI.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didClearWindowObjectForFrame):
(setUpPageLoaderClient):
Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScript):
Changed to call ScriptController::executeUserAgentScriptInWorld.
2019-03-21 Chris Dumez <cdumez@apple.com>
WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
https://bugs.webkit.org/show_bug.cgi?id=196041
<rdar://problem/49083230>
Reviewed by Alex Christensen.
WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
We do not support having several WebsiteDataStores sharing the same WebProcess.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
2019-03-21 Alex Christensen <achristensen@webkit.org>
Add SPI to inform applications of WKContentRuleList actions
https://bugs.webkit.org/show_bug.cgi?id=195965
<rdar://problem/42664365>
Reviewed by Geoff Garen.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::contentRuleListNotification):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::contentRuleListNotification):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contentRuleListNotification):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentRuleListNotification):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2019-03-21 Simon Fraser <simon.fraser@apple.com>
Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=196058
rdar://problem/49078202
Reviewed by Antti Koivisto.
Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
on by default.
* Shared/WebPreferences.yaml:
2019-03-21 Antti Koivisto <antti@apple.com>
UI-process hit-testing needs to know about containing block relationships
https://bugs.webkit.org/show_bug.cgi?id=195845
<rdar://problem/48949633>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
yet should move along with it. This needs to be taken into account in UI-side hit testing.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
(WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
(WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):
Maintain non-ancestor scrolling relationships for layers.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::isScrolledBy):
Helper to figure out who scrolls who.
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.
2019-03-21 Daniel Bates <dabates@apple.com>
[iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
https://bugs.webkit.org/show_bug.cgi?id=196021
Reviewed by Wenson Hsieh.
Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
remove one method.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
the equivalent work for us.
(-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
(-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
the equivalent work for us.
(-[WKContentView _ensureFormAccessoryView]): Deleted.
2019-03-21 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r243250.
Causing 109 Failures and 2 crashes on iOS Sim Debug
OpenSource/Internal queues
Reverted changeset:
"[iOS WK2] Turn on async overflow scrolling by default"
https://bugs.webkit.org/show_bug.cgi?id=196011
https://trac.webkit.org/changeset/243250
2019-03-21 Brent Fulgham <bfulgham@apple.com>
Fix possible memory leak when dismissing a color picker
https://bugs.webkit.org/show_bug.cgi?id=196026
<rdar://problem/48778568>
Reviewed by Wenson Hsieh.
Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
with a +1 reference count after dismissing it.
* UIProcess/WebColorPicker.cpp:
(WebKit::WebColorPicker::endPicker):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::endColorPicker):
(WebKit::WebPageProxy::didEndColorPicker):
2019-03-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940
Reviewed by Michael Catanzaro.
Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
(_WebKitGeolocationPosition::_WebKitGeolocationPosition):
(webkit_geolocation_position_new):
(webkit_geolocation_position_copy):
(webkit_geolocation_position_free):
(webkit_geolocation_position_set_timestamp):
(webkit_geolocation_position_set_altitude):
(webkit_geolocation_position_set_altitude_accuracy):
(webkit_geolocation_position_set_heading):
(webkit_geolocation_position_set_speed):
(webkitGeolocationManagerStop):
(webkitGeolocationManagerSetEnableHighAccuracy):
(webkitGeolocationManagerCreate):
(webkitGeolocationManagerGetProperty):
(webkit_geolocation_manager_class_init):
(webkit_gelocation_manager_update_position):
(webkit_gelocation_manager_failed):
(webkit_geolocation_manager_get_enable_high_accuracy):
* UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
* UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
* UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
(webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
* UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:
2019-03-20 Youenn Fablet <youenn@apple.com>
Compute quota after network process restart based on default quota and space used
https://bugs.webkit.org/show_bug.cgi?id=195804
Reviewed by Chris Dumez.
Make sure that Cache Storage quota user waits to declare as initialized to its manager
until all data is loaded so that it can report a valid space used from the start.
Add test API to reset the quota to its default value and compute it according current space use.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::create):
(WebKit::CacheStorage::Caches::Caches):
(WebKit::CacheStorage::Caches::whenInitialized):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::dereference):
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
* WebProcess/Cache/WebCacheStorageConnection.h:
2019-03-20 Simon Fraser <simon.fraser@apple.com>
Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
https://bugs.webkit.org/show_bug.cgi?id=196049
Reviewed by Tim Horton.
This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
overflow scrolling in general, so rename it.
* Configurations/FeatureDefines.xcconfig:
2019-03-20 Jiewen Tan <jiewen_tan@apple.com>
Extend Networking Process sandbox for some system frameworks
https://bugs.webkit.org/show_bug.cgi?id=196036
<rdar://problem/47594150>
Reviewed by Brent Fulgham.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2019-03-20 Alex Christensen <achristensen@webkit.org>
Reduce use of LegacySync IPC message type
https://bugs.webkit.org/show_bug.cgi?id=194835
Reviewed by Darin Adler.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
(WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
(WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
(WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::capabilities):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::launchProcess):
(WebKit::PluginProcessProxy::launchApplicationAtURL):
(WebKit::PluginProcessProxy::openURL):
(WebKit::PluginProcessProxy::openFile):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::supportsFullScreen):
* UIProcess/WebFullScreenManagerProxy.h:
* UIProcess/WebFullScreenManagerProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::deleteWebsiteDataForOrigins):
(WebKit::WebProcess::processWillSuspendImminently):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-03-20 Keith Rollin <krollin@apple.com>
Update checks that determine if WebKit is system WebKit
https://bugs.webkit.org/show_bug.cgi?id=195756
Unreviewed tweak of r243251 after unreviewed build fix after r243230.
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::isSystemWebKit):
2019-03-20 Keith Rollin <krollin@apple.com>
Update checks that determine if WebKit is system WebKit
https://bugs.webkit.org/show_bug.cgi?id=195756
Unreviewed build fix after r243230.
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::isSystemWebKit):
2019-03-20 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Turn on async overflow scrolling by default
https://bugs.webkit.org/show_bug.cgi?id=196011
rdar://problem/48453859
Reviewed by Antti Koivisto.
Turn async overflow scroll on by default for iOS WK2.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-03-20 Youenn Fablet <youenn@apple.com>
Have smaller default quotas for third party frames
https://bugs.webkit.org/show_bug.cgi?id=195841
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::storageQuotaManager):
For third party iframes, use the default quota divided by 10.
2019-03-20 Dean Jackson <dino@apple.com>
[iOS] Enable fast clicking everywhere
https://bugs.webkit.org/show_bug.cgi?id=196023
<rdar://problem/49073589>
Reviewed by Wenson Hsieh.
Set FastClicksEverywhere to on by default for iPhone & iPad.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-03-20 Chris Dumez <cdumez@apple.com>
Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
https://bugs.webkit.org/show_bug.cgi?id=196029
<rdar://problem/48954651>
Reviewed by Tim Horton.
If there is a ViewGestureController when process swapping, make sure we disconnect it
from the old process and reconnect it to the new one. This matches what is done in
WebViewImpl for macOS (see r238356).
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSwap]):
(-[WKWebView _processDidExit]):
(-[WKWebView _didRelaunchProcess]):
2019-03-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] REGRESSION(r243094): crash when launching minibrowser
https://bugs.webkit.org/show_bug.cgi?id=195951
Reviewed by Joseph Pecoraro.
Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
m_inspectedPage is null-checked everywhere.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::inspector const):
2019-03-20 Keith Rollin <krollin@apple.com>
Update checks that determine if WebKit is system WebKit
https://bugs.webkit.org/show_bug.cgi?id=195756
Reviewed by Alexey Proskuryakov.
The system WebKit can be installed in additional locations, so check
for and allow those, too.
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::isSystemWebKit):
2019-03-20 Per Arne Vollan <pvollan@apple.com>
[iOS] Unable to PiP web videos in Safari due to sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=196015
<rdar://problem/48867037>
Reviewed by Brent Fulgham.
The sandbox should allow getting the iokit property 'ui-pip'.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-20 John Wilander <wilander@apple.com>
(Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
https://bugs.webkit.org/show_bug.cgi?id=196017
Unreviewed test fix.
This patch adds a check of parameters().isRunningTest to the return of
ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
layout tests to remove website data, effectively overriding the
minimumTimeBetweenDataRecordsRemoval setting.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
2019-03-20 Daniel Bates <dabates@apple.com>
[iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
https://bugs.webkit.org/show_bug.cgi?id=196018
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
string, but I resisted since null string, as we do now, likely encodes more compactly and we
avoid a per-process alloc.
(-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
in lambda. Also use lamdba capture initializer syntax and remove a local.
(-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
design without more bookkeeping. The design for showing and hiding an AutoFill button added in
r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
-_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
(-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
a form accessory view. This method is called everytime we load a page (more precisely when we
commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
update an accessory if we don't have one.
2019-03-20 Olivier Robin <olivierrobin@chromium.org>
Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
https://bugs.webkit.org/show_bug.cgi?id=195999
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2019-03-20 Brent Fulgham <bfulgham@apple.com>
Adopt RegistrableDomain in the Storage Access API prompt code paths
https://bugs.webkit.org/show_bug.cgi?id=195957
<rdar://problem/49048028>
Reviewed by Chris Dumez.
While making the code changes in Bug 195866 we noticed that strings were being
used to pass the origins for the API calls. We should adopt the RegistrableDomain
class to improve type safety and avoid introducing bugs in the future.
* UIProcess/API/APIUIClient.h:
(API::UIClient::requestStorageAccessConfirm):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
* UIProcess/Cocoa/WKStorageAccessAlert.h:
* UIProcess/Cocoa/WKStorageAccessAlert.mm:
(WebKit::presentStorageAccessAlert):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
2019-03-20 Chris Dumez <cdumez@apple.com>
Unreviewed, fix typo in comment added in r243156.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::postMessageToInjectedBundle):
2019-03-20 Chris Dumez <cdumez@apple.com>
Unreviewed, drop invalid assertions landed in r243163.
Those assertions were causing some API tests to crash.
Also include some post-review suggestions from Darin.
* Shared/CallbackID.h:
(WebKit::CallbackID::operator=):
* Shared/OptionalCallbackID.h:
(WebKit::OptionalCallbackID::operator=):
2019-03-20 Chris Dumez <cdumez@apple.com>
Unreviewed, fix assertion failures in API tests after r243159.
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::removeProcess):
2019-03-20 Tim Horton <timothy_horton@apple.com>
Add an platform-driven spell-checking mechanism
https://bugs.webkit.org/show_bug.cgi?id=195795
Reviewed by Ryosuke Niwa.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* SourcesCocoa.txt:
* UIProcess/Cocoa/TextCheckingController.h: Added.
* UIProcess/Cocoa/TextCheckingController.mm: Added.
(WebKit::TextCheckingController::TextCheckingController):
(WebKit::TextCheckingController::replaceRelativeToSelection):
(WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
(-[WKContentView removeAnnotation:forSelectionOffset:length:]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::textCheckingController):
Plumb two UITextInput methods through to the Web Content process.
I added a new object instead of just sticking things on WebPage
because there are quite a few more related ones coming down the pipeline,
and will also end up being messages going in the opposite direction.
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Added.
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: Added.
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Added.
(WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
(WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
(WebKit::relevantMarkerTypes):
(WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
(WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
(WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
Make it possible for the platform to maintain arbitrary key-value pairs
attached to document ranges, as a way for it to keep track of various
text checking context (e.g. if something has been checked, replaced,
what language it might be, ...).
Allow it to replace the text of a range and the annotations in that range,
or remove annotations in a range. Ranges are specified relative to
the selection.
One large missing piece is giving the platform the ability to retrieve
annotations in a range; that is coming in a future patch.
We translate certain annotations into traditional WebCore spelling
and grammar document markers, for normal display-time treatment.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
Unified sources fixes.
2019-03-19 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement FIDO AppID extension
https://bugs.webkit.org/show_bug.cgi?id=143491
<rdar://problem/48298273>
Reviewed by Brent Fulgham.
In U2fHidAuthenticator::continueSignCommandAfterResponseReceived, it will retry the current command
with the AppID if it exists when SW_WRONG_DATA is received from devices. Noted, it will not set
the AuthenticationExtensionsClientOutputs::appid to false in any circumstances. In other words, the
field will be empty if AppID is supplied in AuthenticationExtensionsClientInputs and not used.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
(WebKit::U2fHidAuthenticator::issueSignCommand):
(WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h:
2019-03-19 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed adjustment to r242842 per Darin's request.
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
2019-03-19 Gyuyoung Kim <gyuyoung.kim@lge.com>
[WPE] Fix build warnings because of missing an argument when initializing wpe_input_axis_event
https://bugs.webkit.org/show_bug.cgi?id=195931
Reviewed by Michael Catanzaro.
There are still build warnings when building wpe port. It looks like
these build warnings have been caused by missing to set an argument
for the modifier parameter of wpe_input_axis_event. This patch sets 0
for the modifier argument to avoid the build warnings.
* UIProcess/API/wpe/ScrollGestureController.cpp:
(WebKit::ScrollGestureController::handleEvent):
2019-03-19 John Wilander <wilander@apple.com>
Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
https://bugs.webkit.org/show_bug.cgi?id=195923
<rdar://problem/49001272>
Reviewed by Alex Christensen.
Cross-site trackers abuse link query parameters to transport user identifiers and then store
them in first-party storage space. To address this, we've done three things:
- r236448 capped all persistent client-side cookies to seven days of storage.
- r242288 further capped persistent client-side cookies for navigations with link decoration from prevalent resources.
- r242603 added logging of navigations with link decoration from prevalent resources.
This patch introduces an experimental feature that removes non-cookie website data for sites
that have been navigated to, with link decoration, by a prevalent resource.
To achieve this, resource domains to remove website data for are now marked with an enum called
WebsiteDataToRemove with values All, AllButHttpOnlyCookies, AllButCookies. As resources are
iterated, they are marked for either of these values and the new function
ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor() leads to the marking with
WebsiteDataToRemove::AllButCookies.
Then NetworkProcess::deleteWebsiteDataForRegistrableDomains() looks at this setting and removes
website data accordingly.
The thinking behind this is that the lifetime cap applied in r236448 and r242288 take care of
script writable cookies, and this patch takes care of all other script writable storage.
The infrastructure to handle user interaction expiration is now parameterized so that multiple
expiries can be applied. In this particular case, seven days of browser use.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const):
(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllWebsiteDataFor const):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
(WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::domainsToString):
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
Renamed to reflect that it actually takes a parameter for which types of data to remove.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::deleteCookiesForTesting):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
Renamed to reflect that it actually takes a parameter for which types of data to remove.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
Renamed to reflect that it actually takes a parameter for which types of data to remove.
* NetworkProcess/NetworkSession.h:
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-03-19 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r243173.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
2019-03-19 Brent Fulgham <bfulgham@apple.com>
Add default prompt implementation for the Storage Access API
https://bugs.webkit.org/show_bug.cgi?id=195866
<rdar://problem/45150009>
Reviewed by Chris Dumez.
This patch revises the UIDelegate implementation with a default permission dialog
for the Storage Access API. This allows us to use and test the API in MiniBrowser,
rather than requiring a full-fledged web browser to drive testing.
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added.
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default
implementation if the WKWebVIew client doesn't implement the necessary SPI.
* UIProcess/Cocoa/WKStorageAccessAlert.h: Added.
* UIProcess/Cocoa/WKStorageAccessAlert.mm: Added.
(WebKit::presentStorageAccessAlert):
* WebKit.xcodeproj/project.pbxproj:
2019-03-19 Conrad Shultz <conrad_shultz@apple.com>
REGRESSION (r242369): Only use picker-supported UTIs when creating image picker
https://bugs.webkit.org/show_bug.cgi?id=195955
Reviewed by Chris Dumez and Wenson Hsieh.
r242369 started passing UTIs to -[UIImagePickerController setMediaTypes:] that correspond to types accepted by the
file input element. However, UIImagePickerController expects a specific subset of UTIs. In the worst case, if no
expected types are passed, this can cause a crash.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(UTIsForMIMETypes):
Return a set rather than an array.
(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
Rather than hardcode specific UTIs, ask UIImagePickerController for its available types. If an accepted type
is in the list of available types, use it. Otherwise, if an accepted type conforms to an available type,
use the available type. This is an O(n^2) process, but there typically are only a handful of types, so
this seems acceptable.
(-[WKFileUploadPanel _showDocumentPickerMenu]):
Convert the set from UTIsForMIMETypes() to an array.
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Build cleanly with GCC 9
https://bugs.webkit.org/show_bug.cgi?id=195920
Reviewed by Chris Dumez.
WebKit triggers three new GCC 9 warnings:
"""
-Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
declared copy constructor and assignment operator if one of them is user-provided.
"""
Solution is to either add a copy constructor or copy assignment operator, if required, or
else remove one if it is redundant.
"""
-Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
-Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
"""
These account for most of this patch. Solution is to just remove the bad WTFMove().
Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
would be safer to not use memcpy on nontrivial types, but that's too complex for this
patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::decode):
* Platform/IPC/ArgumentCoders.h:
* Shared/CallbackID.h:
(WebKit::CallbackID::operator=):
* Shared/OptionalCallbackID.h:
(WebKit::OptionalCallbackID::operator=):
* Shared/Plugins/NPIdentifierData.cpp:
(WebKit::NPIdentifierData::decode):
* Shared/Plugins/NPVariantData.cpp:
(WebKit::NPVariantData::decode):
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::getOrCreate):
* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
* Shared/SessionState.cpp:
(WebKit::HTTPBody::Element::decode):
(WebKit::FrameState::decode):
(WebKit::BackForwardListItemState::decode):
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FloatPoint>::decode):
(IPC::ArgumentCoder<FloatRect>::decode):
(IPC::ArgumentCoder<FloatQuad>::decode):
(IPC::ArgumentCoder<ViewportArguments>::decode):
(IPC::ArgumentCoder<IntPoint>::decode):
(IPC::ArgumentCoder<IntRect>::decode):
(IPC::ArgumentCoder<IntSize>::decode):
(IPC::ArgumentCoder<MimeClassInfo>::decode):
(IPC::ArgumentCoder<PluginInfo>::decode):
(IPC::ArgumentCoder<SelectionRect>::decode):
(IPC::ArgumentCoder<CompositionUnderline>::decode):
(IPC::ArgumentCoder<BlobPart>::decode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
(IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPlatformTouchPoint.cpp:
(WebKit::WebPlatformTouchPoint::decode):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::decode):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::decode):
* UIProcess/API/APIContentRuleListStore.cpp:
(API::decodeContentRuleListMetaData):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::launchProcessWithItem):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::reload):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::takeProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
* WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
(WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::create):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::createGraphicsLayer):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pdfSnapshotAtSize):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::copy):
2019-03-19 Chris Dumez <cdumez@apple.com>
Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
https://bugs.webkit.org/show_bug.cgi?id=194787
<rdar://problem/48175520>
Reviewed by Geoff Garen.
The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
as soon as the WebPage object has been created on the WebProcess side. This part was fine.
However, unregistration from the visitedLinkStores would only happen when either the
visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
WebProcess could stay registered with a visitedLinkStore even after the page that was using it
has been closed, which would lead to such logging.
To address the issue, the WebProcessProxy now keeps track for which pages are using which
visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
using a given visitedLinkStore is closed, the process unregisters itself from the
visitedLinkStore, thus avoiding the bug.
I also simplified a lot the logic for having a page telling the WebProcessProxy it started
using a visitedLinkStore. Previously, it would have to wait until the process is done launching
before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
WebProcess (no matter if the process is still launching or not). At this point, the
WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
until it is done launching before registering itself with the visitedLinkStore.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
(WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::~VisitedLinkStore):
(WebKit::VisitedLinkStore::addProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
(WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::addVisitedLinkStoreUser):
(WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
(WebKit::WebProcessProxy::addWebUserContentControllerProxy):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
(WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
* UIProcess/WebProcessProxy.h:
2019-03-19 Chris Dumez <cdumez@apple.com>
REGRESSION (r243094): internal media test fairplay-hls-error.html is failing
https://bugs.webkit.org/show_bug.cgi?id=195954
<rdar://problem/49005981>
Reviewed by Geoffrey Garen.
TestController::resetStateToConsistentValues() tries to send a "reset" message to its
injected bundle. Part of the "reset" message sets the external hosts that we're allowed
to load. If there is no WebProcess yet when WKPagePostMessageToInjectedBundle() is called,
then this message does not get sent and the allowed hosts do not get set, causing this
test failure.
To address the issue, make sure we launch the initial process if necessary when
WebPageProxy::postMessageToInjectedBundle() is called, in order to maintain backward
compatibility.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::postMessageToInjectedBundle):
2019-03-19 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r243142.
Caused assertion hits in WK2 Debug
Reverted changeset:
"Spew: Unhandled web process message
'VisitedLinkTableController:VisitedLinkStateChanged'"
https://bugs.webkit.org/show_bug.cgi?id=194787
https://trac.webkit.org/changeset/243142
2019-03-19 Daniel Bates <dabates@apple.com>
[iOS] Focus not preserved when switching between tabs
https://bugs.webkit.org/show_bug.cgi?id=195820
<rdar://problem/43614450>
Reviewed by Brent Fulgham.
Fixes a usability annoyance when using a hardware keyboard; focus is not preserved when switching between tabs.
Do not unconditionally tell the WebProcess to blur the currently focused element when the content view (WKContentView)
resigns first responder. Instead only tell it to blur when the content view is resigning because either the
accessory view was dismissed (Done button was pressed) or the keyboard was dismissed (the hide keyboard button
was pressed).
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm: Add new ivar to track whether the content view is resigning
first responder status because the accessory view is being dismissed.
(-[WKContentView resignFirstResponderForWebView]): Only tell WebKit to blur the focused element if we are
resigning because the accessory view is being dismissed or the keyboard was hidden. We continue to do all
other steps when resigning, including hiding the keyboard. Note that by not telling WebKit to blur the
focused element we let it's focus controller manage the focused element with respect to the current
page activation state (i.e. whether the content view is first responder or not). When the content view
becomes the first responder then WebKit's focus controller will be told that the page has become activated
and will tell the UIProcess to focus the currently focused element, which will bring up the keyboard.
(-[WKContentView accessoryDone]): Update state so we know that a subsequent call to resign first responder
was due to the accessory view being dismissed.
2019-03-19 Per Arne Vollan <pvollan@apple.com>
[iOS] Remove overridden rules in sandbox
https://bugs.webkit.org/show_bug.cgi?id=193840
<rdar://problem/47558526>
Reviewed by Brent Fulgham.
On iOS, there are some rules overridden in the same sandbox file. The overridden rules
should be removed.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-19 Timothy Hatcher <timothy@apple.com>
Make WebKit/NSAttributedString.h a public header.
https://bugs.webkit.org/show_bug.cgi?id=195944
Reviewed by Dean Jackson.
* WebKit.xcodeproj/project.pbxproj:
2019-03-19 Chris Dumez <cdumez@apple.com>
Drop NetworkCacheStatistics code
https://bugs.webkit.org/show_bug.cgi?id=195910
Reviewed by Antti Koivisto.
Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::Cache):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::storeRedirect):
(WebKit::NetworkCache::Cache::update):
(WebKit::NetworkCache::Cache::clear):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed.
* NetworkProcess/cache/NetworkCacheStatistics.h: Removed.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::traverseRecordsFiles):
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* Sources.txt:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebKit.xcodeproj/project.pbxproj:
2019-03-19 Chris Dumez <cdumez@apple.com>
Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
https://bugs.webkit.org/show_bug.cgi?id=194787
<rdar://problem/48175520>
Reviewed by Geoffrey Garen.
The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
as soon as the WebPage object has been created on the WebProcess side. This part was fine.
However, unregistration from the visitedLinkStores would only happen when either the
visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
WebProcess could stay registered with a visitedLinkStore even after the page that was using it
has been closed, which would lead to such logging.
To address the issue, the WebProcessProxy now keeps track for which pages are using which
visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
using a given visitedLinkStore is closed, the process unregisters itself from the
visitedLinkStore, thus avoiding the bug.
I also simplified a lot the logic for having a page telling the WebProcessProxy it started
using a visitedLinkStore. Previously, it would have to wait until the process is done launching
before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
WebProcess (no matter if the process is still launching or not). At this point, the
WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
until it is done launching before registering itself with the visitedLinkStore.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
(WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::~VisitedLinkStore):
(WebKit::VisitedLinkStore::addProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
(WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::addVisitedLinkStoreUser):
(WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
(WebKit::WebProcessProxy::addWebUserContentControllerProxy):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
(WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
* UIProcess/WebProcessProxy.h:
2019-03-19 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::NetworkRTCProvider):
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r243132.
Broke GTK build
Reverted changeset:
"Make WTFLogChannelState and WTFLogLevel enum classes"
https://bugs.webkit.org/show_bug.cgi?id=195904
https://trac.webkit.org/changeset/243132
2019-03-19 Antti Koivisto <antti@apple.com>
Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):
No need for special WKTiledBackingView, tiled views now have correct event regions.
2019-03-18 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::NetworkRTCProvider):
2019-03-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243092 and r243096.
https://bugs.webkit.org/show_bug.cgi?id=195926
Caused assertions in tests (Requested by smfr on #webkit).
Reverted changesets:
"Layer with no backing store should still hit-test over a
scroller"
https://bugs.webkit.org/show_bug.cgi?id=195378
https://trac.webkit.org/changeset/243092
"Try to fix Windows build."
https://trac.webkit.org/changeset/243096
2019-03-18 Timothy Hatcher <timothy@apple.com>
WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
https://bugs.webkit.org/show_bug.cgi?id=195916
Reviewed by Tim Horton.
Add direct support for UIColor so it does not try to use the NSSecureCoding path.
This avoids needs to list the classes when decoding the attributes NSDictionary
and matches the macOS NSColor encoder/decoder.
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
(IPC::encodeColorInternal):
(IPC::decodeColorInternal):
(IPC::encodeObject):
(IPC::decodeObject):
2019-03-18 Timothy Hatcher <timothy@apple.com>
Add new NSAttributedString API for converting HTML.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Tim Horton.
* Platform/spi/ios/UIKitSPI.h:
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/NSAttributedString.h: Added.
* UIProcess/API/Cocoa/NSAttributedString.mm: Added.
(-[_WKAttributedStringNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[_WKAttributedStringNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
(-[_WKAttributedStringNavigationDelegate webView:didFailNavigation:withError:]):
(-[_WKAttributedStringNavigationDelegate webView:didFinishNavigation:]):
(+[_WKAttributedStringWebViewCache cache]):
(+[_WKAttributedStringWebViewCache configuration]):
(+[_WKAttributedStringWebViewCache clearConfiguration]):
(+[_WKAttributedStringWebViewCache retrieveOrCreateWebView]):
(+[_WKAttributedStringWebViewCache cacheWebView:]):
(+[_WKAttributedStringWebViewCache resetPurgeDelay]):
(+[_WKAttributedStringWebViewCache purgeSingleWebView]):
(+[_WKAttributedStringWebViewCache purgeAllWebViews]):
(+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):
(+[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:]):
(+[NSAttributedString loadFromHTMLWithFileURL:options:completionHandler:]):
(+[NSAttributedString loadFromHTMLWithString:options:completionHandler:]):
(+[NSAttributedString loadFromHTMLWithData:options:completionHandler:]):
* UIProcess/API/Cocoa/NSAttributedStringPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKErrorInternal.h.
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
(createNSError):
* UIProcess/API/Cocoa/WKErrorInternal.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getContentsAsAttributedString):
2019-03-18 Alex Christensen <achristensen@webkit.org>
Implement DownloadMonitor to prevent long-running slow downloads from background apps
https://bugs.webkit.org/show_bug.cgi?id=195785
Reviewed by Geoffrey Garen.
This is similar to what was updated in <rdar://problem/42677685> but for WebKit Downloads.
To test it I implemented a throttled TCP server, SPI to speed up DownloadMonitor's timer,
and SPI to synthesize the application going into the background and foreground, which
NSNotificationCenter does on iOS.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::didReceiveData):
(WebKit::Download::didFinish):
(WebKit::Download::didFail):
(WebKit::Download::didCancel):
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::applicationEnteredBackground):
(WebKit::Download::applicationEnteredForeground):
(WebKit::Download::manager const):
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::downloadFinished):
(WebKit::DownloadManager::applicationDidEnterBackground):
(WebKit::DownloadManager::applicationWillEnterForeground):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/DownloadMap.cpp:
(WebKit::DownloadMap::values):
* NetworkProcess/Downloads/DownloadMap.h:
* NetworkProcess/Downloads/DownloadMonitor.cpp: Added.
(WebKit::operator _kbps):
(WebKit::timeUntilNextInterval):
(WebKit::DownloadMonitor::DownloadMonitor):
(WebKit::DownloadMonitor::measuredThroughputRate const):
(WebKit::DownloadMonitor::downloadReceivedBytes):
(WebKit::DownloadMonitor::applicationEnteredForeground):
(WebKit::DownloadMonitor::applicationEnteredBackground):
(WebKit::DownloadMonitor::speedMultiplier const):
(WebKit::DownloadMonitor::timerFired):
* NetworkProcess/Downloads/DownloadMonitor.h: Added.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::applicationDidEnterBackground):
(WebKit::NetworkProcess::applicationWillEnterForeground):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _synthesizeAppIsBackground:]):
(-[WKProcessPool _downloadURLRequest:originatingWebView:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplier]):
(-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplier:]):
* UIProcess/Cocoa/DownloadProxyMapCocoa.mm: Added.
(WebKit::DownloadProxyMap::platformCreate):
(WebKit::DownloadProxyMap::platformDestroy):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::DownloadProxyMap):
(WebKit::DownloadProxyMap::~DownloadProxyMap):
(WebKit::DownloadProxyMap::platformCreate):
(WebKit::DownloadProxyMap::platformDestroy):
(WebKit::DownloadProxyMap::applicationDidEnterBackground):
(WebKit::DownloadProxyMap::applicationWillEnterForeground):
(WebKit::DownloadProxyMap::createDownloadProxy):
(WebKit::DownloadProxyMap::downloadFinished):
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::synthesizeAppIsBackground):
(WebKit::NetworkProcessProxy::createDownloadProxy):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::handleDownloadRequest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::createDownloadProxy):
(WebKit::WebProcessPool::synthesizeAppIsBackground):
* UIProcess/WebProcessPool.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleDownloadRequest):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::handleDownloadRequest):
* WebKit.xcodeproj/project.pbxproj:
2019-03-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Native selection views sometimes appear in hidden editable areas after losing focus
https://bugs.webkit.org/show_bug.cgi?id=195894
<rdar://problem/48849989>
Reviewed by Tim Horton.
On certain websites, focus is moved away from an editable element while maintaining a selection inside the
editable element. In the case where the editable element is hidden, this currently breaks our text interaction
suppression heuristics, which suppress text selection gestures and overlays inside focused hidden editable
elements. To fix this, we refactor our text interaction suppression heuristics, such that they are not dependent
on an editable element being focused. See changes below for more details.
Test: editing/selection/ios/hide-selection-in-non-focused-element.html
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Rename elementIsTransparentOrFullyClipped to editableRootIsTransparentOrFullyClipped, and additionally compute
this flag by checking whether the root editable element containing the selection is transparent or clipped,
instead of using the currently focused element.
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
Remove the elementIsTransparentOrFullyClipped flag from FocusedElementInformation (see below for more detail).
* UIProcess/ios/WKContentViewInteraction.h:
Rename FocusedElementIsTransparentOrFullyClipped to EditableRootIsTransparentOrFullyClipped.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Remove logic that currently uses state on FocusedElementInformation to determine whether to suppress platform
text interactions; instead, only use EditorState to make this determination. This logic was originally added in
the initial implementation of the text interaction suppression heuristic as a way to begin suppressing text
selection state before zooming to reveal the focused element; however, since we now zoom to reveal the text
selection when focusing editable elements, zooming is deferred until the next complete EditorState update
arrives in the UI process so we don't need to worry about beginning to suppress text interactions prior to this
initial editor state update.
(-[WKContentView _elementDidBlur]):
(-[WKContentView _updateSelectionAssistantSuppressionState]):
Add a helper method that updates text selection suppression state using the current EditorState.
(-[WKContentView _selectionChanged]):
(-[WKContentView _updateChangedSelection:]):
Always update text suppression state when receiving an EditorState, instead of only doing so when processing a
text selection gesture.
(-[WKContentView _startSuppressingSelectionAssistantForReason:]):
Renamed from _beginSuppressingSelectionAssistantForReason:, to better match "start/end" terminology of
_endSuppressingSelectionAssistantForReason:.
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::editorStateChanged):
Ensure that we run logic to zoom to the focused element *after* updating text selection suppression state, so we
don't erroneously zoom to reveal hidden editable elements.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::getFocusedElementInformation):
2019-03-18 Chris Dumez <cdumez@apple.com>
Delay WebProcess launch until a load is triggered in a Web view
https://bugs.webkit.org/show_bug.cgi?id=195758
<rdar://problem/48126013>
Reviewed by Geoff Garen.
This is achieved by constructing WebPageProxy objects with a WebProcessProxy that is in
terminated state (because it never launched its process). This is convenient because
it is a state that the WebPageProxy supports, which normally happened by the WebProcess
crashes. When trying to do a load, we were already checking if the WebPageProxy's process
was running (via an isValid() check) and we would re-launch the WebProcess if necessary
by calling reattachToWebProcess(). For clarity, given that this state is no longer
indicating that the WebProcess crashed, I renamed isValid() to hasRunningProcess() and
reattachToWebProcess() to launchProcess().
The reason delaying the WebProcess launch until the first load is useful is because it
allows us to leverage the WebProcessCache given that we now know which registrable
domain is going to be loaded in the process.
This is a progression from a power usage standpoint. When it comes to page load time,
it would be a progression if we found a suitable process in the cache. I do not expect
a performance hit when no process is found in the cache because of process prewarming.
* Shared/API/Cocoa/RemoteObjectRegistry.h:
* Shared/API/Cocoa/RemoteObjectRegistry.mm:
(WebKit::m_launchInitialProcessIfNecessary):
(WebKit::RemoteObjectRegistry::sendInvocation):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _processCacheSize]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isValid]):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::setViewExposedRect):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::connect):
(WebKit::InspectorTargetProxy::disconnect):
(WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::sizeDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::~WebBackForwardList):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::unapply):
(WebKit::WebEditCommandProxy::reapply):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::stopLoading const):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::hasRunningProcess const):
(WebKit::WebPageProxy::setUIClient):
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::didAttachToRunningProcess):
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::launchProcessWithItem):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::tryClose):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPageProxy::stopLoading):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::tryRestoreScrollPosition):
(WebKit::WebPageProxy::setControlledByAutomation):
(WebKit::WebPageProxy::setIndicating):
(WebKit::WebPageProxy::setBackgroundColor):
(WebKit::WebPageProxy::setTopContentInset):
(WebKit::WebPageProxy::setUnderlayColor):
(WebKit::WebPageProxy::viewWillStartLiveResize):
(WebKit::WebPageProxy::viewWillEndLiveResize):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::layerHostingModeDidChange):
(WebKit::WebPageProxy::waitForDidUpdateActivityState):
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::clearSelection):
(WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::increaseListLevel):
(WebKit::WebPageProxy::decreaseListLevel):
(WebKit::WebPageProxy::changeListType):
(WebKit::WebPageProxy::setBaseWritingDirection):
(WebKit::WebPageProxy::setNeedsFontAttributes):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
(WebKit::WebPageProxy::setEditable):
(WebKit::WebPageProxy::performDragControllerAction):
(WebKit::WebPageProxy::dragEnded):
(WebKit::WebPageProxy::didStartDrag):
(WebKit::WebPageProxy::dragCancelled):
(WebKit::WebPageProxy::handleMouseEvent):
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleGestureEvent):
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::handleTouchEventAsynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::scrollBy):
(WebKit::WebPageProxy::centerSelectionInVisibleArea):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::setUserAgent):
(WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
(WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
(WebKit::WebPageProxy::setCustomTextEncodingName):
(WebKit::WebPageProxy::setTextZoomFactor):
(WebKit::WebPageProxy::setPageZoomFactor):
(WebKit::WebPageProxy::setPageAndTextZoomFactors):
(WebKit::WebPageProxy::scalePage):
(WebKit::WebPageProxy::scalePageInViewCoordinates):
(WebKit::WebPageProxy::scaleView):
(WebKit::WebPageProxy::windowScreenDidChange):
(WebKit::WebPageProxy::setCustomDeviceScaleFactor):
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
(WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
(WebKit::WebPageProxy::setUseFixedLayout):
(WebKit::WebPageProxy::setFixedLayoutSize):
(WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
(WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
(WebKit::WebPageProxy::listenForLayoutMilestones):
(WebKit::WebPageProxy::setSuppressScrollbarAnimations):
(WebKit::WebPageProxy::setEnableVerticalRubberBanding):
(WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
(WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
(WebKit::WebPageProxy::setPaginationMode):
(WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
(WebKit::WebPageProxy::setPageLength):
(WebKit::WebPageProxy::setGapBetweenPages):
(WebKit::WebPageProxy::setPaginationLineGridEnabled):
(WebKit::WebPageProxy::countStringMatches):
(WebKit::WebPageProxy::replaceMatches):
(WebKit::WebPageProxy::launchInitialProcessIfNecessary):
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getContentsAsAttributedString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::getContentsAsMHTMLData):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::preferencesDidChange):
(WebKit::WebPageProxy::setMediaVolume):
(WebKit::WebPageProxy::setMuted):
(WebKit::WebPageProxy::setMediaCaptureEnabled):
(WebKit::WebPageProxy::stopMediaCapture):
(WebKit::WebPageProxy::stopAllMediaPlayback):
(WebKit::WebPageProxy::suspendAllMediaPlayback):
(WebKit::WebPageProxy::resumeAllMediaPlayback):
(WebKit::WebPageProxy::handleMediaEvent):
(WebKit::WebPageProxy::setVolumeOfMediaElement):
(WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
(WebKit::WebPageProxy::didChooseColor):
(WebKit::WebPageProxy::didEndColorPicker):
(WebKit::WebPageProxy::didSelectOption):
(WebKit::WebPageProxy::inspector const):
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
(WebKit::WebPageProxy::didCancelForOpenPanel):
(WebKit::WebPageProxy::removeEditCommand):
(WebKit::WebPageProxy::processDidBecomeUnresponsive):
(WebKit::WebPageProxy::processDidBecomeResponsive):
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::processWillBecomeSuspended):
(WebKit::WebPageProxy::processWillBecomeForeground):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::setCanRunModal):
(WebKit::WebPageProxy::canRunModal):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::drawPagesForPrinting):
(WebKit::WebPageProxy::updateBackingStoreDiscardableState):
(WebKit::WebPageProxy::setViewLayoutSize):
(WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
(WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
(WebKit::WebPageProxy::setComposition):
(WebKit::WebPageProxy::confirmComposition):
(WebKit::WebPageProxy::cancelComposition):
(WebKit::WebPageProxy::setScrollPinningBehavior):
(WebKit::WebPageProxy::setOverlayScrollbarStyle):
(WebKit::WebPageProxy::changeFontAttributes):
(WebKit::WebPageProxy::changeFont):
(WebKit::WebPageProxy::setTextAsync):
(WebKit::WebPageProxy::insertTextAsync):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::setCompositionAsync):
(WebKit::WebPageProxy::confirmCompositionAsync):
(WebKit::WebPageProxy::takeSnapshot):
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::setUseSystemAppearance):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::setPlaybackTarget):
(WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
(WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
(WebKit::WebPageProxy::clearWheelEventTestTrigger):
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
(WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::setResourceCachingDisabled):
(WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
(WebKit::WebPageProxy::insertAttachment):
(WebKit::WebPageProxy::updateAttachmentAttributes):
(WebKit::WebPageProxy::getApplicationManifest):
(WebKit::WebPageProxy::textInputContextsInRect):
(WebKit::WebPageProxy::focusTextInputContext):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::create):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::maybeShutDown):
* UIProcess/WebProcessProxy.h:
* UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp:
(WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
(WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformDetach):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _hoverGestureRecognizerChanged:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestFocusedElementInformation):
(WebKit::WebPageProxy::updateVisibleContentRects):
(WebKit::WebPageProxy::updateStringForFind):
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
(WebKit::WebPageProxy::setForceAlwaysUserScalable):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
(WebKit::WebPageProxy::setDeviceOrientation):
(WebKit::WebPageProxy::setOverrideViewportArguments):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::selectWithTwoTouches):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
(WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::sizeDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::windowAndViewFramesChanged):
(WebKit::WebPageProxy::setMainFrameIsScrollable):
(WebKit::WebPageProxy::insertDictatedTextAsync):
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPageProxy::fontAtSelection):
(WebKit::WebPageProxy::stringSelectionForPasteboard):
(WebKit::WebPageProxy::dataSelectionForPasteboard):
(WebKit::WebPageProxy::readSelectionFromPasteboard):
(WebKit::WebPageProxy::sendComplexTextInputToPlugin):
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::acceptsFirstMouse):
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformDetach):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::cursorToShow const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
2019-03-18 Antti Koivisto <antti@apple.com>
Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):
No need for special WKTiledBackingView, tiled views now have correct event regions.
2019-03-18 Daniel Bates <dabates@apple.com>
[iOS] No DOM keypress event emitted for cursor key commands when non-editable element is focused
https://bugs.webkit.org/show_bug.cgi?id=195626
<rdar://problem/48810626>
Reviewed by Wenson Hsieh.
Following the UIKit fix <rdar://problem/47333786> WebKit will be asked whether it can perform some
more actions, including cursor movements and more editing actions. All such actions are only applicable
to editable elements. By responding NO to UIKit for such actions when we are not in an editable element
we avoid the need to do such bookkeeping ourselves as UIKit will forward our response back to us
on return from -handleKeyTextCommandForCurrentEvent, called from -[WKContentView _interpretKeyEvent].
WebKit is then in a position to try to handle the event or in the case of all standard text editing
key commands at the time of writing (e.g. Control + a) tell WebCore that it did not handle the event
so that WebCore can continue the DOM key event dispatch algorithm. For standard text editing key
commands, such as Control + a, we will emit a DOM keypress event for the 'a'.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]):
2019-03-18 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Bump public API to wpe-1.0
https://bugs.webkit.org/show_bug.cgi?id=195887
Reviewed by Philippe Normand.
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Renamed from Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt.
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt.
2019-03-18 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Bump dependencies to wpe-1.0 and wpebackend-fdo-1.0
https://bugs.webkit.org/show_bug.cgi?id=195786
Reviewed by Philippe Normand.
* wpe/wpe-web-extension.pc.in: Change dependency to wpe-1.0
* wpe/wpe-webkit.pc.in: Ditto.
2019-03-17 Fujii Hironori <Hironori.Fujii@sony.com>
[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
<rdar://problem/48615720>
Unreviewed build fix for WinCairo.
* Shared/SandboxExtension.h: Use ProcessID instead of pid_t.
2019-03-16 Dean Jackson <dino@apple.com>
ASSERT(gestureRecognizer == _doubleTapGestureRecognizer) in _doubleTapDidFail:
https://bugs.webkit.org/show_bug.cgi?id=195857
<rdar://problem/48954679>
Reviewed by Wenson Hsieh.
Reset an existing gesture recognizer before creating a new one.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
(-[WKContentView _setDoubleTapGesturesEnabled:]):
2019-03-16 Jer Noble <jer.noble@apple.com>
Add a new MediaCapabilitiesExtensionsEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=195843
Reviewed by Geoffrey Garen.
* Shared/WebPreferences.yaml:
2019-03-16 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Software keyboard never appears when editing on some websites
https://bugs.webkit.org/show_bug.cgi?id=195824
<rdar://problem/48020610>
Reviewed by Ryosuke Niwa.
In the scenario where an element has already been programmatically focused but the UI process isn't showing an
input view for it, there are a couple of different ways in which an input view may still be shown for that
element:
1. If the page attempts to programmatically focus the element, we'll invoke elementDidRefocus to recompute
information about the focused element and propagate it to the UI process. By default, if programmatic focus was
triggered under the scope of user interaction, we'll allow the input view to appear.
2. In the case where page does not attempt to programmatically focus the element but a click is dispatched,
there is logic in WebPage::completeSyntheticClick to send information about the already-focused element.
On the web page relevant to this bug, focus is programmatically moved to hidden contenteditable areas upon page
load, and touchstart is also prevented; furthermore, the page does not attempt to programmatically refocus the
hidden editable area upon receiving touchstart. This means that the user will never be able to bring up the
keyboard, since the editable area is already programmatically focused and subsequent attempts to tap in the
page do nothing, because the page has already focused the hidden editable area (with the expectation that the
software keyboard should already be present).
To fix this, we bring some of the same logic in completeSyntheticClick over to dispatchTouchEvent, by sending
focused element information to the UI process if the focused element did not change over the course of
dispatching the touch event. Similar code was introduced in r167774 to fix the same type of issue (i.e.
inability to bring up the software keyboard), but this was later reverted in r188405 due to causing bugs such as
<rdar://problem/22204108>, wherein this logic to bring up the keyboard in dispatchTouchEvent would scroll and
zoom the page, such that the click event fired after touchend would be dispatched in the wrong location and (in
the case of <rdar://problem/22204108>) caused the focused element to immediately blur again.
To mitigate this issue, we add the additional constraint that we only send focused element info in the case
where the touch won't also generate a click later down the road, by requiring that the dispatched event was
handled by the page (i.e. prevented).
Test: fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent):
2019-03-16 Zalan Bujtas <zalan@apple.com>
Unable to close trending window on naver.com.
https://bugs.webkit.org/show_bug.cgi?id=195842
<rdar://problem/48067338>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::dispatchSyntheticMouseMove):
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2019-03-16 Timothy Hatcher <timothy@apple.com>
REGRESSION (r242807): Unified sources build failure from missing imports.
https://bugs.webkit.org/show_bug.cgi?id=195852
Unreviewed speculative build fix.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
Include <wtf/SoftLinking.h> and "UIKitSPI.h" on iOS.
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
Reviewed by Brent Fulgham.
By default, block the iOS accessibility server in the sandbox. If accessibility is enabled,
let the UI process issue a mach extension to the WebContent process. The UI process will
issue the mach extension the the WebContent process by its process identifier. The sandbox
extension handle is sent to the WebContent process to be consumed. The message will be sent
when the WebProcess has finished launching, and also when accessibility is turned on.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* Shared/SandboxExtension.h:
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::create):
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
(WebKit::SandboxExtension::createHandleForMachLookupByPid):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didFinishLaunching):
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::unblockAccessibilityServer):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-03-15 Timothy Hatcher <timothy@apple.com>
Unreviewed speculative build fix for non-Cocoa ports after r243012.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getContentsAsAttributedString):
* UIProcess/WebPageProxy.h:
2019-03-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r243008.
This revision broke High Sierra builders
Reverted changeset:
"[iOS] Block the accessibility server when accessibility is
not enabled."
https://bugs.webkit.org/show_bug.cgi?id=195342
https://trac.webkit.org/changeset/243008
2019-03-15 Per Arne Vollan <pvollan@apple.com>
All networking from WebKit.Networking fails when Network Extension content filter is enabled
https://bugs.webkit.org/show_bug.cgi?id=195815
<rdar://problem/47598758>
Reviewed by Brent Fulgham.
The sandbox needs to allow an associated mach lookup.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2019-03-15 Sihui Liu <sihui_liu@apple.com>
[ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
https://bugs.webkit.org/show_bug.cgi?id=190350
<rdar://problem/45089503>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::addSession):
(WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade): For efficientcy and atomicity, we choose to use
symlink to create v0 folder. Because network process does not have the permission to create a symlink, we need
to do this in UI process. UI process would create v0 folder inside the IndexedDB directory if there isn't one.
Also if there is a v0 directory but it doesn't have content, it means it's not a correct symlink and we need to
delete it and create again.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-03-15 Sihui Liu <sihui_liu@apple.com>
[ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
https://bugs.webkit.org/show_bug.cgi?id=190350
<rdar://problem/45089503>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::addSession):
(WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Restrict iokit-user-client-class "IOHIDLibUserClient" from WebKit
https://bugs.webkit.org/show_bug.cgi?id=195821
<rdar://problem/47606250>
Reviewed by Brent Fulgham.
This should be removed from the WebContent sandbox on iOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-15 Alex Christensen <achristensen@webkit.org>
_WKDownload should conform to NSCopying protocol
https://bugs.webkit.org/show_bug.cgi?id=195718
Reviewed by Tim Horton.
This will allow us to use it as keys in NSMutableDictionaries, which Safari already kind of does.
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload copyWithZone:]):
2019-03-15 Dean Jackson <dino@apple.com>
Provide an option for an always-on fast click mode in iOS
https://bugs.webkit.org/show_bug.cgi?id=195822
<rdar://problem/48939357>
Reviewed by Sam Weinig.
Add an option that will always trigger a click and never
wait for a double tap to zoom. It is disabled by default.
* Shared/WebPreferences.yaml:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
2019-03-15 Timothy Hatcher <timothy@apple.com>
Add support to WebPage for getting the contents as an attributed string.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Tim Horton.
* Shared/mac/AttributedString.h:
(WebKit::AttributedString::AttributedString):
* Shared/mac/AttributedString.mm:
(IPC::ArgumentCoder<WebKit::AttributedString>::encode):
(IPC::ArgumentCoder<WebKit::AttributedString>::decode):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getContentsAsAttributedString):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getContentsAsAttributedString):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=195387
<rdar://problem/48442387>
Reviewed by Brent Fulgham.
The sandbox on iOS and macOS needs to allow mach lookup to the "com.apple.nesessionmanager.content-filter"
mach service. Also, mach lookups to "com.apple.nehelper" should be allowed.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-15 Chris Dumez <cdumez@apple.com>
[PSON] Make sure the WebProcessCache is leverage when relaunching a process after termination
https://bugs.webkit.org/show_bug.cgi?id=195747
Reviewed by Geoff Garen.
Make sure the WebProcessCache and the prewarmed process are used when relaunching a process
after termination (e.g. crash).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForRegistrableDomain):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
* UIProcess/WebProcessPool.h:
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
Reviewed by Brent Fulgham.
By default, block the iOS accessibility server in the sandbox. If accessibility is enabled,
let the UI process issue a mach extension to the WebContent process. The UI process will
issue the mach extension the the WebContent process by its process identifier. The sandbox
extension handle is sent to the WebContent process to be consumed. The message will be sent
when the WebProcess has finished launching, and also when accessibility is turned on.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* Shared/SandboxExtension.h:
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::create):
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
(WebKit::SandboxExtension::createHandleForMachLookupByPid):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didFinishLaunching):
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::unblockAccessibilityServer):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-03-15 Antti Koivisto <antti@apple.com>
Use Region for event region even when it is a rectangle
https://bugs.webkit.org/show_bug.cgi?id=195803
Reviewed by Simon Fraser.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::eventRegion const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setEventRegion):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setEventRegion):
(WebKit::PlatformCALayerRemote::eventRegion const): Deleted.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2019-03-15 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r242952.
Causing API failures on iOS Simulator
Reverted changeset:
"[PSON] Make sure the WebProcessCache is leverage when
relaunching a process after termination"
https://bugs.webkit.org/show_bug.cgi?id=195747
https://trac.webkit.org/changeset/242952
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[macOS] Broker access to Speech Synthesis
https://bugs.webkit.org/show_bug.cgi?id=195645
<rdar://problem/35369026>
Reviewed by Brent Fulgham.
To be able to close the connection to the speech synthesis daemon in the WebContent process,
speech synthesis should be performed in the UI process. This patch forwards speech synthesis
requests to the UI process by sending messages. On the UI process side, the speech synthesis
is performed by simply using the existing platform speech synthesizer. Speech synthesis
events are sent back to the WebContent process. All messages are async, except for the
message to get the list of available voices.
* Sources.txt:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::didStartSpeaking):
(WebKit::WebPageProxy::didFinishSpeaking):
(WebKit::WebPageProxy::didPauseSpeaking):
(WebKit::WebPageProxy::didResumeSpeaking):
(WebKit::WebPageProxy::speakingErrorOccurred):
(WebKit::WebPageProxy::boundaryEventOccurred):
(WebKit::WebPageProxy::voicesDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::ensureSpeechSynthesisData):
(WebKit::WebPageProxy::speechSynthesisVoiceList):
(WebKit::WebPageProxy::speechSynthesisSpeak):
(WebKit::WebPageProxy::speechSynthesisCancel):
(WebKit::WebPageProxy::speechSynthesisPause):
(WebKit::WebPageProxy::speechSynthesisResume):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp: Added.
(WebKit::WebSpeechSynthesisClient::voiceList):
(WebKit::WebSpeechSynthesisClient::speak):
(WebKit::WebSpeechSynthesisClient::cancel):
(WebKit::WebSpeechSynthesisClient::pause):
(WebKit::WebSpeechSynthesisClient::resume):
* WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h: Added.
(WebKit::WebSpeechSynthesisClient::WebSpeechSynthesisClient):
(WebKit::WebSpeechSynthesisClient::~WebSpeechSynthesisClient):
* WebProcess/WebCoreSupport/WebSpeechSynthesisVoice.h: Added.
(WebKit::WebSpeechSynthesisVoice::encode const):
(WebKit::WebSpeechSynthesisVoice::decode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
(WebKit::WebPage::speakingErrorOccurred):
(WebKit::WebPage::boundaryEventOccurred):
(WebKit::WebPage::voicesDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/com.apple.WebProcess.sb.in:
* WebProcess/glib/WebProcessGLib.cpp:
2019-03-15 Antti Koivisto <antti@apple.com>
Optimize Region for single rectangle case
https://bugs.webkit.org/show_bug.cgi?id=195743
Reviewed by Simon Fraser.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<EventTrackingRegions>::decode):
(IPC::ArgumentCoder<Region::Span>::encode): Deleted.
(IPC::ArgumentCoder<Region::Span>::decode): Deleted.
(IPC::ArgumentCoder<Region>::encode): Deleted.
(IPC::ArgumentCoder<Region>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
2019-03-14 Per Arne Vollan <pvollan@apple.com>
[iOS] WebKit crashes when opening pages documents
https://bugs.webkit.org/show_bug.cgi?id=195784
<rdar://problem/48904334>
Reviewed by Brent Fulgham.
The sandbox needs to allow additional syscalls.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-14 Simon Fraser <simon.fraser@apple.com>
Make it possible to test scrolling tree layer manipulation more easily
https://bugs.webkit.org/show_bug.cgi?id=195780
Reviewed by Tim Horton.
Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
cuts off communication of scrolling tree scrolls back to the web process
(in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
allows tests to trigger scrolls which run the scrolling tree layer positioning
logic, but never get another commit from the web process that might mask
scrolling tree bugs.
WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollingUpdatesDisabledForTesting]):
(-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::scrollingUpdatesDisabledForTesting):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::scrollingUpdatesDisabledForTesting):
* UIProcess/PageClient.h:
(WebKit::PageClient::scrollingUpdatesDisabledForTesting):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/WebPageProxy.h:
2019-03-14 Youenn Fablet <youenn@apple.com>
Move IDB storage in private browsing mode to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=195602
Reviewed by Brady Eidson.
Covered by existing IDB tests and added API test.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createIDBServer):
Make sure that path is empty for private sessions.
This will make IDB use a memory backing store.
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
Use NetworkProcess IDB server instead of InProcessIDBServer.
2019-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does not prevent focusing the subframe
https://bugs.webkit.org/show_bug.cgi?id=195749
<rdar://problem/48892367>
Reviewed by Tim Horton.
r242801 added logic to fetch interaction information at the touch location upon touch start. However this,
combined with an existing behavior where the process of computing InteractionInformationAtPosition in WebPage
moves focus into the frame of the hit-tested node below the touch location, means that we'll always trigger a
blur event on the window and move focus into the subframe when performing a touch inside a subframe, even if the
page prevents default on touchstart.
To fix this, add a "readonly" flag to InteractionInformationRequest, and only change focus when requesting
position information in the case where the request is not readonly. For now, this readonly flag is false by
default; in a future patch, we should identify the (hopefully few) places that rely on position information
requests to move focus, explicitly turn this bit off in those places, and otherwise send readonly position
information requests by default.
* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::encode const):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
(WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
Ensure that a readonly request is not valid for a non-readonly request.
* Shared/ios/InteractionInformationRequest.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
Send a readonly position information request in the case where a WebKit SPI client is querying for element
information at the given location.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]):
Send a readonly position information request on touchstart.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::positionInformation):
2019-03-14 Chris Dumez <cdumez@apple.com>
Add WebsitePolicy for the client to specify the device orientation & motion access policy
https://bugs.webkit.org/show_bug.cgi?id=195750
Reviewed by Geoffrey Garen.
Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
the client already knows access to the device motion & orientation API will be granted / denied,
it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
permission is requested by JS.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
(-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
2019-03-14 Timothy Hatcher <timothy@apple.com>
REGRESSION (r242908): TestWebKitAPI.WebKit.AddAndRemoveDataDetectors Crashed
https://bugs.webkit.org/show_bug.cgi?id=195751
Reviewed by Wenson Hsieh.
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::decodeArrayInternal): Added allowedClasses, pass to internal decodeObject for values.
(IPC::decodeDictionaryInternal): Ditto for keys and values.
(IPC::decodeObject): Pass allowedClasses to array and dictionary decoders.
2019-03-14 Chris Dumez <cdumez@apple.com>
[PSON] Make sure the WebProcessCache is leverage when relaunching a process after termination
https://bugs.webkit.org/show_bug.cgi?id=195747
Reviewed by Geoff Garen.
Make sure the WebProcessCache and the prewarmed process are used when relaunching a process
after termination (e.g. crash).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForRegistrableDomain):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
* UIProcess/WebProcessPool.h:
2019-03-14 Timothy Hatcher <timothy@apple.com>
Unreviewed speculative build fix for watchOS after r242908.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2019-03-14 Youenn Fablet <youenn@apple.com>
Reset storage quota when clearing IDB/Cache API entries
https://bugs.webkit.org/show_bug.cgi?id=195716
Reviewed by Chris Dumez.
On clearing DOMCache or IDB data, reset quota value to the default value.
This ensures consistent layout test runs.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::clearStorageQuota):
* NetworkProcess/NetworkProcess.h:
2019-03-13 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
https://bugs.webkit.org/show_bug.cgi?id=195724
<rdar://problem/48873456>
Reviewed by Simon Fraser.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::didPreventDefaultForEvent):
2019-03-13 Wenson Hsieh <wenson_hsieh@apple.com>
Make -[_WKAttachment setFileWrapper:contentType:completion:] robust when given a nil completion handler
https://bugs.webkit.org/show_bug.cgi?id=195725
<rdar://problem/48545062>
Reviewed by Tim Horton.
Add a missing nil check before invoking the given completionHandler in the case where the attachment is invalid.
Tested by augmenting WKAttachmentTests.SetFileWrapperForPDFImageAttachment to exercise this scenario.
* UIProcess/API/APIAttachment.cpp:
(API::Attachment::invalidate):
Additionally make sure that an invalidated _WKAttachment is also considered to be disconnected.
* UIProcess/API/Cocoa/_WKAttachment.mm:
(-[_WKAttachment setFileWrapper:contentType:completion:]):
2019-03-13 Timothy Hatcher <timothy@apple.com>
REGRESSION (r242908): 'NSInvalidArgumentException', reason: '+[PKPaymentMerchantSession count]: unrecognized selector sent to class 0x1c0fae060'
https://bugs.webkit.org/show_bug.cgi?id=195720
Reviewed by Andy Estes.
Add back decode(Decoder& decoder, Class allowedClass) for Apple Pay code.
* Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::decode): Added.
2019-03-13 Tim Horton <timothy_horton@apple.com>
Stop using some deprecated SPI in WKDrawingView
https://bugs.webkit.org/show_bug.cgi?id=195706
<rdar://problem/48062599>
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):
(-[WKDrawingView PNGRepresentation]):
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):
2019-03-13 Timothy Hatcher <timothy@apple.com>
Unreviewed speculative build fix for watchOS after r242908.
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::decodeObject):
2019-03-13 Dean Jackson <dino@apple.com>
Block all plugins smaller than 5x5px
https://bugs.webkit.org/show_bug.cgi?id=195702
<rdar://problem/28435204>
Reviewed by Sam Weinig.
Block all plugins that are smaller than a threshold, in this case
5x5px. Other browsers have implemented this for a while, and now
that we have Intersection Observers, small plugins are no longer
necessary.
* Shared/WebPreferences.yaml: New setting for this feature.
* UIProcess/WebPageProxy.cpp: Handle new unavailability type.
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function
as it was never being called.
(WebKit::WebFrameLoaderClient::recreatePlugin): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::pluginIsSmall): Checks the size of the plugin.
(WebKit::WebPage::createPlugin): If the plugin is too small, stop it from
launching.
2019-03-13 Keith Rollin <krollin@apple.com>
Add support for new StagedFrameworks layout
https://bugs.webkit.org/show_bug.cgi?id=195543
Reviewed by Alexey Proskuryakov.
When creating the WebKit layout for out-of-band Safari/WebKit updates,
use an optional path prefix when called for.
Update the dyld_env path in OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH to
also understand about this layout.
* Configurations/BaseTarget.xcconfig:
2019-03-13 Simon Fraser <simon.fraser@apple.com>
Scrolling tree should reposition non-stacking order descendents of overflow:scroll.
https://bugs.webkit.org/show_bug.cgi?id=195608
Reviewed by Zalan Bujtas.
Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
the values of ScrollPositioningBehavior:
ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
When the overflow scrolls, this layer has to move along with the overflow.
ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
is just a stub so the new node types aren't created yet.
RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStatePositionedNode>::encode):
(ArgumentCoder<ScrollingStatePositionedNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<LayoutConstraints>::encode):
(IPC::ArgumentCoder<LayoutConstraints>::decode):
(IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2019-03-13 Youenn Fablet <youenn@apple.com>
Check IDB quota usage through QuotaManager
https://bugs.webkit.org/show_bug.cgi?id=195302
Reviewed by Chris Dumez.
Set the quota manager getter for IDBServer at creation time.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createIDBServer):
(WebKit::NetworkProcess::idbServer):
* NetworkProcess/NetworkProcess.h:
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
2019-03-13 Timothy Hatcher <timothy@apple.com>
Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Ryosuke Niwa.
Merge the two similar encoders and decoders. This avoids issues where
one encoder could be used and the other decoder, which caused a crash.
It also stops handling NSAttributedString specifically and just uses
the NSSecureCoding path to handle more complex attributes.
Some WebCore encoders code needed to move to platform files, since
ArgumentCodersCocoa.h requires an ObjectiveC++ implementation to work.
* Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::encode):
(IPC::decode):
(IPC::ArgumentCoder<RetainPtr<T>>::encode):
(IPC::ArgumentCoder<RetainPtr<T>>::decode):
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
(IPC::isSerializableFont):
(IPC::isSerializableValue):
(IPC::encodeObject):
(IPC::decodeObject):
* Shared/Cocoa/LoadParametersCocoa.mm:
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::decodePlatformData):
(IPC::ArgumentCoder<WebCore::FontAttributes>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::FontAttributes>::decodePlatformData):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DictionaryPopupInfo>::encode):
(IPC::ArgumentCoder<DictionaryPopupInfo>::decode):
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/ArgumentCodersMac.h: Removed.
* Shared/mac/ArgumentCodersMac.mm: Removed.
* Shared/mac/AttributedString.mm:
(WebKit::AttributedString::encode const):
* Shared/mac/ObjCObjectGraph.mm:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-03-13 Chris Dumez <cdumez@apple.com>
Use a ServiceWorker process per registrable domain
https://bugs.webkit.org/show_bug.cgi?id=195649
Reviewed by Youenn Fablet.
Use a ServiceWorker process per registrable domain instead of one per security origin. This is
more in line with PSON and avoids launching too many processes.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::connectionToContextProcessWasClosed):
(WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
(WebKit::NetworkProcess::serverToContextConnectionForRegistrableDomain):
(WebKit::NetworkProcess::createServerToContextConnection):
(WebKit::NetworkProcess::swContextConnectionMayNoLongerBeNeeded):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::scheduleJobInServer):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcessForExplicitSession):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
2019-03-13 Chris Dumez <cdumez@apple.com>
REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
https://bugs.webkit.org/show_bug.cgi?id=195684
<rdar://problem/48294714>
Reviewed by Antti Koivisto.
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::backForwardAddItem):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2019-03-13 Chris Dumez <cdumez@apple.com>
Drop legacy WebCore::toRegistrableDomain() utility function
https://bugs.webkit.org/show_bug.cgi?id=195637
Reviewed by Geoffrey Garen.
Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
Update call sites to use modern RegistrableDomain type instead.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2019-03-12 Brady Eidson <beidson@apple.com>
Take UnboundedNetworking assertion when a file upload is in progress.
https://bugs.webkit.org/show_bug.cgi?id=195497
Reviewed by Geoff Garen.
This patch implements whole bunch of bookkeeping in both the Networking and UI processes.
The TLDR of that bookkeeping is:
- Whenever any uploads are in progress, take an assertion for both Networking and UI processes.
- Whenever a particular WebProcess has an upload in progress, take an assertion for it.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::setProcessIdentifier):
(WebKit::NetworkConnectionToWebProcess::setConnectionHasUploads):
(WebKit::NetworkConnectionToWebProcess::clearConnectionHasUploads):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoadMap.cpp: Added.
(WebKit::NetworkResourceLoadMap::add):
(WebKit::NetworkResourceLoadMap::remove):
(WebKit::NetworkResourceLoadMap::get const):
* NetworkProcess/NetworkResourceLoadMap.h: Added.
(WebKit::NetworkResourceLoadMap::NetworkResourceLoadMap):
(WebKit::NetworkResourceLoadMap::isEmpty const):
(WebKit::NetworkResourceLoadMap::contains const):
(WebKit::NetworkResourceLoadMap::begin):
(WebKit::NetworkResourceLoadMap::values):
* NetworkProcess/NetworkSession.cpp:
* Scripts/webkit/messages.py:
* Sources.txt:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::takeUploadAssertion):
(WebKit::NetworkProcessProxy::clearUploadAssertion):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setWebProcessHasUploads):
(WebKit::WebProcessPool::clearWebProcessHasUploads):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):
2019-03-13 Chris Dumez <cdumez@apple.com>
Use new RegistrableDomain type in PSON code
https://bugs.webkit.org/show_bug.cgi?id=195634
Reviewed by Youenn Fablet.
Use new RegistrableDomain type in PSON code instead of more error-prone String type.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::canCacheProcess const):
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::clearAllProcessesForSession):
* UIProcess/WebProcessCache.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::addProcessToOriginCacheSet):
(WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
(WebKit::WebProcessPool::didCollectPrewarmInformation):
(WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::didCollectPrewarmInformation):
(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::registrableDomain const):
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::sendPrewarmInformation):
2019-03-13 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][PlayStation] Remove WebCore::standardUserAgentForURL
https://bugs.webkit.org/show_bug.cgi?id=195662
Reviewed by Ryosuke Niwa.
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::platformUserAgent const): Return an empty string as well as mac/ios ports.
2019-03-12 Ross Kirsling <ross.kirsling@sony.com>
[Win] Fix a slew of simple clang-cl warnings.
https://bugs.webkit.org/show_bug.cgi?id=195652
Reviewed by Don Olmstead.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): -Wswitch
* Platform/IPC/win/ConnectionWin.cpp:
(IPC::Connection::readEventHandler): -Wunused-variable
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString): -Wwritable-strings
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess): -Wunused-variable
2019-03-12 Ryosuke Niwa <rniwa@webkit.org>
Move the code for determining the need for touch bar quirks to Quirks class
https://bugs.webkit.org/show_bug.cgi?id=195654
Reviewed by Brent Fulgham.
Moved the code to determine whether touch bar quirks are needed or not to WebCore.
Also renamed HiddenContentEditableQuirk to IsTouchBarUpdateSupressedForHiddenContentEditable
and PlainTextQuirk to NeverRichlyEditableForTouchBar.
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::isRichlyEditableForTouchBar): Renamed.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTouchBar):
(WebKit::WebViewImpl::candidateListTouchBarItem const):
(WebKit::WebViewImpl::isRichlyEditableForTouchBar const): Renamed from isRichlyEditable.
(WebKit::WebViewImpl::textTouchBar const):
(WebKit::WebViewImpl::updateTextTouchBar):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIsTouchBarUpdateSupressedForHiddenContentEditable): Renamed from
setNeedsHiddenContentEditableQuirk.
(WebKit::WebPageProxy::setIsNeverRichlyEditableForTouchBar): Renamed from setNeedsPlainTextQuirk.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isTouchBarUpdateSupressedForHiddenContentEditable const): Renamed from
needsHiddenContentEditableQuirk.
(WebKit::WebPageProxy::isNeverRichlyEditableForTouchBar const): Renamed from needsPlainTextQuirk.
* UIProcess/WebPageProxy.messages.in: Renamed the IPC messages.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::needsHiddenContentEditableQuirk): Deleted. Moved to WebCore.
(WebKit::needsPlainTextQuirk): Deleted. Moved to WebCore.
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage):
2019-03-12 Jiewen Tan <jiewen_tan@apple.com>
Add WebFrameProxy::loadData
https://bugs.webkit.org/show_bug.cgi?id=195647
<rdar://problem/48826856>
Reviewed by Youenn Fablet.
This patch adds WebFrameProxy::loadData which is a simplified version of WebPageProxy::loadData that
loads substitute data to an iframe. This is needed by the Load Optimizer.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadData):
* UIProcess/WebFrameProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataInFrame):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-03-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Input view sometimes flickers when blurring and refocusing an element
https://bugs.webkit.org/show_bug.cgi?id=195639
<rdar://problem/48735337>
Reviewed by Tim Horton.
On iOS, if a focused element is blurred and immediately refocused in the scope of user interaction, we will end
up reloading interaction state (input views, autocorrection contexts, etc.) in the UI process. On certain well-
trafficked websites, this results in the input view and input accessory view flickering (or more egregiously,
scrolling to re-reveal the focused element) when changing selection.
To fix the issue, this patch refactors some focus management logic to suppress sending focused element updates
to the UI process in the case where the same element is being blurred and immediately refocused. To do this, we
track the most recently blurred element and bail when the recently blurred element is identical to the newly
focused element. See below for more detail.
Test: fast/forms/ios/keyboard-stability-when-refocusing-element.html
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
Update the web process' notion of whether an input view is showing. Importantly, this accounts for decisions
made by _WKUIDelegate. See below for more details.
(isAssistableInputType): Deleted.
Removed this helper function; this was only used in one place as a sanity check that the focused element's type
is not none, right before attempting to show an input view. Instead, we can just check the focused element's
type directly against InputType::None in the if statement of the early return.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
Add a hook to notify the web process when an input view is showing or not (see below for more detail).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::elementDidRefocus):
(WebKit::WebPage::shouldDispatchUpdateAfterFocusingElement const):
Add a helper to determine whether we notify the UI process about a newly focused element. On macOS, this is true
only when the new focused element is neither the currently focused element, nor the focused element that was
just blurred. On iOS, we have an additional constraint that when the input view is not showing, we still need to
notify the UI process, since the UI process might want to begin showing the keyboard for an element that has
only been programmatically focused, for which we aren't currently showing the input view.
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::elementDidBlur):
Replace a couple of existing member variables in WebPage used for focus management:
- Replace m_hasPendingBlurNotification with m_recentlyBlurredElement, a RefPtr to the Element that is being
blurred. Behavior here is the same as before (i.e. having a pending blur notification is equivalent to
having recently blurred a focused element). However, this allows us to check newly focused elements against
the recently blurred element in WebPage::elementDidFocus().
- Replace m_isFocusingElementDueToUserInteraction with m_isShowingInputViewForFocusedElement. The flag
m_isFocusingElementDueToUserInteraction was originally added to fix <webkit.org/b/146735>, by ensuring that
we don't send redundant ElementDidFocus (formerly, StartAssistingNode) messages to the UI process even when
the keyboard is already up. In these simpler times, user interaction when focusing an element was equivalent
to showing an input view for the focused element. However, in today's world, there are a variety of reasons
why we might or might not show an input view for a given element (including, but not limited to activity
state changes and decisions made by _WKInputDelegate). As such, it doesn't make sense to continue relying on
m_isFocusingElementDueToUserInteraction in this early return. Instead, have the UI process propagate a
message back to the web process, to let it know whether there is a keyboard showing, and use this flag
instead.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setIsShowingInputViewForFocusedElement):
2019-03-12 Tim Horton <timothy_horton@apple.com>
More attempts at build fixing.
* UIProcess/ios/WKActionSheetAssistant.mm:
Yet more.
2019-03-12 Chris Dumez <cdumez@apple.com>
Device Orientation access permission should be denied unless explicitly granted by the client
https://bugs.webkit.org/show_bug.cgi?id=195625
Reviewed by Youenn Fablet.
Device Orientation access permission should be denied unless explicitly granted by the client.
Previously, it was granted by default.
* UIProcess/API/APIUIClient.h:
(API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
2019-03-12 Antti Koivisto <antti@apple.com>
[iOS] Enable asynchronous frame scrolling by default
https://bugs.webkit.org/show_bug.cgi?id=195622
<rdar://problem/48658028>
Reviewed by Simon Fraser
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-03-12 Per Arne Vollan <pvollan@apple.com>
[iOS] Block access to backboardd service
https://bugs.webkit.org/show_bug.cgi?id=195484
Reviewed by Brent Fulgham.
This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
backlight level in the WebContent process will initiate a connection with this service. To be able to
block the service, the backlight level is queried in the UI process and sent to the WebContent process
when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
the method getting the backlight level is swizzled to return the value sent from the UI process.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::displayBrightness):
(WebKit::WebProcessPool::backlightLevelDidChangeCallback):
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::currentBacklightLevel):
(WebKit::WebProcess::backlightLevelDidChange):
2019-03-12 Tim Horton <timothy_horton@apple.com>
Fix the build after 242801
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _elementActionForDDAction:]):
More.
2019-03-12 Tim Horton <timothy_horton@apple.com>
Fix the build after 242801
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _elementActionForDDAction:]):
2019-03-12 Eric Carlson <eric.carlson@apple.com>
[iOS] Sandbox must allow mach lookup required to compress video
https://bugs.webkit.org/show_bug.cgi?id=195627
<rdar://problem/48811072>
Reviewed by Youenn Fablet.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-12 Jennifer Moore <jennifer.moore@apple.com>
Check whether to launch a default action instead of action sheet
https://bugs.webkit.org/show_bug.cgi?id=195225
<rdar://problem/47715544>
Reviewed by Daniel Bates and Tim Horton.
Notify DataDetectors at the start of a touch on a link, and check whether to immediately
launch the default action instead of an action sheet.
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant interactionDidStart]):
(-[WKActionSheetAssistant _createSheetWithElementActions:defaultTitle:showLinkTitle:]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):
(-[WKActionSheetAssistant showDataDetectorsSheet]):
(-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]):
:
2019-03-12 Zalan Bujtas <zalan@apple.com>
[Synthetic Click] Dispatch mouseout soon after mouseup
https://bugs.webkit.org/show_bug.cgi?id=195575
<rdar://problem/47093049>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
2019-03-12 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Stop content change observation when the touch event turns into long press
https://bugs.webkit.org/show_bug.cgi?id=195601
<rdar://problem/48796324>
Reviewed by Wenson Hsieh.
Add didRecognizeLongPress() message to be able to cancel content observation (started at touchStart).
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _longPressRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didRecognizeLongPress):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didRecognizeLongPress):
2019-03-11 Andy Estes <aestes@apple.com>
[Mac] Ensure Apple Pay is unavailable when PassKit.framework is missing
https://bugs.webkit.org/show_bug.cgi?id=195583
<rdar://problem/48420224>
Reviewed by Daniel Bates.
PassKit.framework is optionally soft-linked on Mac because it is missing from the Recovery
Partition. We need to check if the framework is available before calling into it.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
(WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2019-03-12 Antti Koivisto <antti@apple.com>
Compositing layer that renders two positioned elements should not hit test
https://bugs.webkit.org/show_bug.cgi?id=195371
<rdar://problem/48649586>
Reviewed by Simon Fraser.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
Pass event region to UI process.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::layerID const):
(WebKit::RemoteLayerTreeNode::eventRegion const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::~RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::setEventRegion):
Maintain event region in RemoteLayerTreeNodes.
(WebKit::RemoteLayerTreeNode::initializeLayer):
(WebKit::RemoteLayerTreeNode::layerID):
(WebKit::RemoteLayerTreeNode::forCALayer):
Move layerID to RemoteLayerTreeNode and store RemoteLayerTreeNode pointer to CALayers instead.
This makes it easy to find the matching RemoteLayerTreeNode from a layer, globally.
(WebKit::RemoteLayerTreeNode::setLayerID): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):
If we have event region, use it for hit testing.
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
(collectDescendantViewsAtPoint): Deleted.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::eventRegion const):
(WebKit::PlatformCALayerRemote::setEventRegion):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2019-03-12 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE][GTK] Load events may occur in unexpected order when JS redirects page before subresource load finishes
https://bugs.webkit.org/show_bug.cgi?id=194131
Reviewed by Michael Catanzaro.
Ensure we emit the load-failed and load-changed with finished event when there's still an ongoing load when a
new provisional load strarts. Previous load fails with cancelled error.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewWillStartLoad): Call webkitWebViewLoadFailed() if current page load state is not finished.
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call webkitWebViewWillStartLoad().
* UIProcess/API/wpe/APIViewClient.h:
(API::ViewClient::willStartLoad): Add willStartLoad() to API::ViewClient
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call WPEView::willStartLoad().
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::willStartLoad): Call API::ViewClient::willStartLoad().
* UIProcess/API/wpe/WPEView.h:
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::isProvisional const):
(WebKit::PageLoadState::isCommitted const):
(WebKit::PageLoadState::isFinished const):
2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242763.
Causes layout test crashes on iOS simulator
Reverted changeset:
"[Synthetic Click] Dispatch mouseout soon after mouseup"
https://bugs.webkit.org/show_bug.cgi?id=195575
https://trac.webkit.org/changeset/242763
2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
Add Optional to Forward.h.
https://bugs.webkit.org/show_bug.cgi?id=195586
Reviewed by Darin Adler.
* Shared/RTCNetwork.cpp:
* Shared/RTCNetwork.h:
* Shared/RTCPacketOptions.cpp:
* Shared/RTCPacketOptions.h:
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
Remove unnecessary includes from headers.
2019-03-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242745 and r242756.
https://bugs.webkit.org/show_bug.cgi?id=195606
Breaks internal builds (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[iOS] Block access to backboardd service"
https://bugs.webkit.org/show_bug.cgi?id=195484
https://trac.webkit.org/changeset/242745
"Unreviewed build fix after r242745."
https://trac.webkit.org/changeset/242756
2019-03-11 Fujii Hironori <Hironori.Fujii@sony.com>
[CoordinatedGraphics] ASSERTION FAILED: !m_state.isSuspended
https://bugs.webkit.org/show_bug.cgi?id=195550
Reviewed by Carlos Garcia Campos.
CompositingRunLoop::suspend() locks a mutex and stops the update
timer. But, the timer can be fired after the lock was acquired and
before the timer is stopped.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::updateTimerFired): Removed the
assertion. Return early if m_state.isSuspended.
2019-03-11 Per Arne Vollan <pvollan@apple.com>
[macOS] Remove the Kerberos rules from the WebContent sandbox
https://bugs.webkit.org/show_bug.cgi?id=195464
<rdar://problem/35369230>
Reviewed by Brent Fulgham.
Kerberos auth is done in the UIProcess or NetworkProcess now.
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-11 Per Arne Vollan <pvollan@apple.com>
[iOS] Add entitlement to enable use of graphics endpoint with limited capabilities
https://bugs.webkit.org/show_bug.cgi?id=195582
<rdar://problem/36082379>
Reviewed by Brent Fulgham.
This is a QuartzCore endpoint with a minimal set of capabilities.
* Configurations/WebContent-iOS.entitlements:
2019-03-11 John Wilander <wilander@apple.com>
Move NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm functionality into UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=195117
<rdar://problem/48448715>
Reviewed by Brent Fulgham.
Reading of user defaults on Cocoa platforms should be done in the UI process and
forwarded to Resource Load Statistics in the network process through the
WebKit::NetworkSessionCreationParameters struct.
This patch does away with some old user defaults we don't use anymore. It also
changes the developer-facing default name to ITPManualPrevalentResource.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
Removed the call to the old registerUserDefaultsIfNeeded().
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
Removed the call to the old registerUserDefaultsIfNeeded().
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
Removed the declaration of the old registerUserDefaultsIfNeeded().
* NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Removed.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
Added an enum class EnableResourceLoadStatisticsDebugMode.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
The struct now has two new fields:
- enableResourceLoadStatisticsDebugMode
- resourceLoadStatisticsManualPrevalentResource
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Forwarding of the parameters.
* SourcesCocoa.txt:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
Forwarding of the parameters.
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
This is where user defaults for Resource Load Statistics are now read.
* WebKit.xcodeproj/project.pbxproj:
2019-03-11 Zalan Bujtas <zalan@apple.com>
[Synthetic Click] Dispatch mouseout soon after mouseup
https://bugs.webkit.org/show_bug.cgi?id=195575
<rdar://problem/47093049>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
2019-03-11 Tim Horton <timothy_horton@apple.com>
API test WebKit.RequestTextInputContext fails on iOS
https://bugs.webkit.org/show_bug.cgi?id=195585
Reviewed by Wenson Hsieh and Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _convertRectFromRootViewCoordinates:]):
(-[WKWebView _convertRectToRootViewCoordinates:]):
(-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
(-[WKWebView _focusTextInputContext:completionHandler:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::elementRectInRootViewCoordinates):
(WebKit::WebPage::textInputContextsInRect):
(WebKit::elementRectInWindowCoordinates): Deleted.
Text input context SPI should be in terms of WKWebView coordinates,
for consistency's sake. This is a bit irritating; WebPage(Proxy) continue
to operate in "root view" coordinates, which means different things
depending on if delegatesScrolling is true or not. So, WKWebView does
the conversion, re-creating objects as needed.
2019-03-09 Jiewen Tan <jiewen_tan@apple.com>
Optimizing loads when creating new pages
https://bugs.webkit.org/show_bug.cgi?id=195516
<rdar://problem/48738086>
Reviewed by Darin Adler.
This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
API::NavigationAction to the load optimizer instead of the request within.
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryOptimizingLoad):
(WebKit::tryInterceptNavigation):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::tryOptimizingLoad):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
2019-03-11 Dean Jackson <dino@apple.com>
[iOS] Implement a faster click detection that intercepts double-tap-to-zoom if possible
https://bugs.webkit.org/show_bug.cgi?id=195473
<rdar://problem/48718396>
Reviewed by Wenson Hsieh (with some help from Dan Bates).
Adds a new algorithm, behind a flag FasterClicksEnabled, that can trigger a click
event without waiting to see if a double tap will occur. It does this by examining
the amount of zoom that would be triggered if it was a double tap, and if that value
doesn't exceed a set threshold, commits to the click event instead.
This is implemented by having the Web Process respond to the potential click with
some geometry information. If the UI Process receives the information before the
second tap in a double tap, it can decide to trigger a click.
* Shared/WebPreferences.yaml: New internal feature so this can be toggled in
a UI for testing.
* SourcesCocoa.txt: Renamed WKSyntheticTapGestureRecognizer.
* WebKit.xcodeproj/project.pbxproj: Ditto.
* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
(-[WKSyntheticTapGestureRecognizer setGestureIdentifiedTarget:action:]):
(-[WKSyntheticTapGestureRecognizer setGestureFailedTarget:action:]):
(-[WKSyntheticTapGestureRecognizer setResetTarget:action:]):
(-[WKSyntheticTapGestureRecognizer setState:]):
(-[WKSyntheticTapGestureRecognizer reset]): Renamed WKSyntheticClickTapGestureRecognizer to
WKSyntheticTapGestureRecognizer, changed the signature of the main function to be a bit
more clear about what it does, and added a gesture failed target.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initialScaleFactor]):
(-[WKWebView _contentZoomScale]):
(-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
Exposed the initial content scale, the current scale and added a declaration that
was missing from the .h.
* UIProcess/WebPageProxy.messages.in: Add a new message,
HandleSmartMagnificationInformationForPotentialTap, to
communicate the geometry of the clicked node to the UI Process.
* UIProcess/PageClient.h: Pure virtual function for the geometry message response.
* UIProcess/WebPageProxy.h: Ditto.
* UIProcess/ios/PageClientImplIOS.h: Calls into the WKContentView.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap):
* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::calculatePotentialZoomParameters): A new method that
asks the WKContentView to work out what the zoom factor will be for a potential double
tap at a location.
(WebKit::SmartMagnificationController::smartMagnificationTargetRectAndZoomScales): New implementation
of this function to avoid multiple out-arguments.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _initialScaleFactor]):
(-[WKContentView _contentZoomScale]):
(-[WKContentView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
Exposed the initial content scale, the current scale and the target zoom scale. These
all just call into the WKWebView implementation.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Use a WKSyntheticTapGestureRecognizer instead
of a generic one, so we can capture the failure.
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:origin:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
New method that responds to the incoming Web Process message, and decides if any
potential zoom would be "significant".
(-[WKContentView _singleTapIdentified:]):
(-[WKContentView _doubleTapDidFail:]):
(-[WKContentView _didCompleteSyntheticClick]):
(-[WKContentView _singleTapRecognized:]):
(-[WKContentView _doubleTapRecognized:]):
Add some release logging.
(-[WKContentView _singleTapCommited:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::potentialTapAtPosition):
(WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Removed an unused parameter from the existing message.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::potentialTapAtPosition): Calculates the geometry of the element
if requested, and sends it to the UIProcess.
2019-03-11 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix after r242745.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
2019-03-11 Chris Dumez <cdumez@apple.com>
Assert in WebPageProxy::suspendCurrentPageIfPossible()
https://bugs.webkit.org/show_bug.cgi?id=195506
<rdar://problem/48733477>
Reviewed by Alex Christensen.
The crash was caused by the top-hit preloading logic in MobileSafari which creates a new Web view that is *related*
to the previous one, restores the session state onto it and then triggers a load in this new Web view.
Initially, the 2 Web views use the same process as they are related. However, if the new load's URL is cross-site
with regards to the first view's URL, then we decide to process swap in the new view. This process swap makes
sense from a security standpoint. However, when we commit the load in the new process and call
suspendCurrentPageIfPossible() we end up in an unexpected state because we have a fromItem (due to the session
state having been restored on the new view) but we haven't committed any load yet in this new view.
To address the issue, suspendCurrentPageIfPossible() now returns early and does not attempt to suspend anything
if we have not committed any load yet.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
Do not attempt to suspend to current page if we have not committed any provisional load yet.
2019-03-11 Chris Dumez <cdumez@apple.com>
Update device orientation & motion permission native SPI as per latest proposal
https://bugs.webkit.org/show_bug.cgi?id=195567
Reviewed by Youenn Fablet.
The native SPI is now:
+- (void)_webView:(WKWebView *)webView shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:(WKFrameInfo *)frameInfo decisionHandler:(void (^)(BOOL))decisionHandler;
* UIProcess/API/APIUIClient.h:
(API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebPage/WebPage.h:
2019-03-11 Andy Estes <aestes@apple.com>
[Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
https://bugs.webkit.org/show_bug.cgi?id=195530
<rdar://problem/48747164>
Reviewed by Alex Christensen.
* Configurations/Network-iOS.entitlements: Added the 'com.apple.payment.all-access'
entitlement and reordered the others.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage): Forwarded
WebPaymentCoordinatorProxy messages to the payment coordinator.
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): Ditto.
(WebKit::NetworkConnectionToWebProcess::didClose): Set m_paymentCoordinator to nullptr.
* NetworkProcess/NetworkConnectionToWebProcess.h: Inherited from
WebPaymentCoordinatorProxy::Client and added a unique_ptr<WebPaymentCoordinatorProxy> member.
* NetworkProcess/cocoa/NetworkSessionCocoa.h: Declared getters for source application bundle
and secondary identifiers, and CTDataConnectionServiceType on iOS.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::sourceApplicationBundleIdentifier const): Defined getter.
(WebKit::NetworkSessionCocoa::sourceApplicationSecondaryIdentifier const): Ditto.
(WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Ditto.
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Initialized
m_sourceApplicationBundleIdentifier and m_sourceApplicationSecondaryIdentifier with
corresponding NetworkSessionCreationParameters.
* NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: Added.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinator): Added. Returns
m_paymentCoordinator after lazily initializing it.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorConnection): Added. Returns the
connection to the web process.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorPresentingViewController): Added.
Returns nil.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
Added. Returns the value from the network session identified by sessionID.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationBundleIdentifier):
Ditto.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationSecondaryIdentifier):
Ditto.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter): Added.
Returns a new PaymentAuthorizationController.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Added empty
definition. NetworkConnectionToWebProcess explicitly forwards WebPaymentCoordinatorProxy
messages to its payment coordinator, so there's no need to register with a MessageReceiverMap.
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Ditto.
* Platform/ios/PaymentAuthorizationController.h: Added. Declares a
PaymentAuthorizationPresenter subclass based on PKPaymentAuthorizationController.
* Platform/ios/PaymentAuthorizationController.mm: Added.
(-[WKPaymentAuthorizationControllerDelegate initWithRequest:presenter:]):
Initialized WKPaymentAuthorizationDelegate with request and presenter.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationControllerDidFinish:]):
Forwarded call to WKPaymentAuthorizationDelegate.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didAuthorizePayment:handler:]):
Ditto.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingMethod:handler:]):
Ditto.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingContact:handler:]):
Ditto.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectPaymentMethod:handler:]):
Ditto.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:willFinishWithError:]):
Ditto.
(-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didRequestMerchantSession:]):
Ditto.
(WebKit::PaymentAuthorizationController::PaymentAuthorizationController):
Initialized m_controller with a new PKPaymentAuthorizationController and m_delegate with a
new WKPaymentAuthorizationControllerDelegate.
(WebKit::PaymentAuthorizationController::platformDelegate): Returned m_delegate.
(WebKit::PaymentAuthorizationController::dismiss): Dismissed the controller, set its
delegates to nil, set m_controller to nil, invalidated the delegate, and set m_delegate to
nil.
(WebKit::PaymentAuthorizationController::present): Called -presentWithCompletion: on the
controller, forwarding the passed-in completion handler.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Allowed PassKit to look up
the "com.apple.passd.in-app-payment" and "com.apple.passd.library" service endpoints.
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Changed to call
paymentCoordinatorAddMessageReceiver.
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Changed to call
paymentCoordinatorRemoveMessageReceiver.
(WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Deleted.
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Passed sessionID to
platformCanMakePaymentsWithActiveCard.
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Stored destinationID and passed
sessionID to platformShowPaymentUI.
(WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Changed to account for new
behavior of didCancelPaymentSession.
(WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Changed to call hidePaymentUI.
(WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Changed to only call hidePaymentUI
when didReachFinalState is true, since didCancelPaymentSession is called otherwise.
(WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Cleared m_destinationID.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h: Added m_destionationID member.
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Changed
CanMakePaymentsWithActiveCard and ShowPaymentUI messages to take destinationID and sessionID
arguments.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Passed
sessionID to paymentCoordinatorSourceApplicationSecondaryIdentifier.
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Passed sessionID to various
m_client call sites.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
platformPaymentRequest.
(WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
before calling dismiss.
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
platformPaymentRequest.
(WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
before calling dismiss.
* Shared/WebPreferences.yaml: Added ApplePayRemoteUIEnabled as an internal preference.
* SourcesCocoa.txt: Added NetworkConnectionToWebProcessIOS.mm and
PaymentAuthorizationController.mm.
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::messageReceiverMap): Deleted.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::paymentCoordinatorConnection): Moved from WebPageProxy.cpp.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::paymentCoordinatorConnection): Moved to WebPageProxyCocoa.mm.
(WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Asserted that
sessionID equals the website data store's sessionID.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::networkProcessConnectionClosed): Added. Cancels the current
session if Apple Pay Remote UI is enabled and the network process connection closes.
(WebKit::WebPaymentCoordinator::availablePaymentNetworks): Changed to account for
WebPaymentCoordinator being an IPC::MessageSender.
(WebKit::WebPaymentCoordinator::canMakePayments): Ditto.
(WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): Ditto.
(WebKit::WebPaymentCoordinator::openPaymentSetup): Ditto.
(WebKit::WebPaymentCoordinator::showPaymentUI): Ditto.
(WebKit::WebPaymentCoordinator::completeMerchantValidation): Ditto.
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection): Ditto.
(WebKit::WebPaymentCoordinator::completeShippingContactSelection): Ditto.
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection): Ditto.
(WebKit::WebPaymentCoordinator::completePaymentSession): Ditto.
(WebKit::WebPaymentCoordinator::abortPaymentSession): Ditto.
(WebKit::WebPaymentCoordinator::cancelPaymentSession): Ditto.
(WebKit::WebPaymentCoordinator::messageSenderConnection const): Added. Returns a connection
to the network process if Apple Pay Remote UI is enabled. Otherwise, returned the web
process's parent connection.
(WebKit::WebPaymentCoordinator::messageSenderDestinationID const): Added. Returns the web
page's ID.
(WebKit::WebPaymentCoordinator::remoteUIEnabled const): Added. Calls Settings::applePayRemoteUIEnabled.
* WebProcess/ApplePay/WebPaymentCoordinator.h: Inherited from IPC::MessageSender.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage): Forwarded WebPaymentCoordinator
messages to the payment coordinator of the web page matching the decoder's destination ID.
(WebKit::NetworkProcessConnection::didReceiveSyncMessage): Ditto for sync messages.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::paymentCoordinator): Added a payment coordinator getter.
* WebProcess/WebPage/WebPage.h: Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed): Called
WebPaymentCoordinator::networkProcessConnectionClosed when the network process connection
closes.
2019-03-11 Per Arne Vollan <pvollan@apple.com>
[iOS] Block access to backboardd service
https://bugs.webkit.org/show_bug.cgi?id=195484
Reviewed by Brent Fulgham.
This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
backlight level in the WebContent process will initiate a connection with this service. To be able to
block the service, the backlight level is queried in the UI process and sent to the WebContent process
when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
the method getting the backlight level is swizzled to return the value sent from the UI process.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::displayBrightness):
(WebKit::WebProcessPool::backlightLevelDidChangeCallback):
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::currentBacklightLevel):
(WebKit::WebProcess::backlightLevelDidChange):
2019-03-11 Brent Fulgham <bfulgham@apple.com>
Remove obsolete runtime flag for StorageAccess API Prompt
https://bugs.webkit.org/show_bug.cgi?id=195564
<rdar://problem/37279014>
Reviewed by Chris Dumez.
This bug tracks the work of removing the obsolete flag that had been used to optionally
prevent display of the StorageAccess API prompt. We have since shipped the final version
of this feature with an always-on prompt, and should have removed this runtime flag.
No test changes because this has no change in behavior. Tests already assume the prompt
behavior, and did not test turning the flag off.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::debugModeEnabled const):
(WebKit::ResourceLoadStatisticsStore::storageAccessPromptsEnabled const): Deleted.
(WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::requestStorageAccessGranted):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetStorageAccessPromptsEnabled): Deleted.
(WKPreferencesGetStorageAccessPromptsEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _storageAccessPromptsEnabled]): Deleted.
(-[WKPreferences _setStorageAccessPromptsEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageAccess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::requestStorageAccess):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestStorageAccess):
2019-03-11 Alex Christensen <achristensen@webkit.org>
Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
https://bugs.webkit.org/show_bug.cgi?id=195511
<rdar://problem/44873269>
Reviewed by Darin Adler.
* NetworkProcess/NetworkContentRuleListManager.cpp:
(WebKit::NetworkContentRuleListManager::addContentRuleLists):
* NetworkProcess/NetworkContentRuleListManager.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
(WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* Shared/WebCompiledContentRuleList.cpp:
(WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
(WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
(WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
(WebKit::WebCompiledContentRuleList::actions const):
* Shared/WebCompiledContentRuleList.h:
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::size const):
(WebKit::WebCompiledContentRuleListData::dataPointer const):
(WebKit::WebCompiledContentRuleListData::encode const):
(WebKit::WebCompiledContentRuleListData::decode):
* Shared/WebCompiledContentRuleListData.h:
(WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
* UIProcess/API/APIContentRuleList.cpp:
(API::ContentRuleList::usesCopiedMemory const):
* UIProcess/API/APIContentRuleList.h:
* UIProcess/API/APIContentRuleListStore.cpp:
(API::getData):
(API::decodeContentRuleListMetaData):
(API::ContentRuleListStore::readContentsOfFile):
(API::MappedOrCopiedData::dataPointer const):
(API::openAndMapOrCopyContentRuleList):
(API::compiledToFile):
(API::createExtension):
(API::ContentRuleListStore::lookupContentRuleList):
(API::ContentRuleListStore::compileContentRuleList):
(API::ContentRuleListStore::getContentRuleListSource):
(API::openAndMapContentRuleList): Deleted.
* UIProcess/API/APIContentRuleListStore.h:
* UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
(API::ContentRuleListStore::readContentsOfFile):
* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
* UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter usesCopiedMemory]):
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addContentRuleLists):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
2019-03-11 Chris Dumez <cdumez@apple.com>
Unreviewed, fix assertions in layout tests on iOS Simulator after r242666.
Log an error but do not crash if we fail to acquire a ProcessAssertion.
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
2019-03-11 Chris Dumez <cdumez@apple.com>
WebProcessCache should keep track of processes being added
https://bugs.webkit.org/show_bug.cgi?id=195538
Reviewed by Geoffrey Garen.
WebProcessCache should keep track of processes being added, while they are being
checked for responsiveness. This is useful so that:
- Requests to clear the cache also clear processes being added
- Requests to remove a given process from the cache (either because it crashed
or because it is being used for a history navigation) actually remove the
process if it is still being checked for responsiveness.
- The cached process eviction timer applies to such processes in case something
goes wrong with the code and the pending request does not get processed.
* UIProcess/WebProcessCache.cpp:
(WebKit::generateAddRequestIdentifier):
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::clear):
(WebKit::WebProcessCache::clearAllProcessesForSession):
(WebKit::WebProcessCache::removeProcess):
(WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
(WebKit::WebProcessCache::evictProcess): Deleted.
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::size const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2019-03-11 Alex Christensen <achristensen@webkit.org>
REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
https://bugs.webkit.org/show_bug.cgi?id=194523
Reviewed by Alexey Proskuryakov.
Attempt another workaround to prevent crashes.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242688, r242643, r242624.
Caused multiple layout test failures and crashes on iOS and macOS.
Reverted changeset:
"requestAnimationFrame should execute before the next frame"
https://bugs.webkit.org/show_bug.cgi?id=177484
https://trac.webkit.org/changeset/242624/webkit
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::layerFlushTimerFired):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layoutIfNeeded):
(WebKit::WebPage::willDisplayPage):
(WebKit::WebPage::renderingUpdate): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2019-03-11 Darin Adler <darin@apple.com>
Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
https://bugs.webkit.org/show_bug.cgi?id=195533
Reviewed by Brent Fulgham.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile): Use appendFixedPrecisionNumber.
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::asJSON const): Ditto.
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::loggingString const): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessageWithValue): Use numberToStringFixedPrecision.
2019-03-11 John Wilander <wilander@apple.com>
Resource Load Statistics: Make it possible exclude localhost from classification
https://bugs.webkit.org/show_bug.cgi?id=195474
<rdar://problem/47520577>
Reviewed by Brent Fulgham.
This patch allows for localhost to be excluded from classification and
treatment as a prevalent resource.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
(WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
Now takes a ShouldIncludeLocalhost parameter.
(WebKit::ResourceLoadStatisticsStore::shouldSkip const):
Convenience function, currently supporting the localhost exclusion.
(WebKit::ResourceLoadStatisticsStore::setIsRunningTest):
Test infrastructure.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setIsRunningTest):
Test infrastructure.
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
Now takes a ShouldIncludeLocalhost parameter.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
Defines the new ShouldIncludeLocalhost boolean enum.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
Test infrastructure.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
Forwards the localhost setting to the create function.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
New parameter called shouldIncludeLocalhostInResourceLoadStatistics.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Picks up the localhost setting from the parameters.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsIsRunningTest):
Test infrastructure.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setIsRunningResourceLoadStatisticsTest):
Test infrastructure.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
Picks up the localhost setting from the WebsiteDataStore parameters.
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
Makes sure Safari does not exclude localhost.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
Test infrastructure.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-03-11 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r242698.
API test crashes on bots.
Reverted changeset:
"Add a WKContentRuleList variant that uses copied memory
instead of mmap'd shared memory for class A containerized
apps"
https://bugs.webkit.org/show_bug.cgi?id=195511
https://trac.webkit.org/changeset/242698
2019-03-11 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE] Enable web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=195169
Reviewed by Daniel Bates.
* PlatformWPE.cmake:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
2019-03-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r242697.
Broke internal builders.
Reverted changeset:
"Optimizing loads when creating new pages"
https://bugs.webkit.org/show_bug.cgi?id=195516
https://trac.webkit.org/changeset/242697
2019-03-10 Alex Christensen <achristensen@webkit.org>
Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
https://bugs.webkit.org/show_bug.cgi?id=195511
<rdar://problem/44873269>
Reviewed by Darin Adler.
* NetworkProcess/NetworkContentRuleListManager.cpp:
(WebKit::NetworkContentRuleListManager::addContentRuleLists):
* NetworkProcess/NetworkContentRuleListManager.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
(WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* Shared/WebCompiledContentRuleList.cpp:
(WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
(WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
(WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
(WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
(WebKit::WebCompiledContentRuleList::actions const):
* Shared/WebCompiledContentRuleList.h:
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::size const):
(WebKit::WebCompiledContentRuleListData::dataPointer const):
(WebKit::WebCompiledContentRuleListData::encode const):
(WebKit::WebCompiledContentRuleListData::decode):
* Shared/WebCompiledContentRuleListData.h:
(WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
* UIProcess/API/APIContentRuleList.cpp:
(API::ContentRuleList::usesCopiedMemory const):
* UIProcess/API/APIContentRuleList.h:
* UIProcess/API/APIContentRuleListStore.cpp:
(API::getData):
(API::decodeContentRuleListMetaData):
(API::ContentRuleListStore::readContentsOfFile):
(API::MappedOrCopiedData::dataPointer const):
(API::openAndMapOrCopyContentRuleList):
(API::compiledToFile):
(API::createExtension):
(API::ContentRuleListStore::lookupContentRuleList):
(API::ContentRuleListStore::compileContentRuleList):
(API::ContentRuleListStore::getContentRuleListSource):
(API::openAndMapContentRuleList): Deleted.
* UIProcess/API/APIContentRuleListStore.h:
* UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
(API::ContentRuleListStore::readContentsOfFile):
* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
* UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter usesCopiedMemory]):
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addContentRuleLists):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
2019-03-10 Jiewen Tan <jiewen_tan@apple.com>
Optimizing loads when creating new pages
https://bugs.webkit.org/show_bug.cgi?id=195516
<rdar://problem/48738086>
Reviewed by Darin Adler.
This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
API::NavigationAction to the load optimizer instead of the request within.
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryOptimizingLoad):
(WebKit::tryInterceptNavigation):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::tryOptimizingLoad):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
2019-03-10 Tim Horton <timothy_horton@apple.com>
Add SPI to retrieve the set of text inputs in a given rect, and later focus one
https://bugs.webkit.org/show_bug.cgi?id=195499
Reviewed by Darin Adler.
* Scripts/webkit/messages.py:
* Shared/TextInputContext.cpp: Added.
(IPC::ArgumentCoder<WebKit::TextInputContext>::encode):
(IPC::ArgumentCoder<WebKit::TextInputContext>::decode):
* Shared/TextInputContext.h: Added.
(WebKit::TextInputContext::operator== const):
Add TextInputContext, which represents a minimal set of information
about a text field.
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
(-[WKWebView _focusTextInputContext:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add SPI that allows clients to asynchronously request text input
contexts for a given rect, and later focus a given context.
* UIProcess/API/Cocoa/_WKTextInputContext.h: Added.
* UIProcess/API/Cocoa/_WKTextInputContext.mm: Added.
(-[_WKTextInputContext _initWithTextInputContext:]):
(-[_WKTextInputContext boundingRect]):
(-[_WKTextInputContext _textInputContext]):
(-[_WKTextInputContext isEqual:]):
(-[_WKTextInputContext hash]):
(-[_WKTextInputContext copyWithZone:]):
* UIProcess/API/Cocoa/_WKTextInputContextInternal.h: Added.
Add an SPI object that exposes a read-only window on a TextInputContext to clients.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::textInputContextsInRect):
(WebKit::WebPageProxy::focusTextInputContext):
* UIProcess/WebPageProxy.h:
Plumbing from WKWebView<->WebPage.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::elementRectInWindowCoordinates):
(WebKit::isEditableTextInputElement):
(WebKit::WebPage::textInputContextsInRect):
Search the DOM for text input contexts: <input type='text'> (or other
form fields that fall back on text field behavior), <textarea>, and
contenteditable roots. Store the WebPage, Document, and Element identifiers
so that we can find the element again later.
(WebKit::WebPage::focusTextInputContext):
Find the element for a given (web page, document, element) triple and focus it,
if it's still available.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-03-10 Tim Horton <timothy_horton@apple.com>
iOS: Using ⌥ to scroll horizontally is no different than arrow key
https://bugs.webkit.org/show_bug.cgi?id=195268
<rdar://problem/48326682>
Reviewed by Brent Fulgham.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): Deleted.
* UIProcess/ios/WKKeyboardScrollingAnimator.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
(-[WKKeyboardScrollViewAnimator setDelegate:]):
(-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
(-[WKKeyboardScrollViewAnimator distanceForIncrement:]): Deleted.
Add a direction parameter to -distanceForIncrement:, so the client
can return a different page/document size based on the scrolling axis.
Adopt it both in the default implementation and in WKContentViewInteraction.
Make the option key scroll by page when scrolling horizontally, like it
does when scrolling vertically.
2019-03-10 David Quesada <david_quesada@apple.com>
ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()
https://bugs.webkit.org/show_bug.cgi?id=152480
Reviewed by Chris Dumez.
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::downloadFinished):
If the DownloadProxy is holding the last reference to the process pool, then
invalidating the proxy will cause the process pool, the network process proxy,
and this DownloadProxyMap to deallocate. Ensure that doesn't happen until this
method has done everything it wants to do to clean up.
2019-03-10 Wenson Hsieh <wenson_hsieh@apple.com>
Fix some misleading function and variable names in WKContentViewInteraction.mm
https://bugs.webkit.org/show_bug.cgi?id=195536
Reviewed by Tim Horton.
* UIProcess/ios/WKContentViewInteraction.mm:
(shouldDeferZoomingToSelectionWhenRevealingFocusedElement):
Rename shouldZoomToRevealSelectionRect to shouldDeferZoomingToSelectionWhenRevealingFocusedElement; this
function is used to determine whether we should zoom to the selection rect when revealing the focused element,
and therefore affects whether we need to defer zooming until we get selection information.
(rectToRevealWhenZoomingToFocusedElement):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Rename shouldShowKeyboard to shouldShowInputView; this boolean indicates whether we should show not only the
keyboard, but other UI for user input such as date and select pickers.
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
(shouldZoomToRevealSelectionRect): Deleted.
2019-03-10 Simon Fraser <simon.fraser@apple.com>
ScrollingTree should have the final say on where layers go
https://bugs.webkit.org/show_bug.cgi?id=195507
Reviewed by Antti Koivisto.
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2019-03-09 Darin Adler <darin@apple.com>
[Cocoa] Code signing fails because services are copied into XPCServices after the framework is signed
https://bugs.webkit.org/show_bug.cgi?id=195523
Reviewed by Dan Bernstein.
* WebKit.xcodeproj/project.pbxproj: Make symbolic links while building the WebKit
framework instead of copying in the services after the framework is built.
2019-03-09 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r242551): Sporadic hangs when tapping to change selection on iOS
https://bugs.webkit.org/show_bug.cgi?id=195475
<rdar://problem/48721153>
Reviewed by Chris Dumez.
r242551 refactored synchronous autocorrection context requests to send an async IPC message and then use
waitForAndDispatchImmediately, instead of calling sendSync. However, this exposes a couple of existing issues in
the implementation of waitForAndDispatchImmediately that causes sporadic IPC deadlocks when changing selection.
First, passing in InterruptWaitingIfSyncMessageArrives when synchronously waiting for an IPC message currently
does not fulfill its intended behavior of interrupting waiting when a sync message arrives. This is because sync
IPC messages, by default, may be dispatched while the receiver is waiting for a sync reply. This means that the
logic in Connection::SyncMessageState::processIncomingMessage to dispatch an incoming sync message on the main
thread will attempt to handle the incoming message by enqueueing it on the main thread, and then waking up the
client runloop (i.e. signaling m_waitForSyncReplySemaphore). This works in the case of sendSync since the sync
reply semaphore is used to block the main thread, but in the case of waitForAndDispatchImmediately, a different
m_waitForMessageCondition is used instead, so SyncMessageState::processIncomingMessage will only enqueue the
incoming sync message on the main thread, and not actually invoke it.
To fix this first issue, observe that there is pre-existing logic to enqueue the incoming message and signal
m_waitForMessageCondition in Connection::processIncomingMessage. This codepath is currently not taken because we
end up bailing early in the call to SyncMessageState::processIncomingMessage. Instead, we can move this early
return further down in the function, such that if there is an incoming sync message and we're waiting with the
InterruptWaitingIfSyncMessageArrives option, we will correctly enqueue the incoming message, wake the runloop,
and proceed to handle the incoming message.
The second issue is more subtle; consider the scenario in which we send a sync message A from the web process to
the UI process, and simultaneously, in the UI process, we schedule some work to be done on the main thread.
Let's additionally suppose that this scheduled work will send an IPC message B to the web process and
synchronously wait for a reply (in the case of this particular bug, this is the sync autocorrection context
request). What happens upon receiving sync message A is that the IPC thread in the UI process will schedule A on
the main thread; however, before the scheduled response to A is invoked, we will first invoke previously
scheduled work that attempts to block synchronously until a message B is received. In summary:
1. (Web process) sends sync IPC message A to UI process.
2. (UI process) schedules some main runloop task that will block synchronously on IPC message B.
3. (UI process) receives sync IPC message A and schedules A on the main runloop.
4. (UI process) carry out the task scheduled in (2) and block on B.
...and then, the UI process and web process are now deadlocked because the UI process is waiting for B to
arrive, but the web process can't send B because it's waiting for a reply for IPC message A! To fix this second
deadlock, we first make an important observation: when using sendSync, we don't run into this problem because
immediately before sending sync IPC, we will attempt to handle any incoming sync IPC messages that have been
queued up. However, when calling waitForAndDispatchImmediately, we don't have this extra step, so a deadlock may
occur in the manner described above. To fix this, we make waitForAndDispatchImmediately behave more like
sendSync, by handling all incoming sync messages prior to blocking on an IPC response.
Test: editing/selection/ios/change-selection-by-tapping.html
* Platform/IPC/Connection.cpp:
(IPC::Connection::waitForMessage):
(IPC::Connection::processIncomingMessage):
2019-03-09 Andy Estes <aestes@apple.com>
[Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
https://bugs.webkit.org/show_bug.cgi?id=195526
<rdar://problem/48745636>
Reviewed by Chris Dumez.
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinator::openPaymentSetup):
(WebKit::generateCanMakePaymentsWithActiveCardReplyID): Deleted.
(WebKit::generateOpenPaymentSetupReplyID): Deleted.
(WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCardReply): Deleted.
(WebKit::WebPaymentCoordinator::openPaymentSetupReply): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
2019-03-09 Andy Estes <aestes@apple.com>
[iOS] Remove unneeded entitlements and sandbox allowances from the Networking service
https://bugs.webkit.org/show_bug.cgi?id=195527
Reviewed by Eric Carlson.
* Configurations/Network-iOS.entitlements:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2019-03-09 Chris Dumez <cdumez@apple.com>
Use modern async IPC with reply for device orientation permission
https://bugs.webkit.org/show_bug.cgi?id=195529
Reviewed by Ryosuke Niwa.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
(WebKit::nextDeviceOrientationAndMotionPermissionCallbackID): Deleted.
(WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-03-09 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
https://bugs.webkit.org/show_bug.cgi?id=195510
<rdar://problem/48735695>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cancelPotentialTapInFrame):
2019-03-08 Chris Dumez <cdumez@apple.com>
Enable ProcessAssertions on iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=195479
Reviewed by Alexey Proskuryakov.
Enable ProcessAssertions on iOS Simulator. We have some layout tests timing out in the
iOS Simulator due to the WebContent process suspending. Turning on ProcessAssertions in
the iOS Simulator seems to make those tests pass.
* UIProcess/ProcessAssertion.cpp:
* UIProcess/ProcessAssertion.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
2019-03-08 Chris Dumez <cdumez@apple.com>
Add support for Device Orientation / Motion permission API
https://bugs.webkit.org/show_bug.cgi?id=195329
<rdar://problem/47645367>
Reviewed by Geoffrey Garen.
Add support for Device Orientation / Motion permission API:
- https://github.com/w3c/deviceorientation/issues/57
This adds new SPI to WKUIDelegatePrivate, until we can make this API.
* Shared/WebPreferences.yaml:
* UIProcess/API/APIUIClient.h:
(API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::nextDeviceOrientationAndMotionPermissionCallbackID):
(WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
(WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-03-08 Brady Eidson <beidson@apple.com>
Have the UIProcess take the UnboundedNetworking assertion when downloads are in progress.
https://bugs.webkit.org/show_bug.cgi?id=195468
Reviewed by Andy Estes.
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::DownloadProxyMap):
(WebKit::DownloadProxyMap::createDownloadProxy): If this is the first download, and the process has the entitlement,
take the assertion.
(WebKit::DownloadProxyMap::downloadFinished):
(WebKit::DownloadProxyMap::processDidClose):
* UIProcess/Downloads/DownloadProxyMap.h:
2019-03-08 Chris Dumez <cdumez@apple.com>
Add assertions to help debug a WebProcessCache crash
https://bugs.webkit.org/show_bug.cgi?id=195469
Reviewed by Brady Eidson.
I suspect the process's registrableDomain in null when evictProcess() gets
called, thus crashing when lookup it up in the HashMap. Confirm this and
how this could happen via assertions.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::evictProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
2019-03-08 Brady Eidson <beidson@apple.com>
Rename AssertionState::Download.
https://bugs.webkit.org/show_bug.cgi?id=195465
Reviewed by Andy Estes.
It's (currently) about uploads and downloads.
Let's call it "UnboundedNetworking"
* NetworkProcess/Downloads/DownloadMap.cpp:
(WebKit::DownloadMap::add):
* UIProcess/ProcessAssertion.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didSetAssertionState):
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::flagsForState):
(WebKit::reasonForState):
2019-03-08 Simon Fraser <simon.fraser@apple.com>
[macOS UI-side compositing] Mouse handling can trigger a crash before we have a scrolling tree root
https://bugs.webkit.org/show_bug.cgi?id=195467
Reviewed by Antti Koivisto.
When launching MiniBrowser with UI-side compositing enabled in a state where the window
appears under the mouse, we can hit RemoteScrollingTree::handleMouseEvent() for a mouseEnter
event before we have a scrolling tree root node, so add a null check.
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::handleMouseEvent):
2019-03-08 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r242624): [GTK] New rAF code path assumes AC mode
https://bugs.webkit.org/show_bug.cgi?id=195459
Reviewed by Žan Doberšek.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
The refresh monitor now calls scheduleLayerFlush() but when AC
mode is disabled this method does nothing, so setNeedsDisplay()
needs to be called instead.
2019-03-07 Tim Horton <timothy_horton@apple.com>
Crash under RemoteLayerTreePropertyApplier::applyProperties
https://bugs.webkit.org/show_bug.cgi?id=195448
<rdar://problem/48588226>
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
Under some currently-unknown circumstances, the UI process is receiving
commits referring to layers that it does not know about.
One understood case of this was fixed in r241899, but there seem to be
cases remaining that are not understood.
Also, add a release log so that we can identify any downstream effects.
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce fixed duration content observation
https://bugs.webkit.org/show_bug.cgi?id=195295
<rdar://problem/48579913>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2019-03-07 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo][WebKit] Nothing is drawn after Web process crashed
https://bugs.webkit.org/show_bug.cgi?id=195399
Reviewed by Alex Christensen.
PageClientImpl::viewSize returned 0x0 size after Web process
crashed. Restored the original implementation using GetClientRect
(Bug 52175).
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewSize):
2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
a single call to Page::renderingUpdate(). This new function implements
"Update the rendering" step of the HTML Event Loop specification
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::updateBackingStoreState):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::layerFlushTimerFired):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layoutIfNeeded):
(WebKit::WebPage::renderingUpdate):
(WebKit::WebPage::willDisplayPage): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add a setting to be able to turn content change observation on/off
https://bugs.webkit.org/show_bug.cgi?id=195353
<rdar://problem/48626394>
Reviewed by Simon Fraser.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetContentChangeObserverEnabled):
(WKPreferencesGetContentChangeObserverEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _contentChangeObserverEnabled]):
(-[WKPreferences _setContentChangeObserverEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-03-07 Andy Estes <aestes@apple.com>
[Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=195349
<rdar://problem/48625510>
Reviewed by Alex Christensen.
Introduced PaymentAuthorizationPresenter and WKPaymentAuthorizationDelegate to encapsulate
PKPaymentAuthorizationViewController and its delegate. Taught WebPaymentCoordinatorProxy to
interact with PaymentAuthorizationPresenter rather than PKPAVC directly.
These changes will allow us to swap out PKPaymentAuthorizationViewController with PKPaymentAuthorizationController in a follow-on patch.
* Platform/cocoa/PaymentAuthorizationPresenter.h: Added. Defined the abstract interface for
payment authorization presenters that use PKPA(V)C.
* Platform/cocoa/PaymentAuthorizationPresenter.mm: Added.
(WebKit::toPKPaymentAuthorizationStatus): Moved from WebPaymentCoordinatorProxyCocoa.mm.
(WebKit::toPKPaymentErrorCode): Ditto.
(WebKit::toNSError): Ditto.
(WebKit::toNSErrors): Ditto.
(WebKit::toPKShippingMethods): Ditto.
(WebKit::PaymentAuthorizationPresenter::completeMerchantValidation): Added. Implements the
logic previously in WebPaymentCoordinatorProxy::platformCompleteMerchantValidation.
(WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): Ditto for
WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection.
(WebKit::PaymentAuthorizationPresenter::completePaymentSession): Ditto for
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): Ditto for
WebPaymentCoordinatorProxy::platformCompletePaymentSession.
(WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Ditto for
WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection.
* Platform/cocoa/PaymentAuthorizationViewController.h: Added. Defined a subclass of PaymentAuthorizationPresenter for PKPaymentAuthorizationViewController.
* Platform/cocoa/PaymentAuthorizationViewController.mm: Added.
(-[WKPaymentAuthorizationViewControllerDelegate initWithPresenter:]): Added a PKPAVC
delegate that's a subclass of WKPaymentAuthorizationDelegate.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
Called -[WKPaymentAuthorizationDelegate _didFinish].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Called
-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Called
-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Called
-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Called
-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]):
Called -[WKPaymentAuthorizationDelegate _willFinishWithError:].
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Called
-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:].
* Platform/cocoa/WKPaymentAuthorizationDelegate.h: Added.
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Added.
(-[WKPaymentAuthorizationDelegate summaryItems]): Added a summaryItems getter.
(-[WKPaymentAuthorizationDelegate shippingMethods]): Ditto for shippingMethods.
(-[WKPaymentAuthorizationDelegate completeMerchantValidation:error:]): Called
_didRequestMerchantSessionCompletion then set it to nil.
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): Ditto for
_didSelectPaymentMethodCompletion.
(-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]): Ditto
for _didAuthorizePaymentCompletion.
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
Ditto for _didSelectShippingContactCompletion.
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Ditto for
_didSelectShippingMethodCompletion.
(-[WKPaymentAuthorizationDelegate invalidate]): If there's an outstanding authorization
callback, called -completePaymentSession:errors:didReachFinalState: with a state of
PKPaymentAuthorizationStatusFailure.
(-[WKPaymentAuthorizationDelegate _initWithPresenter:]):
(-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Added. Implements the
logic previously in WKPaymentAuthorizationViewControllerDelegate.
(-[WKPaymentAuthorizationDelegate _didFinish]): Ditto.
(-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:]): Ditto.
(-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): Ditto.
(-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): Ditto.
(toShippingMethod): Moved from WebPaymentCoordinatorProxyCocoa.mm.
(-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): Added. Implements
the logic previously in WKPaymentAuthorizationViewControllerDelegate.
(-[WKPaymentAuthorizationDelegate _willFinishWithError:]): Ditto.
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::presenterWillValidateMerchant): To conform to
PaymentAuthorizationPresenter::Client, renamed from validateMerchant.
(WebKit::WebPaymentCoordinatorProxy::presenterDidAuthorizePayment): Renamed from
didAuthorizePayment.
(WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Moved logic here that previously
existed in WKPaymentAuthorizationViewControllerDelegate.
(WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): Renamed from
didSelectShippingMethod.
(WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingContact): Renamed from
didSelectShippingContact.
(WebKit::WebPaymentCoordinatorProxy::presenterDidSelectPaymentMethod): Renamed from
didSelectPaymentMethod.
(WebKit::WebPaymentCoordinatorProxy::validateMerchant): Renamed to
presenterWillValidateMerchant.
(WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Renamed to
presenterDidAuthorizePayment.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Renamed to
presenterDidSelectShippingMethod.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Renamed to
presenterDidSelectShippingContact.
(WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Renamed to
didSelectPaymentMethod.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h: Changed WebPaymentCoordinatorProxy to
subclass PaymentAuthorizationPresenter::Client.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Removed WKPaymentAuthorizationViewControllerDelegate interface and declared some helper functions
needed by PaymentAuthorizationPresenter.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentSummaryItemType): Removed static keyword.
(WebKit::toDecimalNumber): Ditto.
(WebKit::toPKPaymentSummaryItem): Ditto.
(WebKit::toPKPaymentSummaryItems): Ditto.
(WebKit::toPKShippingMethod): Ditto.
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Changed to call
m_authorizationPresenter.
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Ditto.
(WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Ditto.
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Ditto.
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto.
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): Ditto.
(-[WKPaymentAuthorizationViewControllerDelegate initWithPaymentCoordinatorProxy:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate invalidate]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Deleted.
(toShippingMethod): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): Deleted.
(WebKit::toPKPaymentAuthorizationStatus): Moved to PaymentAuthorizationPresenter.mm.
(WebKit::toPKPaymentErrorCode): Ditto.
(WebKit::toNSError): Ditto.
(WebKit::toNSErrors): Ditto.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Changed to present a
PaymentAuthorizationPresenter rather than a PKPAVC.
(WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Changed to dismiss a
PaymentAuthorizationPresenter rather than a PKPAVC.
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
(WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Ditto.
* SourcesCocoa.txt:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): Added. Returns a new
PaymentAuthorizationViewController.
* WebKit.xcodeproj/project.pbxproj:
2019-03-07 Chris Dumez <cdumez@apple.com>
Regression(r242580) WebKit.NetworkProcessCrashWithPendingConnection API is crashing on iOS debug
https://bugs.webkit.org/show_bug.cgi?id=195416
Reviewed by Antti Koivisto.
Drop ASSERT_NOT_REACHED() in WebPage::didCompletePageTransition() when the tree is still frozen due to
LayerTreeFreezeReason::ProcessSuspended. As demonstrated by this API test, nothing prevents a load from
completing and WebPage::didCompletePageTransition() to get called *after* WebProcess::prepareToSuspend()
has been called. From the logging during the test, I can tell that WebProcess::processDidResume() gets
called later on and the LayerTreeFreezeReason::ProcessSuspended freezing reason gets dropped, as expected.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
2019-03-07 Chris Dumez <cdumez@apple.com>
Clean up / simplify ProcessAssertion code
https://bugs.webkit.org/show_bug.cgi?id=195394
Reviewed by Geoffrey Garen.
Clean up / simplify ProcessAssertion code to facilitate its maintenance and make it
less error-prone.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::setState):
* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertion::Client::~Client):
(WebKit::ProcessAssertion::setClient):
(WebKit::ProcessAssertion::client):
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::didConnectToProcess):
* UIProcess/ProcessThrottler.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager dealloc]):
(-[WKProcessAssertionBackgroundTaskManager addAssertionNeedingBackgroundTask:]):
(-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
(-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
(-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::processAssertionWasInvalidated):
(WebKit::ProcessAssertion::setState):
(WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
(WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):
(WebKit::ProcessAndUIAssertion::setState):
(WebKit::ProcessAndUIAssertion::uiAssertionWillExpireImminently):
2019-03-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242297.
https://bugs.webkit.org/show_bug.cgi?id=195430
Broke Microsoft Visio. (Requested by dydz on #webkit).
Reverted changeset:
"[iOS] Turn mouse event simulation on by default"
https://bugs.webkit.org/show_bug.cgi?id=195218
https://trac.webkit.org/changeset/242297
2019-03-07 John Wilander <wilander@apple.com>
Resource Load Statistics: Log first-party navigations with link decoration
https://bugs.webkit.org/show_bug.cgi?id=195301
<rdar://problem/48569971>
Reviewed by Brent Fulgham.
This patch adds a call to the network process' resource load statistics to
log cross-site navigations with link decoration. The logging checks if the
source of the navigation is a prevalent resource and if so, sets the
appropriate flag for the destination.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::logCrossSiteLoadWithLinkDecoration):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
This now receives a completion handler. This is in preparation for
test cases where we need to log such an event and wait for it to
finish before continuing.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration):
* UIProcess/WebProcessPool.h:
2019-03-07 Per Arne Vollan <pvollan@apple.com>
[iOS] Disable permissive call logging in sandbox
https://bugs.webkit.org/show_bug.cgi?id=195288
<rdar://problem/47683804>
Reviewed by Brent Fulgham.
As on macOS, we should enable strict call filtering in sandbox on iOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-03-07 Youenn Fablet <youenn@apple.com>
Introduce a quota manager for Cache API/Service Worker/IDB storage
https://bugs.webkit.org/show_bug.cgi?id=195283
Reviewed by Chris Dumez.
Remove quota handling from Cache API storage and use StorageQuotaManager/StorageQuotaUser.
CacheStorage::Caches becomes a quota user and has a StorageQuotaManager to check for space for any cache API write task.
NetworkProcess is responsible to manage the quota managers.
Quota managers will go through network process to ask UIProcess for quota extension.
Remove pending callback handling from CacheStorage since they are queued in QuotaManager now.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::~NetworkProcess):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::cacheStorageRootPath):
(WebKit::NetworkProcess::setCacheStorageParameters):
(WebKit::NetworkProcess::storageQuotaManager):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::Engine):
(WebKit::CacheStorage::Engine::readCachesFromDisk):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::put):
* NetworkProcess/cache/CacheStorageEngineCache.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::Caches):
(WebKit::CacheStorage::Caches::~Caches):
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::writeRecord):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
2019-03-07 John Wilander <wilander@apple.com>
Resource Load Statistics: Make it possible to purge only script-accessible cookies
https://bugs.webkit.org/show_bug.cgi?id=195383
<rdar://problem/48570136>
Reviewed by Brent Fulgham.
This patch provides the ability to purge all script-accessible cookies while leaving
HttpOnly cookies in place.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
Support for a new boolean flag on whether or not to include HttpOnly Cookies.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
Support for a new boolean flag on whether or not to include HttpOnly Cookies.
(WebKit::NetworkProcess::deleteCookiesForTesting):
Test infrastructure.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
Support for a new boolean flag on whether or not to include HttpOnly Cookies.
* NetworkProcess/NetworkSession.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
Test infrastructure.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::deleteCookiesForTesting):
Test infrastructure.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::deleteCookiesForTesting):
Test infrastructure.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-03-07 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
https://bugs.webkit.org/show_bug.cgi?id=195410
Reviewed by Žan Doberšek.
Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
updae tha compositing state. A new method resume() is also added to schedule an update if needed.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
(WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
while suspended.
(WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
(WebKit::CompositingRunLoop::compositionCompleted): Ditto.
(WebKit::CompositingRunLoop::updateCompleted): Ditto.
(WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
(WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().
2019-03-06 Mark Lam <mark.lam@apple.com>
Exception is a JSCell, not a JSObject.
https://bugs.webkit.org/show_bug.cgi?id=195392
Reviewed by Saam Barati.
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::throwInvalidAccessError):
* WebProcess/Plugins/Netscape/JSNPObject.h:
2019-03-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242354.
https://bugs.webkit.org/show_bug.cgi?id=195402
breaks layout tests in all configurations (Requested by
zdobersek on #webkit).
Reverted changeset:
"[WPE] Enable web process sandbox"
https://bugs.webkit.org/show_bug.cgi?id=195169
https://trac.webkit.org/changeset/242354
2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
https://bugs.webkit.org/show_bug.cgi?id=195346
Reviewed by Fujii Hironori.
* Platform/IPC/win/ConnectionWin.cpp:
(IPC::Connection::createServerAndClientIdentifiers):
* Platform/win/ModuleWin.cpp:
(WebKit::Module::load):
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/win/WebContextMenuProxyWin.cpp:
(WebKit::createMenuItem):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::setToolTip):
* WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
(WebKit::InjectedBundle::initialize):
Use wchar helpers as needed.
2019-03-06 Wenson Hsieh <wenson_hsieh@apple.com>
Crash when attempting to change input type while dismissing datalist suggestions
https://bugs.webkit.org/show_bug.cgi?id=195384
<rdar://problem/48563718>
Reviewed by Brent Fulgham.
See WebCore ChangeLog for more details.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActiveDataListSuggestionPicker):
(WebKit::WebPage::didSelectDataListOption):
(WebKit::WebPage::didCloseSuggestions):
* WebProcess/WebPage/WebPage.h:
Turn m_activeDataListSuggestionPicker from a raw pointer into a WeakPtr.
2019-03-06 Chris Dumez <cdumez@apple.com>
[iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
https://bugs.webkit.org/show_bug.cgi?id=195382
<rdar://problem/48642739>
Reviewed by Geoffrey Garen.
ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
ProcessWillSuspendImminently() IPC was sent.
This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
layers it froze upon suspension.
* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertionClient::~ProcessAssertionClient):
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
(WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
(WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.
* UIProcess/ProcessThrottler.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
(WebKit::ProcessAssertion::~ProcessAssertion):
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::setClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
Revert change that was landed in r242098 to work around this ProcessThrottler bug.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillEnterForeground):
Revert change that was landed in r242554 to work around this ProcessThrottler bug.
2019-03-06 Alex Christensen <achristensen@webkit.org>
Add gettid to allowed syscalls on Mac
https://bugs.webkit.org/show_bug.cgi?id=195386
<rdar://problem/48651255>
Reviewed by Brent Fulgham.
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-06 Per Arne Vollan <pvollan@apple.com>
[macOS] Sandbox call violation causes WebContent process to crash
https://bugs.webkit.org/show_bug.cgi?id=195379
<rdar://problem/48647263>
Reviewed by Brent Fulgham.
A new call needs to be added to the allow list in the WebContent process' sandbox.
* WebProcess/com.apple.WebProcess.sb.in:
2019-03-06 Antti Koivisto <antti@apple.com>
[iOS] Basic hit testing for content overlapping fast-scrollable overflow
https://bugs.webkit.org/show_bug.cgi?id=195360
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
Use new UIView subclass for tiled layer hosting (so we know they have content even when contents property is nil).
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(collectDescendantViewsAtPoint):
Factor collection step into a function.
Do basic skipping of event-transparent layers.
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
To handle overlap cases, find the scroll view that has the deepest non-transparent view hit as its descendant.
(-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]): Deleted.
2019-03-06 Wenson Hsieh <wenson_hsieh@apple.com>
Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=195300
Reviewed by Simon Fraser.
Refactor some logic to use isTransparentOrFullyClippedRespectingParentFrames on RenderLayer rather than
RenderObject; introduce a helper method to ask whether the enclosing layer of a renderer is transparent or
clipped.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::enclosingLayerIsTransparentOrFullyClipped):
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::requestEvasionRectsAboveSelection):
(WebKit::WebPage::getFocusedElementInformation):
2019-03-06 Chris Dumez <cdumez@apple.com>
REGRESSION (r238490): YouTube.com: Returning PiP to Safari after sleeping device loses page
https://bugs.webkit.org/show_bug.cgi?id=195364
<rdar://problem/48538837>
Reviewed by Geoffrey Garen.
Make sure we unset the LayerTreeFreezeReason::ProcessSuspended layer tree freeze reason
when WebPage::applicationWillEnterForeground() is called. This restores pre-r238490
behavior and addresses the issue with PiP on youtube.com.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillEnterForeground):
2019-03-05 Dean Jackson <dino@apple.com>
Fix WKPasswordView compilation on iOS
https://bugs.webkit.org/show_bug.cgi?id=195344
<rdar://problem/48620066>
Reviewed by Dan Bates.
Use WebKitAdditions.
* UIProcess/ios/WKPasswordView.mm:
(-[WKPasswordView showInScrollView:]):
2019-03-06 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Frequent 1 second IPC deadlocks when showing a paste callout
https://bugs.webkit.org/show_bug.cgi?id=195354
<rdar://problem/48624675>
Reviewed by Tim Horton.
When triggering programmatic paste, we frequently hit deadlocks due to sync IPC going from the UI process to the
web process and vice versa. What happens in this scenario is that prior to triggering programmatic paste, the
page may try to move focus to a different element (e.g. a hidden editable area) before calling `execCommand`.
This causes us to send an ElementDidFocus message to the UI process, followed by RequestDOMPasteAccess.
However, upon receiving ElementDidFocus, we reload input views and (in the process) UIKit requests the
autocorrection context, which we implement in WebKit using a sync message to the web process due to
<rdar://problem/16207002> and its blocking bug <rdar://problem/48383001>. This means we'll end up in a state
where both the UI process and web process are blocked on each other waiting for a sync IPC response, and the UI
process is hung for a second until the IPC message times out.
Ideally, we should fix this by addressing <rdar://problem/16207002>. However, this requires potentially large
changes in UIKit (<rdar://problem/48383001>); for the time being, work around this deadlock by refactoring
synchronous autocorrection context requests such that they can be resolved by an out-of-band IPC response
(HandleAutocorrectionContext). Then prior to requesting DOM paste access, preemptively send a
HandleAutocorrectionContext message to the UI process to unblock any pending synchronous autocorrection context
requests.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleAutocorrectionContext):
* UIProcess/ios/WKContentViewInteraction.h:
Make it possible for WKContentView to remember its current pending autocorrection context completion handler.
This is invoked and cleared out in `-_invokePendingAutocorrectionContextHandler:`.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _invokePendingAutocorrectionContextHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
(-[WKContentView _handleAutocorrectionContext:]):
Handle an autocorrection context response. This is invoked when the web process either handles an autocorrection
context message, or when it preemptively sends an autocorrection context before requesting DOM paste access.
(+[WKAutocorrectionContext emptyAutocorrectionContext]):
Add a helper to create an empty autocorrection context.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::handleAutocorrectionContext):
(WebKit::WebPageProxy::autocorrectionContextSync): Deleted.
Removed this sync version, since we now only have requestAutocorrectionContext.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestDOMPasteAccess):
Send WebPageProxy::HandleAutocorrectionContext, and add a FIXME referencing <rdar://problem/16207002>.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Split AutocorrectionContextSync into RequestAutocorrectionContext and HandleAutocorrectionContext; additionally,
remove the existing RequestAutocorrectionContext message.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestAutocorrectionContext):
(WebKit::WebPage::autocorrectionContextSync): Deleted.
2019-03-06 Rob Buis <rbuis@igalia.com>
Consider supporting the `referrerpolicy` attribute.
https://bugs.webkit.org/show_bug.cgi?id=179053
Reviewed by Darin Adler.
Add a runtime flag for referrerpolicy attribute.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetReferrerPolicyAttributeEnabled):
(WKPreferencesGetReferrerPolicyAttributeEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource): do not hardcode choosing
the document referrer policy.
2019-03-06 Philippe Normand <pnormand@igalia.com>
Unreviewed, WPE build fix after r242503
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
ServiceWorker messages moved from network process to another
header, so it needs to be included.
2019-03-05 David Quesada <david_quesada@apple.com>
[WK2] It should be possible to follow links with 'download' attributes
https://bugs.webkit.org/show_bug.cgi?id=195145
rdar://problem/48462642
Reviewed by Alex Christensen.
When a link with a 'download' attribute is clicked and the navigation client
says to allow the navigation (i.e. provides PolicyAction::Use),
WebPageProxy::receivedNavigationPolicyDecision() should stop overriding this
decision and downloading the link instead. Instead, web view should honor the
policy chosen by the navigation delegate. This supports clients that want to
offer the user the ability to view, rather than download, the contents of
such links, which is permitted per the HTML spec.
This change is only made on Cocoa platforms for now since no other ports
expose an API on their navigation action to express whether the page intends
to download the linked resource.
* UIProcess/API/APINavigation.h:
(API::Navigation::shouldPerformDownload const):
Rename this to be in line with APINavigationAction's shouldPerformDownload()
for consistency. 'Force' seems like too strong of a word for this property
considering that 'forcing' the download isn't really an attribute inherent
to the navigation, but a behavior implemented by the web page proxy.
(API::Navigation::shouldForceDownload const): Deleted.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2019-03-05 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Implement Cookie Accept Policy.
https://bugs.webkit.org/show_bug.cgi?id=191645
Reviewed by Fujii Hironori.
* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::handleCookieHeaders):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2019-03-05 Youenn Fablet <youenn@apple.com>
Introduce ServiceWorkerFetchTask
https://bugs.webkit.org/show_bug.cgi?id=195130
Reviewed by Chris Dumez.
ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
This patch should not change existing behavior.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didFailFetch): Deleted.
(WebKit::NetworkProcess::didNotHandleFetch): Deleted.
(WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
(WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
(WebKit::NetworkProcess::didReceiveFetchData): Deleted.
(WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
(WebKit::NetworkProcess::didFinishFetch): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::cancelFetch):
(WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
(WebKit::WebSWServerConnection::didFinishFetch): Deleted.
(WebKit::WebSWServerConnection::didFailFetch): Deleted.
(WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::connectionClosed):
(WebKit::WebSWServerToContextConnection::startFetch):
(WebKit::WebSWServerToContextConnection::cancelFetch):
(WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
(WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
(WebKit::ServiceWorkerFetchTask::didReceiveResponse):
(WebKit::ServiceWorkerFetchTask::didReceiveData):
(WebKit::ServiceWorkerFetchTask::didReceiveFormData):
(WebKit::ServiceWorkerFetchTask::didFinish):
(WebKit::ServiceWorkerFetchTask::didFail):
(WebKit::ServiceWorkerFetchTask::didNotHandle):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
(WebKit::ServiceWorkerFetchTask::create):
(WebKit::ServiceWorkerFetchTask::Identifier::hash const):
(WebKit::ServiceWorkerFetchTask::identifier const):
(WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
(WebKit::operator==):
(WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
(WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
2019-03-05 Youenn Fablet <youenn@apple.com>
Rename requestCacheStorageSpace to requestStorageSpace
https://bugs.webkit.org/show_bug.cgi?id=195282
Reviewed by Chris Dumez.
Make the name more abstract as it might be used in the future for other storage
like IDB or service worker registrations.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestStorageSpace):
(WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::requestSpace):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(WebsiteDataStoreClient::WebsiteDataStoreClient):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageSpace):
(WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::requestStorageSpace):
(WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
2019-03-05 Chris Dumez <cdumez@apple.com>
Drop cached WebProcesses for a given session when this session is destroyed
https://bugs.webkit.org/show_bug.cgi?id=195212
<rdar://problem/48301483>
Reviewed by Geoffrey Garen.
Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
your private browsing window, all the processes it used get cleared and it cannot leave any state
behind.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::canCacheProcess const):
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::clearAllProcessesForSession):
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::capacity const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
(WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
* UIProcess/WebProcessPool.h:
2019-03-05 Brady Eidson <beidson@apple.com>
Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
<rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
Reviewed by Tim Horton.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
then its existence should override our willingness to reuse the existing committed extension.
(WebKit::shouldReuseCommittedSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:
2019-03-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242403.
Caused layout test crashes on iOS simulator.
Reverted changeset:
"[ContentChangeObserver] Introduce fixed duration content
observation"
https://bugs.webkit.org/show_bug.cgi?id=195295
https://trac.webkit.org/changeset/242403
2019-03-05 Loïc Yhuel <loic.yhuel@softathome.com>
[WPE] Do not create a PlatformDisplay in the Service Worker process
https://bugs.webkit.org/show_bug.cgi?id=194830
Reviewed by Žan Doberšek.
It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
depending on the platform, and allocates unneeded resources.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
2019-03-04 Brady Eidson <beidson@apple.com>
Unreviewed, rolling out r242376.
Broke some tests
Reverted changeset:
"Correctly handle sandbox extensions when the same WKWebView
loads multiple file:// URLs."
https://bugs.webkit.org/show_bug.cgi?id=195291
https://trac.webkit.org/changeset/242376
2019-03-04 Fujii Hironori <Hironori.Fujii@sony.com>
Use a SQLite database to hold the ResourceLoadStatistics data
https://bugs.webkit.org/show_bug.cgi?id=194867
<rdar://problem/24240854>
Unreviewed build fix for WinCairo.
ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
defined because WinCairo port defines RELEASE_LOG_DISABLED.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
2019-03-04 Brent Fulgham <bfulgham@apple.com>
Use a SQLite database to hold the ResourceLoadStatistics data
https://bugs.webkit.org/show_bug.cgi?id=194867
<rdar://problem/24240854>
Reviewed by Chris Dumez.
The ResourceLoadStatistics database plist is inefficient. It requires more memory use
than it needs, and forces lots of looping and string comparisons to find information.
This problem has already been solved in the form of relational databases. We use them
elsewhere in WebKit, and should do so for this storage as well.
This patch creates an optional SQLite database to handle ITP operations.
1. It adds a new internal experimental feature flag to activate it. It requires the user
exit and restart the process to take effect.
2. It populates itself from the existing plist file (if it exists).
3. It stops using the plist in favor of the database.
4. It does queries and other operations using the database instead of the old hash table
implementation.
This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
operations.
These code changes should not have any impact on existing operations, and when enabled
should produce the same test results.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
(WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
(WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
(WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
(WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
(WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
(WebKit::buildList):
(WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::listToString):
(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
(WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
(WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
(WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
(WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
(WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
(WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
(WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
(WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
(WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
(WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
(WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
(WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::clear):
(WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
(WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
(WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
(WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
(WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
(WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
(WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
(WebKit::domainsToString): Deleted.
(WebKit::OperatingDate::fromWallTime): Deleted.
(WebKit::OperatingDate::today): Deleted.
(WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
(WebKit::OperatingDate::operator== const): Deleted.
(WebKit::OperatingDate::operator< const): Deleted.
(WebKit::OperatingDate::operator<= const): Deleted.
(WebKit::OperatingDate::OperatingDate): Deleted.
(WebKit::mergeOperatingDates): Deleted.
(WebKit::computeImportance): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
(WebKit::debugLogDomainsInBatches): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
(WebKit::ResourceLoadStatisticsMemoryStore::data const):
(WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
(): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
(WebKit::domainsToString):
(WebKit::OperatingDate::fromWallTime):
(WebKit::OperatingDate::today):
(WebKit::OperatingDate::secondsSinceEpoch const):
(WebKit::OperatingDate::operator== const):
(WebKit::OperatingDate::operator< const):
(WebKit::OperatingDate::operator<= const):
(WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
(WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
(WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
(WebKit::ResourceLoadStatisticsStore::computeImportance):
(WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
(WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
(WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
(WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
(WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
(WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
(WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
(WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
(WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
(WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
(WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
(WebKit::ResourceLoadStatisticsStore::processStatistics const):
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
(WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
(WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
(WebKit::ResourceLoadStatisticsStore::logTestingEvent):
(WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
(WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
(WebKit::OperatingDate::OperatingDate):
(WebKit::ResourceLoadStatisticsStore::isEmpty const):
(WebKit::ResourceLoadStatisticsStore::data const):
(WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
(WebKit::ResourceLoadStatisticsStore::store const):
(WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
(WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
* NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
(WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
(WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
(WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
(WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
* Platform/classifier/ResourceLoadStatisticsClassifier.h:
* Shared/WebPreferences.yaml:
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebProcessPool.cpp:
* WebKit.xcodeproj/project.pbxproj:
2019-03-04 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce fixed duration content observation
https://bugs.webkit.org/show_bug.cgi?id=195295
<rdar://problem/48579913>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-03-04 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r242396.
Found issue to be unrelated. reverting my rollout.
Reverted changeset:
"Unreviewed, rolling out r242222."
https://bugs.webkit.org/show_bug.cgi?id=193683
https://trac.webkit.org/changeset/242396
2019-03-04 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a followup after r242336
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::webViewDidMoveToWindow):
Copy the list of observers before iterating it to avoid observers modifying the list.
2019-03-04 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r242222.
Broke internal debug testing
Reverted changeset:
"[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
the UI process."
https://bugs.webkit.org/show_bug.cgi?id=193683
https://trac.webkit.org/changeset/242222
2019-03-04 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r242378
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::associateWithAttachment):
2019-03-04 Brent Fulgham <bfulgham@apple.com>
Check contextIDs when handling WebContent messages
https://bugs.webkit.org/show_bug.cgi?id=195289
<rdar://problem/48475870>
Reviewed by Alex Christensen.
The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
(WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
(WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
(WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
(WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
(WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
(WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
(WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
(WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
(WebKit::PlaybackSessionManagerProxy::mutedChanged):
(WebKit::PlaybackSessionManagerProxy::volumeChanged):
(WebKit::PlaybackSessionManagerProxy::durationChanged):
(WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
(WebKit::PlaybackSessionManagerProxy::rateChanged):
(WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
(WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
(WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
(WebKit::UserMediaCaptureManagerProxy::end):
(WebKit::UserMediaCaptureManagerProxy::capabilities):
(WebKit::UserMediaCaptureManagerProxy::setMuted):
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::VideoFullscreenManagerProxy::setHasVideo):
(WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
(WebKit::VideoFullscreenManagerProxy::enterFullscreen):
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
(WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
(WebKit::VideoFullscreenManagerProxy::setInlineRect):
(WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
(WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
(WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
(WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::didCreateEditableImage):
(WebKit::EditableImageController::didDestroyEditableImage):
(WebKit::EditableImageController::associateWithAttachment):
2019-03-04 Alex Christensen <achristensen@webkit.org>
Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
https://bugs.webkit.org/show_bug.cgi?id=195238
<rdar://problem/47598656>
Reviewed by Chris Dumez.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRequest):
2019-03-04 Brady Eidson <beidson@apple.com>
Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
<rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
Reviewed by Andy Estes.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
we're currently loading is functionally equivalent to the previous one.
2019-03-04 Chris Dumez <cdumez@apple.com>
Drop legacy userAgentForURL injected bundle SPI
https://bugs.webkit.org/show_bug.cgi?id=195222
<rdar://problem/46734147>
Reviewed by Darin Adler.
Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
WebsitePolicies.customUserAgent is the way to go nowadays.
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::willDestroyFrame):
(API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(setUpPageLoaderClient):
(userAgentForURL): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userAgent const):
2019-03-04 Chris Dumez <cdumez@apple.com>
Do not share WebProcesses between private and regular sessions
https://bugs.webkit.org/show_bug.cgi?id=195189
<rdar://problem/48421064>
Reviewed by Alex Christensen.
Do not share WebProcesses between private and regular sessions. There are some privacy concerns.
Also, some of the WebsiteDataStore informations are passed via WebProcessCreationParameters (e.g.
ApplicationCache path) and cannot be updated later.
There were 2 cases where this could happen and that are fixed in the patch:
- A process may be prewarmed with a given website data store and then later on used for a page
associated with a different data store. We now prevent this. While this is not necessary for
privacy reasons, it is still useful because our code currently does not support well uses
different sessions inside a single WebProcess, as mentioned above.
- The client can force a WebsiteDataStore swap when responding to the decidePolicyForNavigationAction,
via the WebsitePolicies. To address the issue, we now force a process swap whenever the client
makes such a change.
As a result, WebProcessProxy::websiteDataStore() now makes sense and is always correct. It can
also only contains pages whose WebPageProxy::websiteDataStore() returns the same store.
* UIProcess/API/C/WKContext.cpp:
(WKContextWarmInitialProcess):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _warmInitialProcess]):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::websiteDataStore):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::prewarmProcess):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToOneProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::removeWebPage):
* UIProcess/WebProcessProxy.h:
2019-03-04 Chris Dumez <cdumez@apple.com>
[iOS] Improve our file picker
https://bugs.webkit.org/show_bug.cgi?id=195284
<rdar://problem/45655856>
Reviewed by Tim Horton and Wenson Hsieh.
Improve our file picker on iOS so that:
- Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
properly reflected in the file picker. Previously, we only we only supported MIME types in the
accept attribute that only Image / Video ones.
- If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
"Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
not make sense if the page only accepts PDF files for example.
Things that we should do but are not fixed in this patch:
- Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
UIDocumentPickerViewController directly.
- Add multiple selection support, which is supported both on the HTML side and in the
UIDocumentPickerViewController API.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(arrayContainsUTIThatConformsTo):
(-[WKFileUploadPanel dealloc]):
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
(UTIsForMIMETypes):
(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
(-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
(-[WKFileUploadPanel _showDocumentPickerMenu]):
2019-03-04 Alex Christensen <achristensen@webkit.org>
REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
https://bugs.webkit.org/show_bug.cgi?id=194523
Reviewed by Ryosuke Niwa.
Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
See rdar://problem/28233746.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
2019-03-04 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
https://bugs.webkit.org/show_bug.cgi?id=195270
Reviewed by Don Olmstead.
Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
painting is resumed and layer flush enabled.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
(WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
(WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
(WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
2019-03-04 Simon Fraser <simon.fraser@apple.com>
Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
https://bugs.webkit.org/show_bug.cgi?id=195258
Reviewed by Antti Koivisto.
This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
references to GraphicsLayers before that becomes safe).
The actual fix that allows overflow scrollbars to show is the change in
AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
* WebKit.xcodeproj/project.pbxproj:
2019-03-04 Andy Estes <aestes@apple.com>
[Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
https://bugs.webkit.org/show_bug.cgi?id=195080
<rdar://problem/48421558>
Reviewed by Antti Koivisto.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
* Shared/mac/WebHitTestResultData.mm:
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* WebKit.xcodeproj/project.pbxproj:
2019-03-04 Jer Noble <jer.noble@apple.com>
[iOS] Fullscreen "stay in page" option breaks video playback
https://bugs.webkit.org/show_bug.cgi?id=195277
<rdar://problem/48537317>
Reviewed by Eric Carlson.
Make sure we resume media playback when the user chooses "stay in page" from the deceptive
website warning dialog.
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):
2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE] Enable web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=195169
Reviewed by Daniel Bates.
* PlatformWPE.cmake:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):
2019-03-04 Adrian Perez de Castro <aperez@igalia.com>
[GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
https://bugs.webkit.org/show_bug.cgi?id=195245
Reviewed by Carlos Garcia Campos.
Changed license headers to contain the LGPL, which is the correct one for the GTK
and WPE ports. The change was agreed by the contributors to the files involved.
* UIProcess/API/gtk/WebKitAutocleanups.h:
* UIProcess/API/wpe/WebKitAutocleanups.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
2019-03-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242045.
https://bugs.webkit.org/show_bug.cgi?id=195273
WE not ready to enable PSON yet (Requested by KaL on #webkit).
Reverted changeset:
"[GTK] Enable PSON"
https://bugs.webkit.org/show_bug.cgi?id=194979
https://trac.webkit.org/changeset/242045
2019-03-04 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] Unify DrawingArea classes
https://bugs.webkit.org/show_bug.cgi?id=195167
Reviewed by Žan Doberšek.
Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/DrawingAreaInfo.h:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::viewSize):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
(webkitWebViewBaseUnrealize):
(webkitWebViewBaseDraw):
(webkitWebViewBaseSizeAllocate):
(webkitWebViewBaseDidRelaunchWebProcess):
(webkitWebViewBasePageClosed):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
(WebKit::DrawingAreaProxyCoordinatedGraphics::update):
(WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
(WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
(WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
(WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
* UIProcess/DrawingAreaProxyImpl.cpp: Removed.
* UIProcess/DrawingAreaProxyImpl.h: Removed.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::update):
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
(WebKit::DrawingAreaCoordinatedGraphics::scroll):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
(WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
(WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
(WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
(WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
(WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
(WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
(WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
(WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
(WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
(WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
(WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
(WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
(WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
(WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
(WebKit::DrawingAreaCoordinatedGraphics::display):
(WebKit::shouldPaintBoundsRect):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerFlushThrottlingIsActive const):
* WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
* WebProcess/WebPage/DrawingAreaImpl.h: Removed.
2019-03-03 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Content observation should be limited to the current document.
https://bugs.webkit.org/show_bug.cgi?id=195256
<rdar://problem/48544402>
Reviewed by Simon Fraser.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
2019-03-03 Tim Horton <timothy_horton@apple.com>
Rid the world of WK_API_ENABLED
https://bugs.webkit.org/show_bug.cgi?id=195263
Reviewed by Dan Bernstein.
List of changed files elided because it's useless.
2019-03-03 Jiewen Tan <jiewen_tan@apple.com>
Add a WebViewDidMoveToWindowObserver for WKWebView
https://bugs.webkit.org/show_bug.cgi?id=195223
<rdar://problem/48520161>
Reviewed by Darin Adler.
The load optimizer would only allow itself to optimize loads whenever the web view
who owns the page is (visible && focused), otherwises it will wait until the web view
becomes (visible && focused). Therefore, we need a way to notify the load optimizer
changes of statuses.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didMoveToWindow]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::viewDidMoveToWindow):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
(WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
(WebKit::WebPageProxy::webViewDidMoveToWindow):
* UIProcess/WebPageProxy.h:
* UIProcess/WebViewDidMoveToWindowObserver.h: Added.
* WebKit.xcodeproj/project.pbxproj:
2019-03-03 Andy Estes <aestes@apple.com>
[Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=195219
<rdar://problem/48518082>
Reviewed by Darin Adler.
Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
(WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
IPC::MessageSender via m_client.
(WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
MessageSender::send rather than going through m_webPageProxy.
(WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
changed m_webPageProxy to m_client.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
(WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
with m_client.
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
(WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
* UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
(WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
* WebKit.xcodeproj/project.pbxproj:
2019-03-03 Tim Horton <timothy_horton@apple.com>
Remove some more unused 32-bit code
https://bugs.webkit.org/show_bug.cgi?id=195255
Reviewed by Darin Adler.
* Platform/Module.cpp:
(WebKit::Module::Module):
* Platform/Module.h:
* Platform/cf/ModuleCF.cpp:
(WebKit::Module::unload):
(WebKit::Module::bundleResourceMap): Deleted.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::initializeShim):
(WebKit::PluginProcess::platformInitializeProcess):
(WebKit::shouldCallRealDebugger): Deleted.
(WebKit::isWindowActive): Deleted.
(WebKit::getCurrentEventButtonState): Deleted.
(WebKit::carbonWindowShown): Deleted.
(WebKit::carbonWindowHidden): Deleted.
(WebKit::openCFURLRef): Deleted.
(WebKit::isMallocTinyMemoryTag): Deleted.
(WebKit::shouldMapMemoryExecutable): Deleted.
* PluginProcess/mac/PluginProcessShim.h:
* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shimDebugger): Deleted.
(WebKit::shimGetCurrentEventButtonState): Deleted.
(WebKit::shimIsWindowActive): Deleted.
(WebKit::shimModalDialog): Deleted.
(WebKit::shimAlert): Deleted.
(WebKit::shimShowWindow): Deleted.
(WebKit::shimHideWindow): Deleted.
(WebKit::shimLSOpenCFURLRef): Deleted.
(WebKit::shimMachVMMap): Deleted.
* Shared/API/Cocoa/WKFoundation.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginArchitecture):
(WebKit::NetscapePluginModule::determineQuirks):
* Shared/Plugins/PluginQuirks.h:
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::sizeForNumberType):
* Shared/mac/WebEventFactory.mm:
(WebKit::mouseButtonForEvent):
(WebKit::globalPointForEvent):
(WebKit::pointForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageLoadFileReturningNavigation):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::pressureChangeWithEvent):
* UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::ServicesController):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
(WebKit::NetscapePlugin::isWindowActive const): Deleted.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::setDrawingModel):
(WebKit::NetscapePlugin::setEventModel):
(WebKit::NetscapePlugin::platformPostInitialize):
(WebKit::NetscapePlugin::platformDestroy):
(WebKit::NetscapePlugin::platformGeometryDidChange):
(WebKit::NetscapePlugin::platformPaint):
(WebKit::NetscapePlugin::platformHandleMouseEvent):
(WebKit::NetscapePlugin::platformHandleWheelEvent):
(WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
(WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
(WebKit::NetscapePlugin::platformHandleKeyboardEvent):
(WebKit::NetscapePlugin::platformSetFocus):
(WebKit::NetscapePlugin::windowFocusChanged):
(WebKit::NetscapePlugin::windowAndViewFramesChanged):
(WebKit::NetscapePlugin::sendComplexTextInput):
(): Deleted.
(WebKit::windowMap): Deleted.
(WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
(WebKit::NetscapePlugin::windowRef const): Deleted.
(WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
(WebKit::NetscapePlugin::buttonState): Deleted.
(WebKit::initializeEventRecord): Deleted.
(WebKit::anyMouseButtonIsDown): Deleted.
(WebKit::rightMouseButtonIsDown): Deleted.
(WebKit::modifiersForEvent): Deleted.
(WebKit::convertStringToKeyCodes): Deleted.
(WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
(WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
2019-03-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
https://bugs.webkit.org/show_bug.cgi?id=195252
<rdar://problem/48539446>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-03-02 Tim Horton <timothy_horton@apple.com>
Move EditingRange <-> Range methods to EditingRange instead of WebPage
https://bugs.webkit.org/show_bug.cgi?id=195201
Reviewed by Sam Weinig.
* Shared/EditingRange.h:
* Shared/EditingRange.cpp:
Also, modernize the coders.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):
(WebKit::WebPage::getMarkedRangeAsync):
(WebKit::WebPage::getSelectedRangeAsync):
(WebKit::WebPage::characterIndexForPointAsync):
(WebKit::WebPage::firstRectForCharacterRangeAsync):
(WebKit::WebPage::setCompositionAsync):
(WebKit::WebPage::rangeFromEditingRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::insertDictatedTextAsync):
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
2019-03-02 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Programmatic paste access should be granted when copying and pasting within the same origin
https://bugs.webkit.org/show_bug.cgi?id=195053
<rdar://problem/48134710>
Reviewed by Ryosuke Niwa.
Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
immediately invoke the programmatic paste handler.
* Scripts/webkit/messages.py:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDOMPasteAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _willHideMenu:]):
(-[WKContentView pasteForWebView:]):
(-[WKContentView _handleDOMPasteRequestWithResult:]):
(-[WKContentView _willPerformAction:sender:]):
(-[WKContentView _didPerformAction:sender:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(allPasteboardItemOriginsMatchOrigin):
(-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
(-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
this happens, we only grant access for the current paste command, rather than granting access for the user
gesture token.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestDOMPasteAccess):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestDOMPasteAccess):
* WebProcess/WebPage/WebPage.h:
2019-02-27 Darin Adler <darin@apple.com>
Fixed makeString(float) to do shortest-form serialization without first converting to double
https://bugs.webkit.org/show_bug.cgi?id=195142
Reviewed by Daniel Bates.
* UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
2019-03-02 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Public API headers are missing autocleanup definitions
https://bugs.webkit.org/show_bug.cgi?id=195211
Reviewed by Philippe Normand.
* PlatformWPE.cmake: List new API headers as installable.
* UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
port, adapted to fit the WPE port.
* UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
from the equivalent header of the GTK port.
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
WebKitWebExtensionAutocleanups.h
2019-03-02 Michael Catanzaro <mcatanzaro@igalia.com>
Remove unused WebPageProxy::m_navigationID
https://bugs.webkit.org/show_bug.cgi?id=195209
Reviewed by Darin Adler.
WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
debug LOG(). It must be a refactoring mistake.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
2019-03-01 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
a problem where we passed an NSData * to format with a "%s"."
2019-03-01 Chris Dumez <cdumez@apple.com>
Unreviewed Windows build fix after r242302.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-03-01 Alex Christensen <achristensen@webkit.org>
NetworkDataTask redirection should not keep alive its NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=194927
Reviewed by Darin Adler.
This should fix rdar://problem/47580502
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2019-03-01 Alex Christensen <achristensen@webkit.org>
Revert r241223, r241235, and r241287
https://bugs.webkit.org/show_bug.cgi?id=194427
<rdar://48045861>
This caused crashes, and feature design has evolved away from needing the daemon in this form.
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCEventHandler): Deleted.
(WebKit::XPCInitializationHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
* UIProcess/WebProcessPool.h:
2019-03-01 Alex Christensen <achristensen@webkit.org>
Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
https://bugs.webkit.org/show_bug.cgi?id=195229
<rdar://problem/48520362>
Reviewed by Chris Dumez.
Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
Functionality verified by manual testing. See radar.
Added an API test that verifies the setter restrictions work as expected.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
(-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentRequest):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
(WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
(WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
2019-03-01 Antoine Quint <graouts@apple.com>
[iOS] Turn mouse event simulation on by default
https://bugs.webkit.org/show_bug.cgi?id=195218
<rdar://problem/48516794>
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2019-03-01 Ross Kirsling <ross.kirsling@sony.com>
EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
https://bugs.webkit.org/show_bug.cgi?id=194612
Reviewed by Alex Christensen.
This API test really shouldn't be verifying that the actual environment was successfully modified.
At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
simple functions -- one for string processing, one for environment processing -- the API test only needs to
worry about the former.
* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripEntriesEndingWith):
(WebKit::EnvironmentUtilities::removeValuesEndingWith):
(WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
* Platform/unix/EnvironmentUtilities.h:
Replace old function with a pair of simpler ones.
* NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
(NetworkServiceInitializer):
* PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
(PluginServiceInitializer):
* WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
(WebContentServiceInitializer):
Update function name.
2019-03-01 Don Olmstead <don.olmstead@sony.com>
Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
https://bugs.webkit.org/show_bug.cgi?id=194844
Reviewed by Youenn Fablet.
Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
a crash in Windows when running a Service Worker.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
2019-03-01 John Wilander <wilander@apple.com>
Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
https://bugs.webkit.org/show_bug.cgi?id=195196
<rdar://problem/48006419>
Reviewed by Brent Fulgham.
Trackers abuse link query parameters to transport user identifiers cross-site.
This patch detects such navigations and applies further restrictions to
client-site cookies on the destination page.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
Reporting IPC message when a link decorated cross-site navigation happens.
(WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
Added clearing of the new state between test runs.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
Test infrastructure.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::isNonUniqueNavigationWithLinkDecoration):
Convenience function.
(WebKit::WebPageProxy::didCommitLoadForFrame):
This function now reports to the network process when a link decorated
cross-site navigation happens.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
Test infrastructure.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
Name change of function called.
2019-03-01 Tim Horton <timothy_horton@apple.com>
Remove unused code in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=189614
Reviewed by Simon Fraser.
* mac/MigrateHeadersFromWebKitLegacy.make:
2019-03-01 Tim Horton <timothy_horton@apple.com>
Modernize WebKit::AttributedString a little bit
https://bugs.webkit.org/show_bug.cgi?id=195200
Reviewed by Wenson Hsieh.
* Shared/mac/AttributedString.h:
(WebKit::AttributedString::AttributedString):
(WebKit::AttributedString::operator NSAttributedString * const):
* Shared/mac/AttributedString.mm:
(IPC::ArgumentCoder<WebKit::AttributedString>::encode):
(IPC::ArgumentCoder<WebKit::AttributedString>::decode):
(WebKit::AttributedString::encode const): Deleted.
(WebKit::AttributedString::decode): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::attributedSubstringForProposedRange):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
Modern coders, and a constructor and cast operator to/from NSAttributedString.
Also adopt those in a few places just for fun.
2019-03-01 Youenn Fablet <youenn@apple.com>
Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
https://bugs.webkit.org/show_bug.cgi?id=195213
Reviewed by Alex Christensen.
Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* Scripts/webkit/messages.py:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):
2019-03-01 Don Olmstead <don.olmstead@sony.com>
[WinCairo] Enable service worker
https://bugs.webkit.org/show_bug.cgi?id=188318
Reviewed by Youenn Fablet.
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateProcess):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* config.h:
2019-03-01 Chris Dumez <cdumez@apple.com>
Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
https://bugs.webkit.org/show_bug.cgi?id=195110
Reviewed by Ryosuke Niwa.
The test was attempting to disable PageCache via view preferences instead of using the
process pool configuration flag. This would fail to disable PageCache because the
usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
objects would get destroyed, which would lead to flakiness.
This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
pages proxies when the usesPageCache preference is set to false.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2019-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
[ThreadedCompositor] Simply the compositing run loop worker thread
https://bugs.webkit.org/show_bug.cgi?id=195208
Reviewed by Don Olmstead.
We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
so that the implementation is not specific to the generic WorkQueue implementation.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
(WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
(WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
(WebKit::CompositingRunLoop::performTask): Use m_runLoop.
(WebKit::CompositingRunLoop::performTaskSync): Ditto.
(WebKit::WorkQueuePool::singleton): Deleted.
(WebKit::WorkQueuePool::dispatch): Deleted.
(WebKit::WorkQueuePool::runLoop): Deleted.
(WebKit::WorkQueuePool::invalidate): Deleted.
(WebKit::WorkQueuePool::WorkQueuePool): Deleted.
(WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
(): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2019-03-01 Justin Fan <justin_fan@apple.com>
[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
https://bugs.webkit.org/show_bug.cgi?id=195191
Rubber-stamped by Dean Jackson.
Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
* Configurations/FeatureDefines.xcconfig:
2019-02-28 Chris Dumez <cdumez@apple.com>
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>
Reviewed by Youenn Fablet.
HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2019-02-28 David Quesada <david_quesada@apple.com>
Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=195121
rdar://problem/48450302
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction _shouldPerformDownload]):
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2019-02-28 Antoine Quint <graouts@apple.com>
Disable Web Animations in Safari Technology Preview
https://bugs.webkit.org/show_bug.cgi?id=194748
<rdar://problem/48139481>
Reviewed by Dean Jackson.
The test runners already opt into that feature explicitly, so all that is needed is to turn
the default setting value to false.
* Shared/WebPreferences.yaml:
2019-02-28 Antoine Quint <graouts@apple.com>
Enable the Pointer Events runtime flag by default
https://bugs.webkit.org/show_bug.cgi?id=195156
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2019-02-28 Sihui Liu <sihui_liu@apple.com>
Revert r232263: it caused processes to crash because process was suspended with locked file
https://bugs.webkit.org/show_bug.cgi?id=195122
<rdar://problem/48444599>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkProcess.h:
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
* WebProcess/WebProcess.h:
2019-02-28 Per Arne Vollan <pvollan@apple.com>
[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
https://bugs.webkit.org/show_bug.cgi?id=193683
<rdar://problem/47634345>
Reviewed by Brent Fulgham.
When a keyboard is attached/deattached or the application becomes foreground, send a message from
the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
to be expensive.
* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::setKeyboardIsAttached):
(WebKit::WebProcessProxy::keyboardIsAttached const):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationWillEnterForeground):
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
https://bugs.webkit.org/show_bug.cgi?id=195159
Reviewed by Don Olmstead.
Use COORDINATED_GRAPHICS instead.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::viewportPropertiesDidChange):
* WebProcess/gtk/WebProcessMainGtk.cpp:
2019-02-28 Sihui Liu <sihui_liu@apple.com>
Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=194958
Reviewed by Geoffrey Garen.
ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::createLegacy):
(API::indexedDBDatabaseDirectory):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] Unify all LayerTreeHost classes
https://bugs.webkit.org/show_bug.cgi?id=195094
Reviewed by Žan Doberšek.
There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
ports.
* PlatformWin.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::invalidate):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::didChangeViewport):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::didFlushRootLayer):
(WebKit::LayerTreeHost::commitSceneState):
(WebKit::LayerTreeHost::frameComplete):
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::didDestroyGLContext):
(WebKit::LayerTreeHost::willRenderFrame):
(WebKit::LayerTreeHost::didRenderFrame):
(WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
* WebProcess/WebPage/LayerTreeHost.cpp: Removed.
* WebProcess/WebPage/LayerTreeHost.h: Removed.
* WebPage/win/LayerTreeHost.h: Added.
2019-02-28 Justin Fan <justin_fan@apple.com>
[Web GPU] Enable Web GPU only on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=195139
Because Metal is only supported on 64 bit apps.
Unreviewed build fix.
* Configurations/FeatureDefines.xcconfig:
2019-02-27 Simon Fraser <simon.fraser@apple.com>
Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion):
2019-02-27 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wformat warning
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
2019-02-27 Brent Fulgham <bfulgham@apple.com>
REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
https://bugs.webkit.org/show_bug.cgi?id=195072
Reviewed by Ryosuke Niwa.
ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
was disconnected), just like we do for other message send cases.
This patch switches from using the m_networkProcessConnection member (which might be null) to use the
'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2019-02-27 Chris Dumez <cdumez@apple.com>
Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
https://bugs.webkit.org/show_bug.cgi?id=194480
Reviewed by Brady Eidson.
The StorageManager would only start listening for IPC on a given connection when
StorageManager::processWillOpenConnection() is called. This gets called from
WebsiteDataStore::webProcessWillOpenConnection() which gets called from
WebProcessLifetimeTracker::webPageEnteringWebProcess().
webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
after process-swapping. This means that IPC comming from the *provisional* process
would not get processed and we would only start processing IPC on the provisional
process's connection when it would get committed.
To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
now have several processes. We also make sure that webPageEnteringWebProcess() gets
called for the provisional process as soon as we create the provisional page, instead
of waiting for it to get committed.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::connectionWillOpen):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::connectionWillOpen):
(WebKit::WebPageProxy::webProcessWillShutDown):
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::webProcessLifetimeTracker):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::addObserver):
(WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
(WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
(WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
(WebKit::WebProcessLifetimeTracker::processIsRunning):
* UIProcess/WebProcessLifetimeTracker.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connectionWillOpen):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
(WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::processWillOpenConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
(WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
(WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::webPageWillOpenConnection):
(WebKit::WebsiteDataStore::webPageDidCloseConnection):
2019-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
https://bugs.webkit.org/show_bug.cgi?id=195118
<rdar://problem/43411940>
Reviewed by Tim Horton.
It's currently possible for websites to redirect focus into an editable element on the page by programmatically
requesting focus within the "blur" event handler. This is because our current heuristics:
(1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
the case where the page moves focus between different elements on the page.
(2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
the case where a focused element should show the keyboard when first responder is restored on a web view
(e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
again).
In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
before showing the keyboard due to activity state change or focused element change.
Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView textInputTraits]):
Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
terminology used in WebKit.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
logic into a lambda function and using early returns. See above for more details.
(-[WKContentView _elementDidBlur]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
2019-02-27 John Wilander <wilander@apple.com>
Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=195071
<rdar://problem/48417690>
Reviewed by Alex Christensen and Brent Fulgham.
This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
and makes the necessary infrastructure changes to support that.
The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL.
Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
* NetworkProcess/NetworkSession.h:
* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
* UIProcess/WebPageProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
2019-02-27 Keith Rollin <krollin@apple.com>
Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
https://bugs.webkit.org/show_bug.cgi?id=195109
<rdar://problem/48442272>
Reviewed by Alexey Proskuryakov.
In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
Z's in hexadecimal strings). While these UUIDs haven't caused any
problems in practice over the last six years, they are indeed invalid,
and were discovered via an Xcode-project processing tool that did not
anticipate their format. Fix this by removing the files from the
project and re-adding them.
* WebKit.xcodeproj/project.pbxproj:
2019-02-27 Youenn Fablet <youenn@apple.com>
Remove UserMediaProcessManager processState map
https://bugs.webkit.org/show_bug.cgi?id=195056
Reviewed by Eric Carlson.
Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
To improve on this model, this patch does the following:
- Move the process state to WebProcessProxy.
- Remove the map and replace it by a set of all manager proxies.
This simplifies the handling.
On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::forEach):
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
(WebKit::UserMediaProcessManager::setCaptureEnabled):
(WebKit::UserMediaProcessManager::captureDevicesChanged):
(WebKit::ProcessState::ProcessState): Deleted.
(WebKit::ProcessState::hasVideoExtension const): Deleted.
(WebKit::ProcessState::grantVideoExtension): Deleted.
(WebKit::ProcessState::revokeVideoExtension): Deleted.
(WebKit::ProcessState::hasAudioExtension const): Deleted.
(WebKit::ProcessState::grantAudioExtension): Deleted.
(WebKit::ProcessState::revokeAudioExtension): Deleted.
(WebKit::stateMap): Deleted.
(WebKit::processState): Deleted.
(WebKit::ProcessState::addRequestManager): Deleted.
(WebKit::ProcessState::removeRequestManager): Deleted.
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
(WebKit::WebProcessProxy::hasVideoCaptureExtension const):
(WebKit::WebProcessProxy::grantVideoCaptureExtension):
(WebKit::WebProcessProxy::revokeVideoCaptureExtension):
(WebKit::WebProcessProxy::hasAudioCaptureExtension const):
(WebKit::WebProcessProxy::grantAudioCaptureExtension):
(WebKit::WebProcessProxy::revokeAudioCaptureExtension):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
(WebKit::UserMediaPermissionRequestManager::clear): Deleted.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-02-27 Per Arne Vollan <pvollan@apple.com>
[macOS] Disable permissive call logging in sandbox
https://bugs.webkit.org/show_bug.cgi?id=194061
<rdar://problem/47686253>
Reviewed by Brent Fulgham.
Strict call filtering should be reenabled.
* WebProcess/com.apple.WebProcess.sb.in:
2019-02-27 Chris Dumez <cdumez@apple.com>
[HTTPSUpgrade] Use open source database until the feature is ready
https://bugs.webkit.org/show_bug.cgi?id=195069
<rdar://problem/47838224>
Reviewed by Geoffrey Garen.
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
2019-02-27 Antoine Quint <graouts@apple.com>
Support Pointer Events on macOS
https://bugs.webkit.org/show_bug.cgi?id=195008
<rdar://problem/47454419>
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
2019-02-27 Sihui Liu <sihui_liu@apple.com>
Network Process is put to suspended when holding locked IndexedDB files
https://bugs.webkit.org/show_bug.cgi?id=195024
<rdar://problem/45194169>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::notifyHoldingLockedFiles):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
2019-02-26 Simon Fraser <simon.fraser@apple.com>
Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973
Reviewed by Antti Koivisto.
This patch cleans up how the scrolling tree responds to scrolls.
First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
UI process scroll position.
On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
updates related layers on this node (counter-scrolling layers etc), and then tells the
scrolling tree, which recurses through descendant nodes so they can adjust their layer
positions.
On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
which does the above other than setting scrolledContentsLayer (since we're reacting to
layer state changes, not producing them).
updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
ScrollingTree does the tree walk so classes don't have to implement
updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
need to cross frame boundaries).
We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
since the fixed state was computed with the "layout" scroll position, so we have to account
for the scroll delta since the last committed position. It's possible we could improve this
in future.
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
(WebKit::ScrollerPairMac::updateValues):
(WebKit::ScrollerPairMac::valuesForOrientation):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2019-02-27 Alex Christensen <achristensen@webkit.org>
Silence log after r242122
https://bugs.webkit.org/show_bug.cgi?id=195074
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath const):
m_localStorageDirectory can now be null for ephemeral sessions.
This is not a failure to create a directory and needs no log.
This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
2019-02-27 Timothy Hatcher <timothy@apple.com>
REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
https://bugs.webkit.org/show_bug.cgi?id=195086
rdar://problem/48419124
Reviewed by Tim Horton.
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
(-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2019-02-26 Chris Dumez <cdumez@apple.com>
[PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
https://bugs.webkit.org/show_bug.cgi?id=195089
Reviewed by Geoffrey Garen.
Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
cache since we need to do this on memory pressure and when clearing website data.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::CachedProcess::~CachedProcess):
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::setIsDisabled): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleMemoryPressureWarning):
(WebKit::WebProcessPool::hasSuspendedPageFor const):
(WebKit::WebProcessPool::clearSuspendedPages):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::suspendedPageCount const):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
2019-02-26 Alex Christensen <achristensen@webkit.org>
Move ephemeral local storage from WebProcess to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=195074
<rdar://problem/47937975>
Reviewed by Geoff Garen.
Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebStorage/StorageManager.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::loadValuesIfNeeded):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::copy):
(): Deleted.
(WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
* WebProcess/WebStorage/StorageNamespaceImpl.h:
2019-02-20 Jer Noble <jer.noble@apple.com>
[Cocoa] Media elements will restart network buffering just before suspending
https://bugs.webkit.org/show_bug.cgi?id=193691
Reviewed by Eric Carlson.
When the WebProcess receives a notification that the process is about to become
suspended, it tells the MemoryPressureHandler to release all critical memory. This
has the side effect of causing AVFoundation-backed media elements to dump their
in-memory caches and start downloading media data again. Instead, media elements
should all stop buffering media data during suspension. Add new testing SPI to
simulate suspension and resume messages.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSuspendImminentlyForTesting]):
(-[WKWebView _processDidResumeForTesting]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WKInkPickerView.mm:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendAllMediaBuffering):
(WebKit::WebPage::resumeAllMediaBuffering):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::suspendAllMediaBuffering):
(WebKit::WebProcess::resumeAllMediaBuffering):
* WebProcess/WebProcess.h:
2019-02-26 Youenn Fablet <youenn@apple.com>
Move service worker response validation from the service worker client to the service worker itself
https://bugs.webkit.org/show_bug.cgi?id=194716
Reviewed by Geoffrey Garen.
Removed response validation as it is now done in service worker side.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195066
<rdar://problem/48411682>
Reviewed by Tim Horton.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
2019-02-26 Per Arne Vollan <pvollan@apple.com>
[iOS] Sandbox should allow mach lookups related to media capturing
https://bugs.webkit.org/show_bug.cgi?id=194951
Reviewed by Eric Carlson.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-26 Brent Fulgham <bfulgham@apple.com>
Update NetworkSession to use Session Cleanup when available
https://bugs.webkit.org/show_bug.cgi?id=195019
<rdar://problem/45149868>
Reviewed by Alex Christensen.
If the build environment supports Session Cleanup, initialize it.
No test changes since this doesn't do anything on the test systems at present.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2019-02-26 Chris Dumez <cdumez@apple.com>
[iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
https://bugs.webkit.org/show_bug.cgi?id=195054
<rdar://problem/48330549>
Reviewed by Geoff Garen.
We attempt to restore the scroll position twice, on first layout and then on load completion.
Before PSON, the scroll position would fail to get restored on first layout but would succeed
on load completion because the view is tall enough by then. With PSON however, we would
fail to restore the scroll position on load completion because the view would not be tall
enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
and would then get reloaded abd finish loading *after* the load event.
To address the issue, we now make sure to not purge the memory cache on process suspension on
iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::incrementSuspendedPageCount):
(WebKit::WebProcessProxy::decrementSuspendedPageCount):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setHasSuspendedPageProxy):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-02-26 Ryosuke Niwa <rniwa@webkit.org>
[iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
https://bugs.webkit.org/show_bug.cgi?id=195037
<rdar://problem/48154508>
Reviewed by Antti Koivisto.
Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
as this has been an issue when I was able to reproduce the issue locally.
Also added release logging to help diagnose the issue in the future.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):
2019-02-26 Youenn Fablet <youenn@apple.com>
Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
https://bugs.webkit.org/show_bug.cgi?id=195051
Reviewed by Eric Carlson.
Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
in some methods to reset its state when main document is changing, view is becoming visible...
This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
(WebKit::WebPageProxy::didChangeMainDocument):
(WebKit::WebPageProxy::viewIsBecomingVisible):
(WebKit::WebPageProxy::clearUserMediaState):
(WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
since there is or was some capturing done for the page.
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
https://bugs.webkit.org/show_bug.cgi?id=195023
<rdar://problem/48381885>
Reviewed by Tim Horton.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2019-02-26 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
https://bugs.webkit.org/show_bug.cgi?id=191652
Reviewed by Alex Christensen.
Test: http/tests/security/401-logout/401-logout.php
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2019-02-26 Youenn Fablet <youenn@apple.com>
WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
https://bugs.webkit.org/show_bug.cgi?id=195028
<rdar://problem/48243733>
Reviewed by Eric Carlson.
Covered by API test.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
2019-02-26 Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Add API for webview background color configuration
https://bugs.webkit.org/show_bug.cgi?id=192305
Reviewed by Michael Catanzaro.
In the case of WPE we need to send the background color to the web process to be used as the background color of
the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
color.
* PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
transparent color.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
(WebKit::WebPageCreationParameters::decode): Ditto.
* Shared/WebPageCreationParameters.h:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebView.cpp:
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkit_web_view_set_background_color):
(webkit_web_view_get_background_color):
* UIProcess/API/wpe/WebKitColor.cpp: Added.
(webkit_color_copy):
(webkit_color_free):
(webkitColorToWebCoreColor):
(webkitColorFillFromWebCoreColor):
(webkit_color_parse):
* UIProcess/API/wpe/WebKitColor.h: Added.
* UIProcess/API/wpe/WebKitColorPrivate.h: Added.
* UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
* UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
(webkit_web_view_set_background_color):
(webkit_web_view_get_background_color):
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
(WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
(WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::drawsBackground const):
(WebKit::WebPageProxy::backgroundColor const):
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
* UIProcess/gtk/AcceleratedBackingStore.cpp:
* UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::paint): Ditto.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
UIProcess when creating the FrameView.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
* WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
2019-02-25 Yongjun Zhang <yongjun_zhang@apple.com>
scalableNativeWebpageParameters() is not preserved on new page navigation.
https://bugs.webkit.org/show_bug.cgi?id=194892
<rdar://problem/47538280>
If a page's current default viewport configuration is scalableNativeWebpageParameters due to
the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
configuration until we derive the right values from viewport meta-tag.
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
get the appropriate default configuration.
2019-02-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Adjust initial scale zooming heuristics when changing view scale
https://bugs.webkit.org/show_bug.cgi?id=194995
Reviewed by Tim Horton.
Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
happening.
To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
2019-02-25 John Wilander <wilander@apple.com>
Introduce and adopt new class RegistrableDomain for eTLD+1
https://bugs.webkit.org/show_bug.cgi?id=194791
<rdar://problem/48179240>
Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
A new API test was added. Plenty of existing layout tests under
http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
This patch introduces and adopts a new class called WebCore::RegistrableDomain
which represents a domain's eTLD+1 (effective top level domain plus one) and is
the basis for the term "site," as in same-site. Other popular names include
high-level domain, primary domain, and top privately controlled/owned domain.
Effective top level domains are enumerated on the Public Suffix List
(https://publicsuffix.org).
This class just uses the full domain for when the Public Suffix List cannot help
finding the registrable domain and for WebKit ports that haven't enabled
PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
for the null or unique origin (this matches how these origins were handled
before).
The implementation is a wrapper around a String and the functions and class
members that now make use of this new class used to handle regular String
objects which didn't help much in terms of type safety or guarantees that the
string had already been converted to an eTLD+1.
We've at least two bad bugs in the Storage Access API because of confusion
between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
will prohibit such bugs in the future.
Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
WebCore::RegistrableDomain for partitioning in a later patch.
This patch also enhances parameter naming by:
- Removing parts that refer to "primary" as in primaryDomain.
- Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
- Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
- Using the term "domain" consistently instead of e.g. "host."
A follow-up patch will continue backwards in call chains to create
WebCore::RegistrableDomain objects as early as possible instead of using strings.
I did not do that work here in the interest of patch size.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::domainsToString):
(WebKit::pruneResources):
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
(WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::debugLogDomainsInBatches):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
(WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
(WebKit::isolatedPrimaryDomain): Deleted.
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
(WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::isGrandfathered):
(WebKit::NetworkProcess::isPrevalentResource):
(WebKit::NetworkProcess::isVeryPrevalentResource):
(WebKit::NetworkProcess::setGrandfathered):
(WebKit::NetworkProcess::setPrevalentResource):
(WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcess::setVeryPrevalentResource):
(WebKit::NetworkProcess::clearPrevalentResource):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcess::setLastSeen):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::hasStorageAccess):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::requestStorageAccessGranted):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::logFrameNavigation):
(WebKit::NetworkProcess::logUserInteraction):
(WebKit::NetworkProcess::hadUserInteraction):
(WebKit::NetworkProcess::clearUserInteraction):
(WebKit::NetworkProcess::removePrevalentDomains):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::filterForTopLevelDomains): Deleted.
(WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
(WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::logCookieInformationInternal):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::NetworkSession::registrableDomainsWithWebsiteData):
(WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
(WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
* NetworkProcess/NetworkSession.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
(WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
(WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
(WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logFrameNavigation):
(WebKit::WebPageProxy::requestStorageAccessConfirm):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
(WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
(WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
(WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
(WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebProcess.cpp:
(WebKit::m_nonVisibleProcessCleanupTimer):
(WebKit::WebProcess::initializeWebProcess):
2019-02-25 Adrian Perez de Castro <aperez@igalia.com>
[WPE] Bump WPEBackend-fdo requirement to API version 1.0
https://bugs.webkit.org/show_bug.cgi?id=195001
Reviewed by Carlos Garcia Campos.
API version 1.0 always includes the functionality previously guarded with
WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
unconditionally.
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
(WKWPE::m_backend): Ditto.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
(WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
library name, remove call to wpe_fdo_initialize_for_egl_display().
(WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
here, to bail out early in case initialization fails.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
WPE_BACKEND_CHECK_VERSION().
2019-02-25 Per Arne Vollan <pvollan@apple.com>
A prewarmed Web process should have a process assertion.
https://bugs.webkit.org/show_bug.cgi?id=195006
Reviewed by Geoffrey Garen.
To make sure the prewarm message is handled in the Web process before the process is suspended,
the process should have a process assertion. This can be fixed by sending the prewarm message
inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
guaranteed to be handled before the WebContent process is suspended.
This patch is based on Chris Dumez' idea and obervation of the issue.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
2019-02-25 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Enable PSON
https://bugs.webkit.org/show_bug.cgi?id=194979
Reviewed by Žan Doberšek.
It is expected that this may introduce unexpected regressions, so it's appropriate to do
this at the start of a new release cycle.
* Shared/WebPreferencesDefaultValues.h:
2019-02-25 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
https://bugs.webkit.org/show_bug.cgi?id=194614
Reviewed by Carlos Garcia Campos.
This environment variable is now enabled for WPE, not just for GTK.
It is now possible to use this environment variable to enable complex text, not just to
disable it.
WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
environment variable is set, although WPE and GTK will never do so.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
2019-02-24 Zalan Bujtas <zalan@apple.com>
Introduce ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=194977
<rdar://problem/48338115>
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2019-02-24 Simon Fraser <simon.fraser@apple.com>
Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194984
Reviewed by Sam Weinig.
Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
current layout viewport rect. Instead, set the layout viewport on the root
node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
Add a WK2 Scrolling log channel.
* Platform/Logging.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2019-02-20 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
a problem where we passed an NSData * to format with a "%s"."
2019-02-24 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE] Install MemoryPressureHandler in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=194617
Reviewed by Žan Doberšek.
Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
too.
We need @no-unify to avoid changing the unified source bundles under API/, which are
notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
* SourcesWPE.txt:
* UIProcess/WebMemoryPressureHandler.cpp:
(WebKit::installMemoryPressureHandler):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):
2019-02-23 Chris Dumez <cdumez@apple.com>
Give DrawingAreas their own identifiers
https://bugs.webkit.org/show_bug.cgi?id=194969
<rdar://problem/48154508>
Unreviewed, fix API test debug assertion failures after r241988.
We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
nullopt when there this no UIClient or the client did not create the page, instead of returning a
default-initialized WebPageCreationParameters.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
2019-02-23 Simon Fraser <simon.fraser@apple.com>
Remove remnants of iOS WK1 scrolling tree code
https://bugs.webkit.org/show_bug.cgi?id=194980
Reviewed by Sam Weinig.
Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2019-02-23 Keith Miller <keith_miller@apple.com>
Add new mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=194955
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2019-02-22 Chris Dumez <cdumez@apple.com>
Give DrawingAreas their own identifiers
https://bugs.webkit.org/show_bug.cgi?id=194969
<rdar://problem/48154508>
Reviewed by Geoffrey Garen.
Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
WebPageProxy can have several drawing areas with PSON.
* Shared/DrawingAreaInfo.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
(WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::~DrawingAreaProxy):
(WebKit::DrawingAreaProxy::messageSenderConnection const):
(WebKit::DrawingAreaProxy::sendMessage):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::identifier const):
(WebKit::DrawingAreaProxy::process const):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::update):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::initializeWebPage):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
(WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
(WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::DrawingArea):
(WebKit::DrawingArea::removeMessageReceiverIfNeeded):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::identifier const):
(WebKit::DrawingArea::send):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
(WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
2019-02-22 Andy Estes <aestes@apple.com>
[Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
https://bugs.webkit.org/show_bug.cgi?id=194971
<rdar://problem/35786264>
Reviewed by Tim Horton.
sandbox_extension_issue_file is not actually deprecated.
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2019-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
https://bugs.webkit.org/show_bug.cgi?id=194873
<rdar://problem/46701974>
Reviewed by Tim Horton.
On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
that system controls overlap controls in the page.
Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
<rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
UIKit presents the callout menu.
This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
determining the approximate location of controls in the page which might overlap the callout menu. This
heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
presenting the system callout menu.
The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
roll their own context menu or toolbar in their rich text editor.
Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
attempting to invoke a nil block.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
See above for more detail.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestEvasionRectsAboveSelection):
2019-02-22 Simon Fraser <simon.fraser@apple.com>
Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2019-02-22 Chris Dumez <cdumez@apple.com>
Regression(PSON) Unable to preview password-protected documents on iCloud.com
https://bugs.webkit.org/show_bug.cgi?id=194954
<rdar://problem/48127957>
Reviewed by Alex Christensen.
Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
IPC on iOS.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
2019-02-22 Per Arne Vollan <pvollan@apple.com>
[iOS] Sandbox should allow mach lookups related to media capturing
https://bugs.webkit.org/show_bug.cgi?id=194951
<rdar://problem/48013875>
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-22 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Navigation gesture improvements
https://bugs.webkit.org/show_bug.cgi?id=194943
Reviewed by Michael Catanzaro.
Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
Allow to continue the gesture during animation. Introduce finished state to be used
when showing snapshot after the animation ends.
Fix duration calculation, also slow it down so that the initial velocity matches
what it was during the gesture.
* UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
Fix velocity calculation, allow scrolling during State::Animating.
(WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
(WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
2019-02-22 Chris Dumez <cdumez@apple.com>
REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
https://bugs.webkit.org/show_bug.cgi?id=194924
<rdar://problem/48216125>
Reviewed by Geoffrey Garen.
When process-swapping, we would create a new WebPage in the new process, which would
call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
backforward list. The issue is that this session restoring would send HistoryItem
updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
With PSON though, this may end up overwriting values set by the previous process,
such as the scroll position.
Address the issue by temporarily disabling the HistoryItem update notifications to
the UIProcess while restoring a session.
* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _scrollPosition]):
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSessionInternal):
2019-02-21 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
https://bugs.webkit.org/show_bug.cgi?id=194908
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
* UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
2019-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
wpewebkit-2.23.90 Failing to build on Fedora
https://bugs.webkit.org/show_bug.cgi?id=194922
Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
* PlatformWPE.cmake:
2019-02-21 Simon Fraser <simon.fraser@apple.com>
Hardcode Visual Viewports on everywhere except iOS WK1
https://bugs.webkit.org/show_bug.cgi?id=194928
Reviewed by Zalan Bujtas.
Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.
Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.
Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _visualViewportEnabled]): Deleted.
(-[WKPreferences _setVisualViewportEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):
2019-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Epiphany searching for plugins even if plugins are disabled
https://bugs.webkit.org/show_bug.cgi?id=194352
Reviewed by Michael Catanzaro.
Check pluginsEnabled setting before trying to get plugins from UI process.
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):
2019-02-21 Darin Adler <darin@apple.com>
Some refinements for Node and Document
https://bugs.webkit.org/show_bug.cgi?id=194764
Reviewed by Ryosuke Niwa.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
calling a bunch of WebCore code first. No real value in checking arguments or doing any work.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
No need to override the function inherited from the base class, nor to keep track of the
unnecessary task of implementing this some day.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
2019-02-21 Ryosuke Niwa <rniwa@webkit.org>
Discard cached processes when clearing website data store
https://bugs.webkit.org/show_bug.cgi?id=194894
Reviewed by Chris Dumez.
Clear the process cache when clearing the website data store so that there is no way to infer
which site the user had visited by observing for which sites WebContent processes had been cached.
There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
cache during this time as it would otherwise trigger the responsiveness check of WebContent process
can take arbitrarily long time.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _processCacheCapacity]): Added for testing.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
pages are being cleared.
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::disabled const): Added.
(WebKit::WebProcessCache::setDisabled): Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleMemoryPressureWarning):
(WebKit::WebProcessPool::clearSuspendedPages): Added.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
2019-02-21 Alex Christensen <achristensen@webkit.org>
Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
https://bugs.webkit.org/show_bug.cgi?id=194914
<rdar://problem/47586889>
Reviewed by Geoffrey Garen.
* UIProcess/API/APIUIClient.h:
(API::UIClient::didShowSafeBrowsingWarning):
(API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-02-21 Tim Horton <timothy_horton@apple.com>
Turn a high-value UI-side-compositing assertion into a release assert
https://bugs.webkit.org/show_bug.cgi?id=194887
Reviewed by Simon Fraser.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
There is absolutely no situation in which this assert should fire
if WebKit is behaving correctly, and it will basically always result
in a UI process crash (or at least confusion), so make it a release assert.
This would have saved us a lot of stress in bug 194845.
2019-02-21 Don Olmstead <don.olmstead@sony.com>
[MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=194913
Reviewed by Brent Fulgham.
MSVC has problems with the scoping of `this` within a nested lambda. To work around the
behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2019-02-21 Chris Dumez <cdumez@apple.com>
Fix API test crashes after r241855.
Reviewed by Ryosuke Niwa.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):
2019-02-21 Alex Christensen <achristensen@webkit.org>
API::HTTPCookieStore should expose setCookies()
https://bugs.webkit.org/show_bug.cgi?id=194861
Reviewed by Brent Fulgham.
Pass a Vector<Cookie> instead of just one cookie at a time.
This will add the ability to set multiple cookies without an IPC roundtrip per cookie.
* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setCookie):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::setCookie): Deleted.
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore setCookie:completionHandler:]):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::setCookie): Deleted.
* UIProcess/WebCookieManagerProxy.h:
2019-02-21 Antoine Quint <graouts@apple.com>
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>
Reviewed by Tim Horton.
Follow-up commit to ensure this SPI is only called on newer versions of iOS.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]):
2019-02-21 Tim Horton <timothy_horton@apple.com>
Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
https://bugs.webkit.org/show_bug.cgi?id=194845
<rdar://problem/47944579>
Reviewed by Antti Koivisto.
New test: ProcessSwap.PageOverlayLayerPersistence
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
Keep track of all properties that have ever changed on a layer, so we
can re-send them if a layer moves between contexts.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::~DrawingArea):
(WebKit::DrawingArea::removeMessageReceiverIfNeeded):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerHostDidFlushLayers):
Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
so that we can keep two DrawingAreas alive in a single process for a short time.
(WebKit::DrawingArea::adoptLayersFromDrawingArea):
Add adoptLayersFromDrawingArea; see below for its only useful implementation.
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
(WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
(WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
(WebKit::GraphicsLayerCARemote::moveToContext):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::createForEmbeddedView):
(WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::moveToContext):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::clone const):
Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
(WebKit::RemoteLayerTreeContext::layerDidEnterContext):
(WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
(WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
(WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
(WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
(WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
Keep track of all GraphicsLayerCARemote instances in the context, like we
do for PlatformCALayerRemote, so that we can update their context backpointers if needed.
Also make it possible to move all outstanding layers to a new context.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
When doing a DrawingArea swap, transition all layers from the old context
to the new one. In order to do this, we temporarily keep both DrawingAreas
alive, but make use of the new mechanism to remove the old one's MessageReceiver
before installing the new one, so that destroying the old one later doesn't
remove it (avoiding re-introducing bug 189481).
2019-02-21 Chris Dumez <cdumez@apple.com>
Unreviewed API test fix after r241855.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
2019-02-21 Antoine Quint <graouts@apple.com>
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>
Reviewed by Dean Jackson.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
to respondsToSelector until the SPI has shipped for OpenSource builds to work.
2019-02-20 Antti Koivisto <antti@apple.com>
Make programmatic frame scrolling work on iOS
https://bugs.webkit.org/show_bug.cgi?id=194886
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
Don't move based on the layout scroll position. This just overrides the user scroll position.
Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):
Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
Remove scroll origin code, it doesn't look correct (and is untested).
2019-02-20 Chris Dumez <cdumez@apple.com>
[PSON] Make sure hung processes are not kept alive by suspended pages or process caching
https://bugs.webkit.org/show_bug.cgi?id=194881
<rdar://problem/48249014>
Reviewed by Geoffrey Garen.
After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
ask it to suspend, start a 10 seconds timer. If the process does not answer the request
to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
keep a hung process around.
For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
before adding it to the cache. Internally, this relies on an IPC handshake with the
WebProcess. If the process is not responsive, we do not add it to the cache and we
shut it down. If it is responsive then we proceed normally with adding it to the
cache.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
(WebKit::SuspendedPageProxy::suspensionTimedOut):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
* UIProcess/WebProcessCache.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::isResponsive):
* UIProcess/WebProcessProxy.h:
2019-02-20 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r241823.
* UIProcess/SuspendedPageProxy.h:
2019-02-20 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r241838.
Broke API tests
Reverted changeset:
"Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
https://bugs.webkit.org/show_bug.cgi?id=194868
https://trac.webkit.org/changeset/241838
2019-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
https://bugs.webkit.org/show_bug.cgi?id=194601
<rdar://problem/48080316>
Reviewed by Tim Horton.
Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.
This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
no autofocused element on the page.
To fix this, when becoming the first responder, additionally install a callback to detect when the page is
finished handling the activity state change, and invalidate the input deferral token then. This retains the
behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
keyboard stable, since the focused element message from the web process should be dispatched when handling the
activity state change within the web process.
Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
watchdog timer with a short delay, after which we unconditionally invalidate the token.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
(-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
(-[WKContentView _resetInputViewDeferral]):
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _didCompleteSyntheticClick]):
Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
method instead that also cancels any scheduled requests to clear the token.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
Respond to all pending callbacks after handling the activity state change.
2019-02-20 Chris Dumez <cdumez@apple.com>
Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
https://bugs.webkit.org/show_bug.cgi?id=194872
<rdar://problem/47924500>
Reviewed by Alex Christensen.
[WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
due to PSON, then the new process does not know about this ReloadOption and fails to honor it.
Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
flag in WebPageProxy::receivedNavigationPolicyDecision().
* UIProcess/API/APINavigation.h:
(API::Navigation::setUserContentExtensionsEnabled):
(API::Navigation::userContentExtensionsEnabled const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2019-02-20 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241817.
Caused 4 API failures
Reverted changeset:
"[GTK] Epiphany searching for plugins even if plugins are
disabled"
https://bugs.webkit.org/show_bug.cgi?id=194352
https://trac.webkit.org/changeset/241817
2019-02-20 Andy Estes <aestes@apple.com>
[Xcode] Add SDKVariant.xcconfig to various Xcode projects
https://bugs.webkit.org/show_bug.cgi?id=194869
Rubber-stamped by Jer Noble.
* WebKit.xcodeproj/project.pbxproj:
2019-02-20 Alex Christensen <achristensen@webkit.org>
Resolve WebsiteDataStore/HTTPCookieStore ref cycle
https://bugs.webkit.org/show_bug.cgi?id=194868
Reviewed by Geoffrey Garen.
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
(API::HTTPCookieStore::ref const):
(API::HTTPCookieStore::deref const):
* UIProcess/API/APIHTTPCookieStore.h:
2019-02-20 Per Arne Vollan <pvollan@apple.com>
[iOS] Open sandbox for specific call.
https://bugs.webkit.org/show_bug.cgi?id=194860
<rdar://problem/48166729>
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-20 Alex Christensen <achristensen@webkit.org>
Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=194842
Reviewed by Geoff Garen.
We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore. It can't be done before this.
This made an existing reference cycle easier to see, and we should fix it in a followup patch.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::httpCookieStore):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::cookieStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-02-20 Chris Dumez <cdumez@apple.com>
Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
https://bugs.webkit.org/show_bug.cgi?id=194857
<rdar://problem/47759323>
Reviewed by Alex Christensen.
The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
a WebFrameProxy using the provided frameID from the wrong process and we would end up
hitting a RELEASE_ASSERT().
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
* UIProcess/WebPageProxy.h:
2019-02-20 Don Olmstead <don.olmstead@sony.com>
[MSVC] Fix compilation errors with lambdas in Service Workers
https://bugs.webkit.org/show_bug.cgi?id=194841
Reviewed by Alex Christensen.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
2019-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Epiphany searching for plugins even if plugins are disabled
https://bugs.webkit.org/show_bug.cgi?id=194352
Reviewed by Michael Catanzaro.
Check pluginsEnabled setting before trying to get plugins from UI process.
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):
2019-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Send client host fd and library name as web process creation parameters
https://bugs.webkit.org/show_bug.cgi?id=194494
Reviewed by Žan Doberšek.
Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process
launcher glib implementation.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):
* WebProcess/wpe/WebProcessMainWPE.cpp:
2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Enable support for CONTENT_EXTENSIONS
https://bugs.webkit.org/show_bug.cgi?id=167941
Reviewed by Carlos Garcia Campos.
Adds new API to manage a collection of content extensions on disk (including compilation
of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
type (which represents a compiled content extension); and the functions needed to enable
and disable them for a given WebKitUserContentManager.
The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
filters into the store (which involves compiling the JSON source rule set); and "loading"
them back as main operations. This way we do not disclose to users of the API any detail
about compilation, nor how contents are laid out on disk, and the documentation explicitly
tells about only using the provided functions to manipulate the on-disk contents. This
way we allow ourselves some leeway if the implementation needs changing in the future.
* PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
* PlatformWPE.cmake: Ditto.
* SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
* SourcesWPE.txt: Ditto.
* UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
* UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.
(_WebKitUserContentFilter::_WebKitUserContentFilter):
(webkit_user_content_filter_ref):
(webkit_user_content_filter_unref):
(webkit_user_content_filter_get_identifier):
(webkitUserContentFilterCreate):
(webkitUserContentFilterGetContentRuleList):
* UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.
(toGError): Utility function to convert content extension error codes to GError.
(webkit_user_content_filter_store_class_init):
(webkit_user_content_filter_store_new):
(webkit_user_content_filter_store_get_path):
(webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
(webkit_user_content_filter_store_save):
(webkit_user_content_filter_store_save_finish):
(webkit_user_content_filter_store_save_from_file):
(webkit_user_content_filter_store_save_from_file_finish):
(webkit_user_content_filter_store_remove):
(webkit_user_content_filter_store_remove_finish):
(webkit_user_content_filter_store_load):
(webkit_user_content_filter_store_lookup_finish):
(webkit_user_content_filter_store_fetch_identifiers):
(webkit_user_content_filter_store_fetch_identifiers_finish):
* UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API
functions to add and remove filters from an user content manager.
(webkit_user_content_manager_add_filter):
(webkit_user_content_manager_remove_filter):
(webkit_user_content_manager_remove_all_filters):
* UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for
webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().
* UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter
and WebKitUserContentFilterStore.
* UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR
plus the associated webkit_user_content_filter_error_quark() function and
WebKitUserContentFilterErrror enum.
* UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter
and its associated functions.
* UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
* UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to
add and remove filters from the user content manager.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to
be included in the documentation.
* UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
* UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
* UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
* UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
* UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be
included in the documentation.
* UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h
2019-02-19 Antti Koivisto <antti@apple.com>
Pass rootContentsLayer to Mac remote layer tree
https://bugs.webkit.org/show_bug.cgi?id=194828
Reviewed by Simon Fraser.
Make this code path work again.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2019-02-19 Alex Christensen <achristensen@webkit.org>
Reduce use of LegacySync IPC messages
https://bugs.webkit.org/show_bug.cgi?id=194783
Reviewed by Geoffrey Garen.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleSynchronousMessage):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPlugins):
(WebKit::WebProcessProxy::shouldTerminate):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Plugins/PluginProcessConnection.cpp:
(WebKit::PluginProcessConnection::setException):
* WebProcess/Plugins/PluginProcessConnection.h:
* WebProcess/Plugins/PluginProcessConnection.messages.in:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::didCreatePlugin):
(WebKit::PluginProxy::didFailToCreatePlugin):
(WebKit::PluginProxy::proxiesForURL):
(WebKit::PluginProxy::cookiesForURL):
(WebKit::PluginProxy::getAuthenticationInfo):
(WebKit::PluginProxy::getPluginElementNPObject):
(WebKit::PluginProxy::evaluate):
(WebKit::PluginProxy::createPluginContainer):
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in:
2019-02-19 Alex Christensen <achristensen@webkit.org>
Remove assertion introduced in r229683
https://bugs.webkit.org/show_bug.cgi?id=194825
<rdar://problem/47628258>
Reviewed by Geoffrey Garen.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
If we reach this code and the form's original Document's Frame has been destroyed,
we have already been told to submit the form so do so, just like we do if the WebPage
has been destroyed. This is a rare edge case having to do with the timing of Frame
destruction and decidePolicyForNavigationAction response, which unfortunately does not
reproduce with a test case unless the timing of IPC is just right.
2019-02-19 Antoine Quint <graouts@apple.com>
[iOS] "touch-action: none" should not prevent text selection or tapping on a link
https://bugs.webkit.org/show_bug.cgi?id=194812
<rdar://problem/47901131>
Reviewed by Dean Jackson.
We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should
"pan-x", "pan-y" or "pinch-zoom" be used.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleTouchActionsForTouchEvent:]):
2019-02-18 Alex Christensen <achristensen@webkit.org>
Revert functional part of r241451
https://bugs.webkit.org/show_bug.cgi?id=194510
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
It caused crashes and assertions on Linux and Cocoa without safe browsing, which
means it's fundamentally flawed in some way. The testing piping was fine.
2019-02-18 Chris Dumez <cdumez@apple.com>
REGRESSION (PSON): Can't access optumbank.com from myuhc.com
https://bugs.webkit.org/show_bug.cgi?id=194797
<rdar://problem/48055151>
Reviewed by Geoffrey Garen.
The issue was caused by us mistakenly process-swapping for a same-site server side redirect.
The reason we were getting it wrong is because the logic in
WebProcessPool::processForNavigationInternal() was expecting page.process() to be the source
process and page.pageLoadState().url() to be the source URL. Those assumptions are incorrect
when a server-side redirect occurs in a provisional process. In such case, the source process
is the ProvisionalPageProxy's process and the source URL is the provisional URL, not the
committed one.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didPerformServerRedirect):
(WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/ProvisionalPageProxy.h:
Make sure the provisional page forwards IPC related to server-side redirects to the page so
that the client gets informed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didPerformServerRedirectShared):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
2019-02-16 Darin Adler <darin@apple.com>
Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
https://bugs.webkit.org/show_bug.cgi?id=194752
Reviewed by Daniel Bates.
* Platform/IPC/win/ConnectionWin.cpp:
(IPC::Connection::createServerAndClientIdentifiers): Use makeString instead of
String::format.
* Shared/win/WebEventFactory.cpp:
(WebKit::keyIdentifierFromEvent): Ditto.
* UIProcess/API/APINavigation.cpp:
(API::Navigation::loggingString const): Use hex instead of String::format.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::loggingString const): Ditto.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Added a "0x".
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): Use makeString and hex
instead of String::format and "%x".
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
Ditto.
2019-02-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
https://bugs.webkit.org/show_bug.cgi?id=194670
<rdar://problem/39066529>
Reviewed by Tim Horton.
Remove all IPC plumbing for getTypesByFidelityForItemAtIndex, now that the types in fidelity order have been
rolled into PasteboardItemInfo.
Additionally, remove support for subresource URL replacement. This feature was originally added with the
intention that private clients (i.e. Mail) would intercept pasted or dropped images and replace their URLs.
However, since <rdar://problem/43216836>, our strategy for this scenario has changed, such that WebKit now
handles the drop/paste, and later delivers the image data to the client via NSFileWrappers in the UI process.
At this time, there are no adopters of this SPI, and no adopters of the V2 injected bundle editing client. As
such, we can simply revert all of this to its state prior to the introduction of the replacement URL SPI, with
the exception to changes in WKBundlePageEditorClient.h, wherein there is a nonzero (but likely tiny) chance of
completely breaking binary compatability with any third parties on macOS which may have tried to adopt
subresource URL replacement.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): Deleted.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
Return YES for -paste: in the case where:
1. The pasteboard contains items that are explicitly marked as attachments.
2. The selection is richly contenteditable.
3. Attachment elements are enabled.
Among other things, this allows the callout bar on iOS to show the "Paste" action.
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
(API::InjectedBundle::EditorClient::performTwoStepDrop):
(API::InjectedBundle::EditorClient::replacementURLForResource): Deleted.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::replacementURLForResource): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::replacementURLForResource): Deleted.
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2019-02-18 Jeremy Jones <jeremyj@apple.com>
exitFullscreen should not instantiate a new model/interface mapping.
https://bugs.webkit.org/show_bug.cgi?id=191988
rdar://problem/42327939
Reviewed by Jer Noble.
This change is a speculative fix for a crash that cannot be reproduced.
Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed.
This change should allow us to prevent the crash in release, and assert in debug.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
2019-02-18 John Wilander <wilander@apple.com>
Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=194777
<rdar://problem/47731945>
Reviewed by Geoffrey Garen and Chris Dumez.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
Now returns early if the incoming session ID is invalid.
Added an ASSERT to help us find other call sites passing invalid session IDs.
2019-02-18 Per Arne Vollan <pvollan@apple.com>
It should be possible to get the mouse event modifiers for a page overlay client.
https://bugs.webkit.org/show_bug.cgi?id=189621
<rdar://problem/44437279>
Reviewed by Daniel Bates.
When access to the WindowServer is blocked, [NSEvent modifierFlags] always returns 0.
This can be fixed by swizzling the class method, and getting the cached modifiers from
PlatformKeyboardEvent.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::currentModifierFlags):
(WebKit::WebProcess::platformInitializeProcess):
2019-02-18 Claudio Saavedra <csaavedra@igalia.com>
WebPageProxy::didFinishDocumentLoadForFrame() crashing in WPE and GTK+ ports
https://bugs.webkit.org/show_bug.cgi?id=194774
Reviewed by Alex Christensen.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
Null check navigation before using it.
This is a regression from r241451.
2019-02-18 Daniel Bates <dabates@apple.com>
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/47100332>
Reviewed by Wenson Hsieh.
Use the same code path for key events to editable elements and non-editable elements.
Currently we have different code paths for hardware key events depending on whether the active element
is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
presses this differentiation was a necessary workaround for UIKit's event processing precedence of
interpreting key events for system text editing commands and app commands before dispatching unhandled
key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
key events use the same code path.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
(-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
element (by returning NO in -_requiresKeyboardWhenFirstResponder).
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
automatic keyboard UI.
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): If we are not in an editable
element then we cannot perform the replacement. This logic was necessary now that we always require a
keyboard.
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): If we are not in an editable
element then return an autocorrection object that indicates that we could not compute this data. This
logic was necessary now that we always require a keyboard.
(-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
now that we require a keyboard when first responder even if the focused element is non-editable.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
its chance to interpret the UIEvent, we intercepted, for app key commands.
(-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
(e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
when the popover is presented.
2019-02-18 Jiewen Tan <jiewen_tan@apple.com>
Tell Networking Process to not optimize load
https://bugs.webkit.org/show_bug.cgi?id=194753
<rdar://problem/48143603>
Reviewed by Brent Fulgham.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2019-02-18 Dean Jackson <dino@apple.com>
iOS Safari will not load USDZ in QLPreview when opening as BLOB
https://bugs.webkit.org/show_bug.cgi?id=194766
<rdar://problem/42769186>
Reviewed by Wenson Hsieh.
A download from a Blob URL can happen effectively instantly, which means
that the loadHandler on the registerItemForTypeIdentifier method might not have
been called yet, and we haven't been told what the completionHandler is.
In this case, keep a record of the URL we finished with, and call the completionHandler
right away.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add a new private member variable: _downloadedURL.
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): Call the completionHandler
right away if we've finished.
(-[_WKPreviewControllerDataSource finish:]): Remember that we've finished by recording the URL.
2019-02-18 Alex Christensen <achristensen@webkit.org>
Disable safe browsing in WKWebView and remove its WKPreferences API
https://bugs.webkit.org/show_bug.cgi?id=194723
<rdar://problem/48122993>
Reviewed by Geoffrey Garen.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
(-[WKPreferences isSafeBrowsingEnabled]): Deleted.
2019-02-18 Chris Fleizach <cfleizach@apple.com>
AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
https://bugs.webkit.org/show_bug.cgi?id=194742
Reviewed by Chris Dumez.
Re-initialize the accessibility web process tokens when swapping processes.
Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::didFinishLoadForMainFrame):
(WebKit::PageClientImpl::didFailLoadForMainFrame):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformReinitialize):
(WebKit::WebPage::platformDetach): Deleted.
(WebKit::WebPage::platformEditorState const): Deleted.
(WebKit::WebPage::updateAccessibilityTree): Deleted.
(WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted.
(WebKit::WebPage::platformCanHandleRequest): Deleted.
(WebKit::WebPage::platformUserAgent const): Deleted.
(WebKit::WebPage::getCenterForZoomGesture): Deleted.
(WebKit::WebPage::setInputMethodState): Deleted.
(WebKit::WebPage::collapseSelectionInFrame): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformReinitialize):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformReinitialize):
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::platformReinitialize):
* WebProcess/WebPage/wpe/WebPageWPE.cpp:
(WebKit::WebPage::platformReinitialize):
2019-02-18 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash while filling selection data during drag and drop
https://bugs.webkit.org/show_bug.cgi?id=194698
Reviewed by Michael Catanzaro.
I can't reproduce this, but it seems that m_draggingSelectionData is nullptr in fillDragData(). That can happen
when startDrag cancels a previous DND operation, because the new m_draggingSelectionData is set before the
current DND operation is cancelled, which sets it to nullptr.
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::startDrag): Finish the previous operation before setting m_draggingSelectionData.
2019-02-17 Youenn Fablet <youenn@apple.com>
https://device.login.microsoftonline.com is hanging on STP75
https://bugs.webkit.org/show_bug.cgi?id=194734
<rdar://problem/47573830>
Reviewed by Jiewen Tan.
Make sure to only go the XPC route if SecKeyProxyStore has credentials.
Tested manually by going to the above website with and without the patch.
Load hangs without the patch and completes with the patch.
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
* UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
* UIProcess/Authentication/cocoa/SecKeyProxyStore.mm:
(WebKit::SecKeyProxyStore::initialize):
2019-02-17 David Kilzer <ddkilzer@apple.com>
Unreviewed, rolling out r241620.
"Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
(Requested by ddkilzer on #webkit.)
Reverted changeset:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241620
2019-02-15 Youenn Fablet <youenn@apple.com>
NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
https://bugs.webkit.org/show_bug.cgi?id=194732
Reviewed by Geoffrey Garen.
NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
This might happen for instance in DownloadManager or when checking for TLS certificates.
In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
To ensure that NetworkDataTask does not try to use its client, add a null check.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):
2019-02-15 Chris Dumez <cdumez@apple.com>
[PSON] Allow tweaking WebProcess cache parameters via user defaults
https://bugs.webkit.org/show_bug.cgi?id=194731
<rdar://problem/48125377>
Reviewed by Geoffrey Garen.
Allow tweaking WebProcess cache parameters via user defaults like so:
$ defaults write com.apple.Safari WebProcessCacheCachedProcessLifetimeInSeconds 120
-> Cached processes will be evicted after 2 minutes (instead of 30)
$ defaults write com.apple.Safari WebProcessCacheClearingDelayAfterApplicationResignsActiveInSeconds 60
-> Web process cache will be cleared if Safari is no longer active for 1 minutes (instead of 5).
* SourcesCocoa.txt:
* UIProcess/Cocoa/WebProcessCacheCocoa.mm: Copied from Source/WebKit/UIProcess/WebProcessCache.h.
(WebKit::WebProcessCache::platformInitialize):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::WebProcessCache):
(WebKit::WebProcessCache::platformInitialize):
* UIProcess/WebProcessCache.h:
* WebKit.xcodeproj/project.pbxproj:
2019-02-15 Chris Dumez <cdumez@apple.com>
[PSON] Disable WebContent process cache on devices with less than 3GB of RAM
https://bugs.webkit.org/show_bug.cgi?id=194726
<rdar://problem/48126255>
Reviewed by Geoffrey Garen.
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::updateCapacity):
2019-02-15 Andy Estes <aestes@apple.com>
[iOS] Stop setting a background color on the PDF host view
https://bugs.webkit.org/show_bug.cgi?id=194722
<rdar://48124152>
Reviewed by Wenson Hsieh.
PDFKit already sets a background color on this view, so there’s no need (and some harm) in
us doing it too.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2019-02-15 Alex Christensen <achristensen@webkit.org>
Update IPC code generator unit test expectations after r241611
https://bugs.webkit.org/show_bug.cgi?id=194678
* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/Messages-expected.h:
* Scripts/webkit/MessagesSuperclass-expected.h:
2019-02-15 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::findWebKitProcess):
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
(webKitSettingsSetProperty):
* UIProcess/API/glib/WebKitWebContext.cpp:
(injectedBundleDirectory):
(webkitWebContextConstructed):
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewMaximizeWindow):
(webkitWebViewRestoreWindow):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/wpe/WebProcessMainWPE.cpp:
Utilize WTF::Environment where possible.
2019-02-15 Alex Christensen <achristensen@webkit.org>
Add SPI version of WKPreferences.safeBrowsingEnabled
https://bugs.webkit.org/show_bug.cgi?id=194718
<rdar://problem/48122993>
Rubber-stamped by Brady Eidson.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _isSafeBrowsingEnabled]):
(-[WKPreferences _setSafeBrowsingEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-02-15 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] WKWebView callout bar is missing Change Writing Direction item
https://bugs.webkit.org/show_bug.cgi?id=190015
<rdar://problem/44810366>
Reviewed by Tim Horton.
Support -makeTextWritingDirectionLeftToRight: and -makeTextWritingDirectionRightToLeft: in WKWebView on iOS.
To match behavior in native UITextViews on iOS, we implement these methods by changing the *base* writing
direction, rather than the text writing direction (this is in contrast to macOS, which has different
NSResponder methods for changing the base writing direction as opposed to the text writing direction).
Additionally fixes the implementation of -makeTextWritingDirectionNatural:, which currently attempts to change
the text writing direction instead of the base writing direction.
* Platform/spi/ios/UIKitSPI.h:
Add a forward declaration for keyboards SPI to determine whether the user has an active RTL keyboard.
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
(WebKit::operator<<):
* Shared/EditorState.h:
Plumb the base writing direction to the UI process through EditorState.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
(-[WKContentView makeTextWritingDirectionLeftToRightForWebView:]):
(-[WKContentView makeTextWritingDirectionRightToLeftForWebView:]):
Implement the new SPI (see above for more details).
(-[WKContentView canPerformActionForWebView:withSender:]):
Implement -canPerformAction: for LTR and RTL actions. To match existing UIWebView behavior, we only enable
these actions if either the base writing direction is RTL, or the user has an active RTL keyboard. This means,
for instance, that in the case where a user with only an English keyboard is editing LTR content, we would never
show an option to convert to RTL.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState const):
2019-02-15 Alex Christensen <achristensen@webkit.org>
Make WebPaymentCoordinatorProxy more robust and modern
https://bugs.webkit.org/show_bug.cgi?id=194678
Reviewed by Andy Estes.
Use WeakPtr instead of storing raw pointers in lambdas or the global activePaymentCoordinatorProxy to avoid UAF problems.
Call CompletionHandlers in all code paths to avoid hangs.
Use Delayed instead of LegacySync for synchronous messaging to progress towards removing LegacySync messages.
* Scripts/webkit/messages.py:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::activePaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
(WebKit::WebPaymentCoordinatorProxy::canMakePayments):
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2019-02-15 Youenn Fablet <youenn@apple.com>
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651
Unreviewed, build fix for WPE.
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2019-02-15 Chris Dumez <cdumez@apple.com>
Regression(PSON) Navigating quickly back and forth can lead to getting 'about:blank' in the backforward list
https://bugs.webkit.org/show_bug.cgi?id=194717
<rdar://problem/47884404>
Reviewed by Brady Eidson.
When the client does a history navigation, the UIProcess sends a WebPage::GoToBackForwardItem IPC to the
WebProcess and the WebProcess sends a WebPageProxy::BackForwardGoToItem IPC back to the UIProcess to
update the current item in the BackForwardList. This means that there is a slight delay between the
point a client requests a history navigation and the point where the BackForwardList's current item gets
update. This delay is pre-existing behavior and not new to PSON.
However, with PSON enabled, if we decide to process-swap for the history navigation, we'll tell the
previous (committed) process to ignore the load and we ask a new (provisional) process to do the history
navigation. When the previous process receives the request to ignore the history navigation, it restores
the History's current item to the one previous the navigation, which sends a WebPageProxy::GoToBackForwardItem
IPC to the UIProcess to update the BackForwardList as well. In parallel, the new process starts the
history navigation and also sends a WebPageProxy::GoToBackForwardItem to update the BackForwardList's
current item as well. We end up with a race between the 2 GoToBackForwardItem IPC messages coming from
the old and new process. If the old process's message loses the race, we end up with the wrong current
history item getting set in the UIProcess. Later, when we commit the provisional load and try to suspend
the previous page, we would save the SuspendedPage on the *wrong* BackForwardList item. If one tries to
load this BackForwardList item later, we'll use its SuspendedPage and try to unsuspend it. However,
because the PageCache entry is saved on another HistoryItem than the one getting loaded in the WebProcess
side, we attempt to do a regular load instead of a PageCache restore. We end up failing the load because
pages cannot trigger new loads while in page cache. Because the load fails, we end up loading the
initial empty document and this is how we end up with 'about:blank' in the back forward list.
To address the issue, update WebPageProxy::backForwardGoToItem() to ignore messages from the old/committed
WebProcess when there is a pending provisional load. If the committed processes starts a legit new
load, it would clear any existing pending provisional load before attempting the call backForwardGoToItem().
As a result, ignoring such messages from the old processes when there is a pending provisional load is
safe.
In the future, we should probably move more of the history / backForwardList management to the UIProcess
to avoid this sort of issues. This would be a much larger refactoring though so I am going with this
simpler fix that is easily cherry-pickable for now.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::backForwardGoToItem):
2019-02-15 Alex Christensen <achristensen@webkit.org>
Update IPC code generator unit test expectations after r241595
https://bugs.webkit.org/show_bug.cgi?id=194679
* Scripts/webkit/LegacyMessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncWebPageMessage):
* Scripts/webkit/MessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncMessage):
2019-02-15 Youenn Fablet <youenn@apple.com>
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651
Reviewed by Alex Christensen.
The goal of this refactoring is to, at some point use the regular network process load path for service worker loads.
This should simplify things and allow less IPC exchanges, for instance in the case of fetch not handled by service worker.
Introduce two IPC messages for supporting redirect responses and allow the didReceiveResponse/continueDidReceiveResponse
handshake for navigation loads.
This makes ServiceWorker having to buffer load information for this particular case.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveFetchRedirectResponse):
(WebKit::NetworkProcess::didReceiveFetchResponse):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::start):
(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinish):
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::didNotHandle):
(WebKit::ServiceWorkerClientFetch::cancel):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
(WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
(WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2019-02-15 Brian Burg <bburg@apple.com>
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>
Reviewed by Joseph Pecoraro.
* Configurations/WebKit.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::webInspectorUILocalizedStringsURL):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
2019-02-15 Alex Christensen <achristensen@webkit.org>
IPC code should support messages with both Delayed and WantsConnection attributes
https://bugs.webkit.org/show_bug.cgi?id=194679
Reviewed by Geoffrey Garen.
* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
(IPC::callMemberFunction):
(IPC::handleMessageDelayedWantsConnection):
* Scripts/webkit/messages.py:
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::getValues):
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebStorage/StorageManager.messages.in:
2019-02-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241559 and r241566.
https://bugs.webkit.org/show_bug.cgi?id=194710
Causes layout test crashes under GuardMalloc (Requested by
ryanhaddad on #webkit).
Reverted changesets:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241559
"Unreviewed build fix for WinCairo Debug after r241559."
https://trac.webkit.org/changeset/241566
2019-02-15 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Defer sandboxing APIs to 2.26
https://bugs.webkit.org/show_bug.cgi?id=194274
Reviewed by Carlos Garcia Campos.
The web process sandbox has not been widely-tested yet, so we should defer the new APIs to
2.26.
* UIProcess/API/glib/WebKitWebContext.cpp:
2019-02-10 Darin Adler <darin@apple.com>
Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
https://bugs.webkit.org/show_bug.cgi?id=194487
Reviewed by Daniel Bates.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Use makeString instead of String::format.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages): Ditto.
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::performURLImport): Ditto.
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::logConfirmCompositionForTesting): Ditto.
(WebKit::InputMethodFilter::logSetPreeditForTesting): Ditto.
2019-02-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241564.
Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
Reverted changeset:
"[Mac] WebInspectorUI.framework does not need to be soft-
linked anymore"
https://bugs.webkit.org/show_bug.cgi?id=194411
https://trac.webkit.org/changeset/241564
2019-02-15 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build after r241556
I guess this is due to unified builds after a new file being added in r241556.
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
* UIProcess/API/C/WKPage.cpp:
2019-02-14 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r240446): Storage Access API does not handle domains consistently
https://bugs.webkit.org/show_bug.cgi?id=194664
Reviewed by Alex Christensen.
During my refactoring of the ResourceLoadStatistics code, I introduced two bugs:
(1) I neglected to be consistent in my use of 'primaryDomain', causing some Storage
Access API code paths to store approves under one domain (e.g., 'www.example.com'),
while checking status under the eTLD+1 (e.g., 'example.com'). The exact string matching
requirement caused these to get missed.
(2) I used a move operator before a final set of copies of domain names, leading to
some empty strings being passed to Storage Access API calls.
Both issues are corrected in this patch.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): Always make the
domain comply with our 'primaryDomain' logic.
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Ditto.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasStorageAccess): Always make the
domain comply with our 'primaryDomain' logic.
(WebKit::WebsiteDataStore::requestStorageAccess): Ditto. Also make copy of domain
names before moving them to the completion handler.
(WebKit::WebsiteDataStore::grantStorageAccess): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess): Always make the domain comply with our
'primaryDomain' logic.
(WebKit::WebPage::requestStorageAccess): Ditto.
2019-02-14 Tim Horton <timothy_horton@apple.com>
Fix the build.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):
2019-02-14 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty() in WebKit::CacheStorage::Caches::clearMemoryRepresentation()
https://bugs.webkit.org/show_bug.cgi?id=188393
<rdar://problem/43025665>
Reviewed by Alex Christensen.
In case Caches::dispose is called, clearMemoryRepresentation might be called if there is no active cache.
We also ensure to not clear the memory representation if there is any remaining removed cache.
Update the clearMemoryRepresentation assertion to take that into account.
In case a Caches is cleared twice, the clearMemoryRepresentation assertion will assert while it should not.
In that case m_storage is null the second time. Update the assertion accordingly.
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::hasActiveCache const):
(WebKit::CacheStorage::Caches::dispose):
(WebKit::CacheStorage::Caches::clearMemoryRepresentation):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
2019-02-14 Brian Burg <bburg@apple.com>
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>
Reviewed by Joseph Pecoraro.
* Configurations/WebKit.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::webInspectorUILocalizedStringsURL):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
2019-02-14 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] WebKitGTK+ -> WebKitGTK
https://bugs.webkit.org/show_bug.cgi?id=194658
Reviewed by Alex Christensen.
This renames WebKitGTK+ to WebKitGTK in a few user-visible places: the API documentation,
the pkg-config, and an error message.
In a couple places where it's exposed in WPE documentation, WPE is now mentioned, or the
reference to "WebKitGTK+" is changed to just "WebKit."
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/glib/WebKitWebView.cpp:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h:
* gtk/webkit2gtk-web-extension.pc.in:
* gtk/webkit2gtk.pc.in:
2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
* Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::findWebKitProcess):
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
(webKitSettingsSetProperty):
* UIProcess/API/glib/WebKitWebContext.cpp:
(injectedBundleDirectory):
(webkitWebContextConstructed):
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewMaximizeWindow):
(webkitWebViewRestoreWindow):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/wpe/WebProcessMainWPE.cpp:
Utilize WTF::Environment where possible.
2019-02-14 Jiewen Tan <jiewen_tan@apple.com>
Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
https://bugs.webkit.org/show_bug.cgi?id=194640
<rdar://problem/48064140>
Reviewed by Brent Fulgham.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2019-02-14 Chris Dumez <cdumez@apple.com>
[PSON] Introduce a WebContent Process cache
https://bugs.webkit.org/show_bug.cgi?id=194594
<rdar://problem/46793397>
Reviewed by Geoff Garen.
Introduce a WebContent Process cache to reduce the number of process launches when
process swap on navigation is enabled, and to reduce the power cost of the feature.
If a WebProcess loaded pages from a single registrable domain then it is eligible
for the cache. When process-swapping on navigation to a new registrable domain, we
now attempt to retrieve a process from the cache for the domain in question instead
of always launching a new one.
The WebProcess cache currently has the following attributes:
- It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
- WebProcesses automatically get evicted from the cache after 30 minutes.
- If the application is no longer the active app, then the cache will get cleared
after 5 minutes.
- WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.
The WebProcess cache is currently disabled by default and can by enabled by the
client via SPI.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::lastProcessIdentifier const):
(WebKit::WebBackForwardListItem::setLastProcessIdentifier):
Add new lastProcessIdentifier data member that reflects which process this item
was last loaded in. It is normally identical to the identifier of the process
that created the item but it gets overriden in case of cross-site client-side
redirect, since a new process takes over the item in this case.
* Sources.txt:
Add new source file.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationUsesWebProcessCache):
(WKContextConfigurationSetUsesWebProcessCache):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setUsesWebProcessCache:]):
(-[_WKProcessPoolConfiguration usesWebProcessCache]):
Add new SPI to enable the WebProcess cache.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
Add new SPI for testing which returns the number of WebProcesses ignoring
both prewarmed and cached ones.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
Add application active state observers as the WebProcess cache gets cleared
when the application resigns active state for more than 5 minutes.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadRequest):
When doing a load in a new process with the BackForwardList locked (i.e. client-side
redirect), make sure we update the last process identifier for the BackForwardListItem.
This is important because the logic in WebProcessPool::processForNavigation() relies on
this identifier to select which process to do the history navigation into, and we want
to do the load in the post-redirect process, not the pre-redirect one.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
Tell the WebProcess whenever a main frame provisional load is started, providing the URL.
* UIProcess/WebProcessCache.cpp: Added.
(WebKit::WebProcessCache::WebProcessCache):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::updateMaximumSize):
(WebKit::WebProcessCache::clear):
(WebKit::WebProcessCache::setApplicationIsActive):
(WebKit::WebProcessCache::evictProcess):
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
(WebKit::WebProcessCache::CachedProcess::~CachedProcess):
(WebKit::WebProcessCache::CachedProcess::takeProcess):
(WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
* UIProcess/WebProcessCache.h: Added.
(WebKit::WebProcessCache::maximumSize):
(WebKit::WebProcessCache::size const):
(WebKit::WebProcessCache::CachedProcess::process):
Add process cache implementation.
* UIProcess/WebProcessPool.cpp:
(WebKit::m_webProcessCache):
WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.
(WebKit::WebProcessPool::~WebProcessPool):
Clear the WebProcess cache in the destructor.
(WebKit::WebProcessPool::setApplicationIsActive):
Notify the WebProcessCache whenever the application's active state changes.
(WebKit::WebProcessPool::createWebPage):
If the state of PSON changes via the experimental features menu, dynamically
update the WebProcessCache's size. This is needed because the cache is disabled
when PSON is disabled.
(WebKit::WebProcessPool::handleMemoryPressureWarning):
Clear the WebProcess cache on memory pressure.
(WebKit::WebProcessPool::processForNavigationInternal):
Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
navigation.
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
This logic was split out of processForNavigationInternal() to reduce the size
of the method.
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::setIsInProcessCache):
Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent
process so that it can update its name in Activity Monitor.
We also need to stop holding a strong reference to the WebProcessPool whenever the process
is in the cache, similarly to what we do for pre-warmed processes, given that such processes
should not keep the process pool alive.
(WebKit::WebProcessProxy::addExistingWebPage):
Assert that we never try to add a page to a cached process, it should be taken out of the
cache before use.
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
(WebKit::WebProcessProxy::updateBackForwardItem):
In case of client-side redirects, the previous process would sometimes send an IPC causing
the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
already redirected. This previously would be unlikely to occur because we do not suspend
client-redirect pages and their process would normally exit before getting a chance to send
the IPC. However, with the process cache, the bug became obvious as the process would stay
alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
item if the item's page is (still) associated with the process. In the future, we may want
to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
it for a load later.
(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
for service worker and inspector processes.
(WebKit::WebProcessProxy::maybeShutDown):
If the process is cacheable, add it to the cache instead of shutting it down right away.
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
Make sure we do not attempt to terminate a processes that is in the cache.
(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
Whenever a main frame provisional load starts, make sure we update the process's associated
registrable domain. nullopt indicates that there is no associated domain yet. Null string
indicates that the process is associated with several registrable domain and is therefore
not eligible for caching.
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::registrableDomain const):
(WebKit::WebProcessProxy::isInProcessCache const):
(WebKit::WebProcessProxy::provisionalPageCount const):
Add convenience getters.
* WebKit.xcodeproj/project.pbxproj:
Add new files to project.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setIsInProcessCache):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateProcessName):
Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess
cache.
2019-02-14 Per Arne Vollan <pvollan@apple.com>
[iOS] Open sandbox for certain calls.
https://bugs.webkit.org/show_bug.cgi?id=194626
Reviewed by Brent Fulgham.
Reporting shows that certain calls needs to be allowed in the sandbox.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-14 Chris Fleizach <cfleizach@apple.com>
AX: ARIA Reflection was disabled in error
https://bugs.webkit.org/show_bug.cgi?id=194647
<rdar://problem/48068336>
Reviewed by Ryosuke Niwa.
* Shared/WebPreferences.yaml:
2019-02-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241486.
https://bugs.webkit.org/show_bug.cgi?id=194655
causing API failures in builds (Requested by ShawnRoberts on
#webkit).
Reverted changeset:
"[Cocoa] Media elements will restart network buffering just
before suspending"
https://bugs.webkit.org/show_bug.cgi?id=193691
https://trac.webkit.org/changeset/241486
2019-02-14 Youenn Fablet <youenn@apple.com>
Do not add a caches to its engine if the salt cannot be initialized
https://bugs.webkit.org/show_bug.cgi?id=194604
Reviewed by Antti Koivisto.
This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
We should return early if initialize fails.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::readCachesFromDisk):
2019-02-13 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Use a scrolled window for script alerts text
https://bugs.webkit.org/show_bug.cgi?id=184875
Reviewed by Michael Catanzaro.
To ensure long text doesn't make the dialog bigger.
* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
(webkitScriptDialogImplConstructed): Use PANGO_ELLIPSIZE_END for the title and add a scrolled window for the body.
(webkitScriptDialogImplSetText): Helper function to set the dialog body, ensuring the scrolled window fills the
dialog available size.
(webkitScriptDialogImplNew): It now receives the maximum size and uses webkitScriptDialogImplSetText().
* UIProcess/API/gtk/WebKitScriptDialogImpl.h:
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewScriptDialog): Pass the 80% of the web view size as the maximum size of script dialogs.
2019-02-13 Ryosuke Niwa <rniwa@webkit.org>
Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
https://bugs.webkit.org/show_bug.cgi?id=194641
Reviewed by Geoffrey Garen.
Fixed the bug by adding a null check to WebFrame::parentFrame.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::parentFrame const):
2019-02-13 Timothy Hatcher <timothy@apple.com>
Allow some deprecations in WKDrawingView.
https://bugs.webkit.org/show_bug.cgi?id=194636
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView PNGRepresentation]):
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):
(-[WKDrawingView _canvasViewWillBeginDrawing:]):
(-[WKDrawingView didChangeInk:]):
2019-02-13 Jer Noble <jer.noble@apple.com>
[Cocoa] Media elements will restart network buffering just before suspending
https://bugs.webkit.org/show_bug.cgi?id=193691
Reviewed by Eric Carlson.
When the WebProcess receives a notification that the process is about to become
suspended, it tells the MemoryPressureHandler to release all critical memory. This
has the side effect of causing AVFoundation-backed media elements to dump their
in-memory caches and start downloading media data again. Instead, media elements
should all stop buffering media data during suspension. Add new testing SPI to
simulate suspension and resume messages.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSuspendImminentlyForTesting]):
(-[WKWebView _processDidResumeForTesting]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WKInkPickerView.mm:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendAllMediaBuffering):
(WebKit::WebPage::resumeAllMediaBuffering):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::suspendAllMediaBuffering):
(WebKit::WebProcess::resumeAllMediaBuffering):
* WebProcess/WebProcess.h:
2019-02-13 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix sandbox violation during media playback
https://bugs.webkit.org/show_bug.cgi?id=194616
<rdar://problem/48049264>
Reviewed by Brent Fulgham.
Mach lookup to "com.apple.coremedia.figcontentkeysession.xpc" should be allowed.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-13 Tim Horton <timothy_horton@apple.com>
Encrypted PDFs inside <embed> or <object> crash the Web Content process
https://bugs.webkit.org/show_bug.cgi?id=194605
<rdar://problem/19894818>
Reviewed by Andy Estes.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::createPasswordEntryForm):
Don't try to create a password form field if we can't make form fields.
This means you will be left with a useless embedded PDF, but at least
the Web Content process won't crash.
We'll need to find an alternative implementation of PDF embedded form
fields that is compatible with <embed> and <object> if we want to support
this. Currently we piggy-back off the fact that we can just insert
<input>s into the PluginDocument's DOM, but we can't do that if there
is no PluginDocument, just a main document, like in the <embed> case.
2019-02-12 Jiewen Tan <jiewen_tan@apple.com>
Further restricting webarchive loads
https://bugs.webkit.org/show_bug.cgi?id=194567
<rdar://problem/47610130>
Reviewed by Youenn Fablet.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
Set a flag to indicate a load is started from clients.
2019-02-13 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Merge WebProcessPoolWPE.cpp and WebProcessPoolGtk.cpp
https://bugs.webkit.org/show_bug.cgi?id=194551
Reviewed by Carlos Garcia Campos.
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/glib/WebProcessPoolGLib.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp.
(WebKit::initializeRemoteInspectorServer):
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInvalidateContext):
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
* UIProcess/wpe/WebProcessPoolWPE.cpp: Removed.
2019-02-13 Michael Catanzaro <mcatanzaro@igalia.com>
Fix -Wformat warning from r241401
https://bugs.webkit.org/show_bug.cgi?id=194584
<rdar://problem/47761293>
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActivityState):
2019-02-13 Youenn Fablet <youenn@apple.com>
Make WebRTCUnifiedPlanEnabled true by default
https://bugs.webkit.org/show_bug.cgi?id=194595
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2019-02-13 John Wilander <wilander@apple.com>
Store Ad Click Attribution requests in the network process
https://bugs.webkit.org/show_bug.cgi?id=194510
<rdar://problem/47650118>
Reviewed by Alex Christensen and Daniel Bates.
With this patch, WebPageProxy::didCommitLoadForFrame() now looks for
an AdClickAttribution object in its navigation state. If there is an
attribution, it sends it to the network process where the
WebKit::NetworkSession stores it in an object of a new class,
WebKit::NetworkAdClickAttribution.
This patch also covers test infrastructure to support two new
TestRunner functions:
- dumpAdClickAttribution()
- clearAdClickAttribution()
* NetworkProcess/Cookies/WebCookieManager.cpp:
Added missing header include.
* NetworkProcess/Downloads/DownloadManager.cpp:
Added missing header include.
* NetworkProcess/NetworkAdClickAttribution.cpp: Added.
(WebKit::NetworkAdClickAttribution::ensureDestinationMapForSource):
(WebKit::NetworkAdClickAttribution::store):
(WebKit::NetworkAdClickAttribution::clear):
(WebKit::NetworkAdClickAttribution::toString const):
* NetworkProcess/NetworkAdClickAttribution.h: Added.
Stores WebCore::AdClickAttribution objects in a map structure.
* NetworkProcess/NetworkLoad.cpp:
Added missing header includes.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::storeAdClickAttribution):
(WebKit::NetworkProcess::dumpAdClickAttribution):
(WebKit::NetworkProcess::clearAdClickAttribution):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::storeAdClickAttribution):
(WebKit::NetworkSession::dumpAdClickAttribution):
(WebKit::NetworkSession::clearAdClickAttribution):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
Added missing header include.
* Sources.txt:
Added NetworkProcess/NetworkAdClickAttribution.cpp.
* UIProcess/API/APINavigation.h:
(API::Navigation::adClickAttribution const):
* UIProcess/API/C/WKPage.cpp:
(WKPageDumpAdClickAttribution):
(WKPageClearAdClickAttribution):
Test infrastructure.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::dumpAdClickAttribution):
(WebKit::NetworkProcessProxy::clearAdClickAttribution):
Test infrastructure.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
This is where pending Ad Click Attributions are forwarded to the
network process.
(WebKit::WebPageProxy::dumpAdClickAttribution):
(WebKit::WebPageProxy::clearAdClickAttribution):
Test infrastructure.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::dumpAdClickAttribution):
(WebKit::WebProcessPool::clearAdClickAttribution):
Test infrastructure.
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
Added missing data copying from navigationAction to navigationActionData.
2019-02-13 Antti Koivisto <antti@apple.com>
Crash in WebKit::CacheStorage::Engine::cachesRootPath
https://bugs.webkit.org/show_bug.cgi?id=194588
<rdar://problem/46363997>
Reviewed by Youenn Fablet.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::cachesRootPath):
Salt may have not been initialized yet when the Engine is destroyed.
2019-02-13 Alex Christensen <achristensen@webkit.org>
Remove legacy sync messaging in some IPC code
https://bugs.webkit.org/show_bug.cgi?id=194561
Reviewed by Geoffrey Garen.
Changing some LegacySync messages to Delayed messages. We should probably rename Delayed to Sync.
There are too many ways to send messages. Let's work to get rid of the old one.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
(WebKit::NetworkProcess::processWillSuspendImminently):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::handleWheelEvent):
(WebKit::PluginControllerProxy::handleMouseEnterEvent):
(WebKit::PluginControllerProxy::handleMouseLeaveEvent):
(WebKit::PluginControllerProxy::handleKeyboardEvent):
(WebKit::PluginControllerProxy::handleEditingCommand):
(WebKit::PluginControllerProxy::isEditingCommandEnabled):
(WebKit::PluginControllerProxy::handlesPageScaleFactor):
(WebKit::PluginControllerProxy::requiresUnifiedScaleFactor):
(WebKit::PluginControllerProxy::paintEntirePlugin):
(WebKit::PluginControllerProxy::supportsSnapshotting):
(WebKit::PluginControllerProxy::snapshot):
(WebKit::PluginControllerProxy::getPluginScriptableNPObject):
(WebKit::PluginControllerProxy::getFormValue):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginControllerProxy.messages.in:
* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::deallocate):
(WebKit::NPObjectMessageReceiver::hasMethod):
(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::hasProperty):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::removeProperty):
(WebKit::NPObjectMessageReceiver::enumerate):
(WebKit::NPObjectMessageReceiver::construct):
* Shared/Plugins/NPObjectMessageReceiver.h:
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::secItemRequest):
* UIProcess/mac/SecItemShimProxy.h:
* UIProcess/mac/SecItemShimProxy.messages.in:
2019-02-13 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241433.
Broke internal builds.
Reverted changeset:
"Move
UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to
SPI"
https://bugs.webkit.org/show_bug.cgi?id=194531
https://trac.webkit.org/changeset/241433
2019-02-12 Antoine Quint <graouts@apple.com>
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>
Reviewed by Dean Jackson.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
to respondsToSelector until the SPI has shipped for OpenSource builds to work.
2019-02-13 Antoine Quint <graouts@apple.com>
Support simulated mouse events on iOS based on a PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=194501
<rdar://problem/46910790>
Reviewed by Dean Jackson.
Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether
simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure
that we correctly create touch tracking regions for mouse events.
* Shared/WebPreferences.yaml:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):
2019-02-13 Ryosuke Niwa <rniwa@webkit.org>
Crash in Page::setActivityState because m_page is null
https://bugs.webkit.org/show_bug.cgi?id=194584
Reviewed by Antti Koivisto.
Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActivityState):
2019-02-13 Ryosuke Niwa <rniwa@webkit.org>
Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=194582
Reviewed by Antti Koivisto.
The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
is invalid in that case, and we should be using requestIdentifier instead.
Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2019-02-13 Benjamin Poulain <benjamin@webkit.org>
Responsiveness timers are too expensive for frequent events
https://bugs.webkit.org/show_bug.cgi?id=194003
Reviewed by Geoffrey Garen.
With each event, we set a responsivness timer to check if the WebProcess
is responsive, and reset the timer when the WebProcess sends an answer.
For frequent events (e.g. wheel events, mouse force events, etc),
we are spamming the kernel with hundreds of timers per second.
That is a bit inefficient.
Another source of inefficiency comes from the timer implementation
itself. Stopping a RunLoop::Timer removes the timer from every mode
and invalidate the timer. It becomes costly since we do it a lot.
With this patch, I tweak ResponsivenessTimer and its use to minimize
how often we schedule system timers.
The first change is to not stop the timer when we get the stop()
calls if we expect more events to come in. Instead, we keep track
if we care about the timeout or not in the attribute "m_waitingForTimer".
When the next event starts, we can reschedule the timer without ever
having told the kernel about the stop.
If there are no next events, the timeout fires but m_waitingForTimer
is false. To avoid idle wake up, the lazy stop is only used when having
following events is common.
The second improvements comes from not even rescheduling the timer
when restarted. Instead of changing the timer, we let the original timer
fire and re-shedule a new one with the missing time.
For more context, also see patches r240759 and r240944.
* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::ResponsivenessTimer):
(WebKit::ResponsivenessTimer::invalidate):
(WebKit::ResponsivenessTimer::timerFired):
(WebKit::ResponsivenessTimer::start):
(WebKit::ResponsivenessTimer::startWithLazyStop):
(WebKit::ResponsivenessTimer::stop):
(WebKit::ResponsivenessTimer::processTerminated):
(WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
* UIProcess/ResponsivenessTimer.h:
(WebKit::ResponsivenessTimer::hasActiveTimer const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleGestureEvent):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::isResponsiveWithLazyStop):
* UIProcess/WebProcessProxy.h:
2019-02-12 Tim Horton <timothy_horton@apple.com>
Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=194569
<rdar://problem/46711049>
Reviewed by Wenson Hsieh.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::handleSwipeGesture):
It is conceivable that we could get here if the client closes the page
e.g. in the callback from willEndSwipeGesture. We already guarded against
this ... one line too late! Rearrange the lines so we don't call into
WebPageProxy at all if we don't have a drawing area (which is a strict subset
of the time that isValid would return true). This is a speculative fix,
since I can no longer reproduce the crash on demand.
2019-02-12 Youenn Fablet <youenn@apple.com>
WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
https://bugs.webkit.org/show_bug.cgi?id=194548
Reviewed by Alex Christensen.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/Storage/WebServiceWorkerProvider.h:
2019-02-12 Tim Horton <timothy_horton@apple.com>
Remove WKLegacyPDFView
https://bugs.webkit.org/show_bug.cgi?id=194559
Reviewed by Andy Estes.
* Platform/spi/ios/CorePDFSPI.h: Removed.
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):
* UIProcess/ios/WKLegacyPDFView.h: Removed.
* UIProcess/ios/WKLegacyPDFView.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:
2019-02-12 Chris Dumez <cdumez@apple.com>
Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()
https://bugs.webkit.org/show_bug.cgi?id=194568
<rdar://problem/47944490>
Reviewed by Ryosuke Niwa.
When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because
the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after
that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up
the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since
the frame has been removed from the WebProcessProxy at this point.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _provisionalWebProcessIdentifier]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::provisionalProcessDidTerminate):
2019-02-12 Per Arne Vollan <pvollan@apple.com>
[iOS] Youtube fails to play.
https://bugs.webkit.org/show_bug.cgi?id=194565
<rdar://problem/47974770>
Reviewed by Geoffrey Garen.
This is caused by sandbox violations and was introduced in r240500.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-02-12 Alex Christensen <achristensen@webkit.org>
Remove firing assertion after r241317
https://bugs.webkit.org/show_bug.cgi?id=194506
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::setDefersLoading):
The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading.
See comments in Chrome::runJavaScriptAlert et al.
This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit.
2019-02-12 Tim Horton <timothy_horton@apple.com>
Find on Page shouldn't zoom in on matches
https://bugs.webkit.org/show_bug.cgi?id=194557
<rdar://problem/42087017>
Reviewed by Wenson Hsieh.
* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.messages.in:
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::scrollToRect):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
Only scroll to reveal the find result, do not zoom in.
2019-02-12 Wenson Hsieh <wenson_hsieh@apple.com>
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>
Reviewed by Tim Horton.
Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding
animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during
user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically
cancel the incoming DOM paste access request because the callout bar animation finished.
This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _willHideMenu:]):
(-[WKContentView _didHideMenu:]):
2019-02-12 Chris Fleizach <cfleizach@apple.com>
AX: IsolatedTree: Implement more attributes
https://bugs.webkit.org/show_bug.cgi?id=193911
<rdar://problem/47599217>
Reviewed by Daniel Bates.
* Platform/spi/mac/AccessibilityPrivSPI.h: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]):
(-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]):
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
(-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
(-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2019-02-12 Wenson Hsieh <wenson_hsieh@apple.com>
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>
Reviewed by Ryosuke Niwa.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only
(excluding watchOS and Apple TV), and is additionally disabled on macOS.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the
usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView.
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDOMPasteAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _webTouchEventsRecognized:]):
Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the
web view resigns first responder, or if the web process crashes.
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
Reject text selection gestures while waiting for DOM paste access.
(-[WKContentView canPerformAction:withSender:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option.
(-[WKContentView _didHideMenu:]):
If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM
paste request.
(-[WKContentView pasteForWebView:]):
Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion
handler to invoke, instead of telling the page to execute a paste command.
(-[WKContentView _handleDOMPasteRequestWithResult:]):
Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result,
and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked
from various sources of user interaction or significant state changes (e.g. following a web process crash in
-cleanupInteraction).
(-[WKContentView _willPerformAction:sender:]):
(-[WKContentView _didPerformAction:sender:]):
Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't
get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not
invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few
possibilities here:
1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`,
which will notice that we have a pending paste completion handler and invoke it.
2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we
will invoke the paste completion handler in `-_didPerformAction:sender:`.
3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may
get a call to invoke a different action selector while waiting for a potential paste action. If this happens,
prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action.
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
Dismiss DOM paste UI upon handling any key event.
(-[WKContentView showGlobalMenuControllerInRect:]):
(-[WKContentView hideGlobalMenuController]):
Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for
presenting or dismissing the menu controller on iOS.
(-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]):
Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the
rect of the element the user has interacted with when triggering the paste. If such an element is too large or
does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small
amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.).
(-[WKContentView _resetShowingTextStyle:]): Deleted.
Rename this to `-_didHideMenu:`.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestDOMPasteAccess):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestDOMPasteAccess):
Add more plumbing and method stubs.
(WebKit::WebPage::updateCurrentModifierState):
(WebKit::WebPage::rectForElementAtInteractionLocation const):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rectForElementAtInteractionLocation const):
(WebKit::WebPage::rectForElementAtInteractionLocation): Deleted.
Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to
position the callout bar when pasting.
2019-02-12 Alex Christensen <achristensen@webkit.org>
Remove setDefersLoading infrastructure from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=194506
Reviewed by Brady Eidson.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::suspend): Deleted.
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::initialize):
(WebKit::NetworkLoad::setDefersLoading): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::suspend): Deleted.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::setDefersLoading):
2019-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix build warnings after content extensions enablement
https://bugs.webkit.org/show_bug.cgi?id=193622
<rdar://problem/47982850>
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(toResult):
2019-02-12 Tim Horton <timothy_horton@apple.com>
Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
https://bugs.webkit.org/show_bug.cgi?id=194524
<rdar://problem/35481797>
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/InputViewUpdateDeferrer.h:
* UIProcess/ios/InputViewUpdateDeferrer.mm:
(WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer):
(WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
Make use of the per-responder and much safer input view pinning mechanism.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:modifierFlags:]):
Always temporarily pin input views when becoming first responder; there are
many paths (such as through the text interaction assistant) that can
focus us on tap, trying to cover them all is a fool's errand. We'll
just get out the big hammer and call it in becomeFirstResponder.
This also means we can remove it from _singleTapCommitted and _attemptClick...
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Don't release the input view pinning until we return from _elementDidFocus;
it does the rebuilding synchronously, so we need to have actually updated
all of the prerequisites of -inputView before depinning.
2019-02-12 Youenn Fablet <youenn@apple.com>
Make use of is<SubresourceLoader>
https://bugs.webkit.org/show_bug.cgi?id=194541
Reviewed by Alex Christensen.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2019-02-12 Alex Christensen <achristensen@webkit.org>
WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
https://bugs.webkit.org/show_bug.cgi?id=194522
<rdar://problem/47789393>
Reviewed by Chris Dumez.
The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef).
This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent
navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems
when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
(WebKit::WebPage::close):
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.h:
(WebKit::WebProcess::eventDispatcher):
2019-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
https://bugs.webkit.org/show_bug.cgi?id=194370
Reviewed by Darin Adler.
It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
impossible and unreasonable to expect the application has not started other threads at this
point, and threads will be calling getenv(). WebKit itself has probably already started
threads of its own.
Fortunately, the remote inspector in the web process is already prepared to deal with
failure to connect to the inspector server, so we don't need to do anything except stop
messing with the environment.
Note these files are copies of each other. I'll merge them together in a follow-up patch.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):
2019-02-08 Beth Dakin <bdakin@apple.com>
Ensure old binaries have old snapshotting behaviors
https://bugs.webkit.org/show_bug.cgi?id=194449
-and corresponding-
rdar://problem/47931954
Reviewed by Darin Adler.
Make sure that a nil configuration behaves the same way that it used to on apps
that were linked before FirstWithSnapshotAfterScreenUpdates
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* UIProcess/Cocoa/VersionChecks.h:
2019-02-12 Andy Estes <aestes@apple.com>
[iOSMac] Enable Parental Controls Content Filtering
https://bugs.webkit.org/show_bug.cgi?id=194521
<rdar://39732376>
Reviewed by Tim Horton.
* Configurations/FeatureDefines.xcconfig:
2019-02-11 Alex Christensen <achristensen@webkit.org>
Remove noisy and unnecessary logs added in r241223
https://bugs.webkit.org/show_bug.cgi?id=194427
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Errors occur all the time in the XPC connection's event handler, like when a process terminates.
We don't need to print an "error" every time any process terminates.
2019-02-11 Brian Burg <bburg@apple.com>
[Cocoa] Web Automation: client callbacks are not called if delegate does not override
https://bugs.webkit.org/show_bug.cgi?id=194519
<rdar://problem/47981961>
Reviewed by Joseph Pecoraro.
Call the completion handler directly if the delegate does not implement the relevant method.
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
2019-02-11 Daniel Bates <dabates@apple.com>
[iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
https://bugs.webkit.org/show_bug.cgi?id=194505
<rdar://problem/47743533>
Reviewed by Tim Horton.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteToEndOfParagraph]): Added.
(-[WKContentView _transpose]): Added.
2019-02-11 Adrian Perez de Castro <aperez@igalia.com>
[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
https://bugs.webkit.org/show_bug.cgi?id=193622
Reviewed by Michael Catanzaro.
* NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
for GFileIOStream objects.
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
(WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
* NetworkProcess/NetworkLoadChecker.cpp:
(Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
processContentExtensionRulesForLoad() in order to avoid ambiguity.
* Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
* SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
Cocoa-specific anymore.
* SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
* SourcesWPE.txt: Ditto.
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(WKUserContentExtensionStoreCreate): Added.
(toResult): Added.
(WKUserContentExtensionStoreCompile): Added.
(WKUserContentExtensionStoreLookup): Added.
(WKUserContentExtensionStoreRemove): Added.
* UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
functions and for the WKUserContentExtensionStoreResult status enum.
* UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
(API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
always indicating a path.
2019-02-11 Daniel Bates <dabates@apple.com>
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>
Reviewed by Tim Horton.
Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.
* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.
2019-02-11 Jer Noble <jer.noble@apple.com>
[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
https://bugs.webkit.org/show_bug.cgi?id=194504
Reviewed by Eric Carlson.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::requestUserMediaAccess):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
2019-02-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241272 and r241276.
https://bugs.webkit.org/show_bug.cgi?id=194514
Broke the Apple Internal build and the fix requires human
intervention :( (Requested by dydz on #webkit).
Reverted changesets:
"[iOS] Mouse/Touch/Pointer events are missing modifier keys"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241272
"Fix internal iOS build after r241272"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241276
2019-02-11 Alex Christensen <achristensen@webkit.org>
Fix internal iOS build after r241272
https://bugs.webkit.org/show_bug.cgi?id=191446
* Platform/spi/ios/UIKitSPI.h:
Declare the _modifierFlags when using the internal SDK also.
2019-02-11 Wenson Hsieh <wenson_hsieh@apple.com>
fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
https://bugs.webkit.org/show_bug.cgi?id=194313
Reviewed by Tim Horton.
Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl dateTimePickerCalendarType]):
(-[WKDateTimePopover calendarType]):
2019-02-11 Daniel Bates <dabates@apple.com>
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>
Reviewed by Tim Horton.
Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.
* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.
2019-02-11 Youenn Fablet <youenn@apple.com>
Filter out Overconstrainederror.constraint when getUserMedia is not granted
https://bugs.webkit.org/show_bug.cgi?id=194240
Reviewed by Eric Carlson.
Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
Covered by added test.
* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isPending const):
(WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
(WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
(WebKit::UserMediaPermissionRequestProxy::userMediaID const):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userRequest const):
(WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
(WebKit::UserMediaPermissionRequestProxy::audioDevice const):
(WebKit::UserMediaPermissionRequestProxy::videoDevice const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
* UIProcess/WebPageProxy.h:
2019-02-11 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Do not try to create empty egl windows
https://bugs.webkit.org/show_bug.cgi?id=194497
Reviewed by Žan Doberšek.
In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
nullptr if 0 is passed as width or height. We should use at least 1x1 instead.
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::initialize):
(WebKit::AcceleratedSurfaceWPE::clientResize):
2019-02-10 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Do not use a sync IPC message to send the host FD to the web process
https://bugs.webkit.org/show_bug.cgi?id=194216
Reviewed by Darin Adler.
It can be sent as a web page creation parameter instead.
* PlatformWPE.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* SourcesWPE.txt:
* UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::create):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::releaseHostFileDescriptor):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
(WebKit::AcceleratedSurfaceWPE::initialize):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
* WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
* WebProcess/WebPage/wpe/CompositingManager.h: Removed.
2019-02-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add enable-javascript-markup setting
https://bugs.webkit.org/show_bug.cgi?id=193439
Reviewed by Michael Catanzaro.
Expose JavaScriptMarkupEnabled setting in the GLib API.
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_javascript_markup):
(webkit_settings_set_enable_javascript_markup):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
2019-02-10 Darin Adler <darin@apple.com>
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485
Reviewed by Daniel Bates.
* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
appendUnsignedAsHex instead of appendUnsigned64AsHex.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
reinterpret_cast<uintptr_t> instead of String::format and "%p".
2019-02-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241167.
https://bugs.webkit.org/show_bug.cgi?id=194482
Broke the GTK mediastream tests (Requested by philn on
#webkit).
Reverted changeset:
"Filter out Overconstrainederror.constraint when getUserMedia
is not granted"
https://bugs.webkit.org/show_bug.cgi?id=194240
https://trac.webkit.org/changeset/241167
2019-02-09 Darin Adler <darin@apple.com>
Eliminate unnecessary String temporaries by using StringConcatenateNumbers
https://bugs.webkit.org/show_bug.cgi?id=194021
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
(WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
(WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
and let makeString do the conversion without allocating/destroying a String.
* UIProcess/WebPageGroup.cpp:
(WebKit::pageGroupData): Remove String::number and let makeString do the conversion
without allocating/destroying a String.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createInspectorTargets): Ditto.
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::uniqueWorldName): Ditto.
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::identifier const): Ditto.
2019-02-09 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Fix typo in the newly added API
https://bugs.webkit.org/show_bug.cgi?id=194472
Reviewed by Michael Catanzaro.
Fix a typo: enableed -> enabled.
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_set_enable_back_forward_navigation_gestures):
* UIProcess/API/gtk/WebKitSettings.h:
2019-02-08 Alex Christensen <achristensen@webkit.org>
Speculative fix for Mojave API test after r241223
https://bugs.webkit.org/show_bug.cgi?id=194427
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
I'll worry about making things right in the daemon later.
2019-02-08 Chris Dumez <cdumez@apple.com>
[WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
https://bugs.webkit.org/show_bug.cgi?id=194463
Reviewed by Tim Horton.
Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
display, creating such object is expensive and it is even worse in a PSON world where we
swap process on navigation.
This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
a DisplayLink can now be associated to several IPC connections instead of having a 1:1
mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
of destroying it.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::startDisplayLink):
(WebKit::WebProcessPool::stopDisplayLink):
(WebKit::WebProcessPool::stopDisplayLinks):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::shutDown):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::addObserver):
(WebKit::DisplayLink::removeObserver):
(WebKit::DisplayLink::removeObservers):
(WebKit::DisplayLink::hasObservers const):
(WebKit::DisplayLink::displayLinkCallback):
* UIProcess/mac/DisplayLink.h:
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):
2019-02-08 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Implement back/forward touchpad gesture
https://bugs.webkit.org/show_bug.cgi?id=193919
Reviewed by Michael Catanzaro.
Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
ViewGestureController.cpp, split up Mac- and iOS-specific parts of
ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
touchpad swipe back-forward gesture for GTK based on that.
To avoid name conflict, rename existing ViewGestureController class inside
UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.
Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
scrolling events as a swipe as long as there's nowhere to scroll in that
direction and web page doesn't handle the scrolling.
This is only allowed for touchpads, even though it can theoretically work
with touch mice and trackpoints.
The gesture requires every item in back-forward list to have a snapshot.
There's already an existing infrastructure for that, so the patch changes
a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
The snapshots have to be taken in sync, so the implementation draws webview
widget into a Cairo image surface.
The gesture is disabled by default, and can be enabled by setting the newly
added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
true.
Gesture drawing is implemented via Cairo. When the gesture is active, the
actual page is drawn into a Cairo group, which is then drawn together with
a given snapshot, as well as dimming and a drop shadow over the "lower" layer.
Also add a memory pressure handler that clears snapshot store when low on memory.
* DerivedSources-input.xcfilelist:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/SessionState.h: Add snapshot to back-forward items for GTK.
* Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
* SourcesCocoa.txt:
* SourcesGTK.txt:
* UIProcess/API/glib/WebKitSettings.cpp:
Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
(webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged): Added, GTK only.
(webkitWebViewUpdateSettings):
(webkitWebViewDisconnectSettingsSignalHandlers):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
(WebKit::PageClientImpl::takeViewSnapshot): Added.
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFinishLoadForMainFrame): Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFailLoadForMainFrame): Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): Send a notification to the gesture controller.
(WebKit::PageClientImpl::didRestoreScrollPosition): Added, send a notification to the gesture controller.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitSettings.h:
Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
to public API.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
(webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
(webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
(webkitWebViewBaseViewGestureController): Added.
(webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
(webkitWebViewBaseTakeViewSnapshot): Added.
(webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
(webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
(webkitWebViewBaseDidFinishLoadForMainFrame): Added.
(webkitWebViewBaseDidFailLoadForMainFrame): Added.
(webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
(webkitWebViewBaseDidRestoreScrollPosition): Added.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
* UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
* UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
(WebKit::ViewGestureController::controllerForGesture):
(WebKit::ViewGestureController::takeNextGestureID):
(WebKit::ViewGestureController::willBeginGesture):
(WebKit::ViewGestureController::didEndGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection const):
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
(WebKit::ViewGestureController::didRepaintAfterNavigation):
(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
(WebKit::ViewGestureController::didRestoreScrollPosition):
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
(WebKit::ViewGestureController::checkForActiveLoads):
(WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
(WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
(WebKit::ViewGestureController::SnapshotRemovalTracker::start):
(WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
(WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
(WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
(WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
(WebKit::deltaShouldCancelSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::reset):
(WebKit::ViewGestureController::startSwipeGesture):
(WebKit::ViewGestureController::isPhysicallySwipingLeft const):
(WebKit::ViewGestureController::shouldUseSnapshotForSize):
(WebKit::ViewGestureController::forceRepaintIfNeeded):
(WebKit::ViewGestureController::willEndSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
* UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
(WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
(WebKit::ViewGestureController::shouldIgnorePinnedState):
(WebKit::ViewGestureController::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::hasActiveMagnificationGesture const):
(WebKit::ViewGestureController::setCustomSwipeViews):
(WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
(WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
(WebKit::ViewGestureController::didFinishLoadForMainFrame):
(WebKit::ViewGestureController::didFailLoadForMainFrame):
(WebKit::ViewGestureController::setSwipeGestureEnabled):
(WebKit::ViewGestureController::isSwipeGestureEnabled):
(WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
(WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
(WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
(WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::SwipeProgressTracker::progress const):
(WebKit::ViewGestureController::SwipeProgressTracker::direction const):
* UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
* UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshotStore::~ViewSnapshotStore):
(WebKit::ViewSnapshotStore::singleton):
(WebKit::ViewSnapshotStore::didAddImageToSnapshot):
(WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
(WebKit::ViewSnapshotStore::pruneSnapshots):
(WebKit::ViewSnapshotStore::recordSnapshot):
(WebKit::ViewSnapshotStore::discardSnapshotImages):
(WebKit::ViewSnapshot::~ViewSnapshot):
* UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
(WebKit::ViewSnapshot::setRenderTreeSize):
(WebKit::ViewSnapshot::renderTreeSize const):
(WebKit::ViewSnapshot::setBackgroundColor):
(WebKit::ViewSnapshot::backgroundColor const):
(WebKit::ViewSnapshot::setViewScrollPosition):
(WebKit::ViewSnapshot::viewScrollPosition const):
(WebKit::ViewSnapshot::setDeviceScaleFactor):
(WebKit::ViewSnapshot::deviceScaleFactor const):
(WebKit::ViewSnapshot::surface const):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
(WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
(WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
* UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::installMemoryPressureHandler):
* UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
re-implementation of trackSwipeEventWithOptions.
(WebKit::isEventStop):
(WebKit::ViewGestureController::platformTeardown):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::handleScrollWheelEvent):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
(WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
(WebKit::ViewGestureController::SwipeProgressTracker::reset):
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
(WebKit::easeOutCubic):
(WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
(WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
(WebKit::ViewGestureController::draw):
(WebKit::ViewGestureController::removeSwipeSnapshot):
(WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
(WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
* UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::memoryPressureMonitorDisabled): Added.
(WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
(WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
* UIProcess/mac/ViewGestureControllerMac.mm:
Moved many functions into UIProcess/ViewGestureController.cpp
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::scrollEventCanInfluenceSwipe): Deleted.
(WebKit::deltaShouldCancelSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
(WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
(WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
(WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
(WebKit::ViewGestureController::endSwipeGesture): Deleted.
(WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
* UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::snapshottingContext):
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::setSurface):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::setVolatile):
(WebKit::ViewSnapshot::asLayerContents):
(WebKit::ViewSnapshot::asImageForTesting):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
Make SetRenderTreeSizeNotificationThreshold() cross-platform.
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/WebPage.cpp:
Start using ViewGestureGeometryCollector for GTK.
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:
2019-02-08 Alex Christensen <achristensen@webkit.org>
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427
Reviewed by Geoffrey Garen.
There is still work to be done, but with the proper plist it starts and loads webpages!
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCEventHandler):
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCServiceEventHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const):
* UIProcess/WebProcessPool.h:
2019-02-08 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241197.
Broke iOS Simulator Debug build and casued 1 API failure on
High Sierra
Reverted changeset:
"Add SPI to use networking daemon instead of XPC service"
https://bugs.webkit.org/show_bug.cgi?id=194427
https://trac.webkit.org/changeset/241197
2019-02-08 Beth Dakin <bdakin@apple.com>
Abstract and discussion comments needed for afterScreenUpdates
https://bugs.webkit.org/show_bug.cgi?id=194442
Reviewed by Wenson Hsieh.
Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2019-02-08 Beth Dakin <bdakin@apple.com>
Add afterScreenUpdates to WKSnapshotConfiguration
https://bugs.webkit.org/show_bug.cgi?id=194362
-and corresponding-
<rdar://problem/40655528> Please add an "after screen updates" property to
WKSnapshotConfiguration (to solve blank snapshots)
Reviewed by Tim Horton.
This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
This makes our snapshotting API more predictable and reliable on iOS devices,
which is why the new configuration property defaults to YES.
New property that defaults to YES.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
* UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
(-[WKSnapshotConfiguration init]):
(-[WKSnapshotConfiguration copyWithZone:]):
When afterScreenUpdates is set, invoke the snapshot via
callAfterNextPresentationUpdate.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
(-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):
2019-02-08 Alex Christensen <achristensen@webkit.org>
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427
Reviewed by Geoffrey Garen.
There is still work to be done, but with the proper plist it starts and loads webpages!
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCEventHandler):
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCServiceEventHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const):
* UIProcess/WebProcessPool.h:
2019-02-08 Keith Rollin <krollin@apple.com>
Unreviewed build fix.
r241135 modified how entitlements were built up for the macOS. Those
changes broke the iOSMac builds. Bring back some deletions in order to
fix iOSMac.
* Configurations/PluginService.64.xcconfig:
* Configurations/PluginService.entitlements: Added.
* WebKit.xcodeproj/project.pbxproj:
2019-02-07 Chris Dumez <cdumez@apple.com>
Mark more heap-allocated classes as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194422
Reviewed by Ryosuke Niwa.
* NetworkProcess/NetworkLoad.cpp:
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ImportanceAssertion.h:
* PluginProcess/PluginCreationParameters.h:
* Shared/API/Cocoa/RemoteObjectRegistry.h:
* Shared/WebEvent.h:
* UIProcess/API/APIHTTPCookieStore.cpp:
* UIProcess/API/APINotificationProvider.h:
* UIProcess/API/Cocoa/PageLoadStateObserver.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/BackingStore.h:
* UIProcess/Cocoa/AutomationClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/FindClient.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/DeviceIdHashSaltStorage.h:
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Gamepad/UIGamepad.h:
* UIProcess/Notifications/WebNotificationProvider.h:
* UIProcess/ProcessAssertion.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebFormClient.h:
* UIProcess/WebGeolocationProvider.h:
* UIProcess/WebPageProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
* WebProcess/Network/webrtc/LibWebRTCNetwork.h:
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/WebRTCResolver.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebPage/DrawingArea.h:
2019-02-07 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [WK2] Modernize code for applying autocorrection
https://bugs.webkit.org/show_bug.cgi?id=194397
Reviewed by Tim Horton.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
Use BlockPtr instead of temporarily storing the completion handler.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Change a LegacySync to Delayed.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applyAutocorrection):
(WebKit::WebPage::syncApplyAutocorrection):
(WebKit::WebPage::applyAutocorrectionInternal):
2019-02-07 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
https://bugs.webkit.org/show_bug.cgi?id=194415
<rdar://problem/47550281>
Reviewed by Tim Horton.
Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _stylusSingleTapRecognized:]):
2019-02-07 Per Arne Vollan <pvollan@apple.com>
[macOS] Block coreservicesd in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=192670
Reviewed by Alexey Proskuryakov.
We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
_RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
the sandbox.
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):
* WebProcess/com.apple.WebProcess.sb.in:
2019-02-07 Youenn Fablet <youenn@apple.com>
Filter out Overconstrainederror.constraint when getUserMedia is not granted
https://bugs.webkit.org/show_bug.cgi?id=194240
Reviewed by Eric Carlson.
Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
Covered by added test.
* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isPending const):
(WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
(WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
(WebKit::UserMediaPermissionRequestProxy::userMediaID const):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userRequest const):
(WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
(WebKit::UserMediaPermissionRequestProxy::audioDevice const):
(WebKit::UserMediaPermissionRequestProxy::videoDevice const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
* UIProcess/WebPageProxy.h:
2019-02-07 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [WK2] Modernize autocorrection context code
https://bugs.webkit.org/show_bug.cgi?id=194373
Reviewed by Tim Horton.
* Shared/ios/WebAutocorrectionContext.h: Added.
(WebKit::WebAutocorrectionContext::encode const):
(WebKit::WebAutocorrectionContext::decode):
Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
Change to use this instead of a long list of arguments when propagating autocorrection context information over
IPC.
* UIProcess/AutoCorrectionCallback.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
(+[WKAutocorrectionContext autocorrectionContextWithContext:]):
(+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.
Change this constructor to take an entire WebAutocorrectionContext.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::autocorrectionContextCallback):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::autocorrectionContextSync):
(WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Use Delayed instead of LegacySync.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::autocorrectionContext):
Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
frame to compute and return a WebAutocorrectionContext.
(WebKit::WebPage::requestAutocorrectionContext):
(WebKit::WebPage::autocorrectionContextSync):
Renamed getAutocorrectionContext to autocorrectionContextSync.
(WebKit::computeAutocorrectionContext): Deleted.
(WebKit::WebPage::getAutocorrectionContext): Deleted.
2019-02-07 Youenn Fablet <youenn@apple.com>
Simplify applyConstraints callbacks
https://bugs.webkit.org/show_bug.cgi?id=194297
Reviewed by Eric Carlson.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2019-02-07 Brent Fulgham <bfulgham@apple.com>
Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
https://bugs.webkit.org/show_bug.cgi?id=194412
<rdar://problem/47820615>
Reviewed by Per Arne Vollan.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2019-02-07 Brent Fulgham <bfulgham@apple.com>
Permit additional IOKit Properties needed by older Mac Hardware
https://bugs.webkit.org/show_bug.cgi?id=194410
<rdar://problem/47820620>
Reviewed by Per Arne Vollan.
* WebProcess/com.apple.WebProcess.sb.in:
2019-02-07 Brady Eidson <beidson@apple.com>
Rename the TAKE_DOWNLOAD_ASSERTION macro.
Rubberstamped by Andy Estes.
* NetworkProcess/Downloads/DownloadMap.cpp:
* NetworkProcess/Downloads/DownloadMap.h:
2019-02-07 Keith Rollin <krollin@apple.com>
Fix XCBuild issue related to codesigning WebContent process
https://bugs.webkit.org/show_bug.cgi?id=193799
<rdar://problem/47533890>
Reviewed by Brent Fulgham.
Building with XCBuild enabled results in the error message "cannot
read entitlement data" when trying to codesign the macOS XPC
processes. The reason for this error message is that there is a build
step that deletes any previous "stale" generated .xcent file before
building up a new one. With XCBuild enabled, the build steps got
re-ordered, such that the step that deletes this file could get
executed after the steps that build up the file. The built-up set of
entitlements is now gone, and the build process fails when `codesign`
tries to access it.
The apparent quick-fix to this problem -- of tweaking dependencies so
that the build steps execute in the desired order -- wouldn't work
with XCBuild. Establishing these dependencies would require both
having multiple build phases produce the same .xcent file as output,
as well as a build phase that has this file as an input and an output.
XCBuild either forbids or frowns upon these configurations.
Ultimately, the solution that worked was to take over complete control
of the codesigning process. This means (a) not specifying a base
.entitlements file that XCode uses to start with (and which was
subsequently altered via custom build scripts), (b) not letting XCode
automatically and silently inject a 'get-task-all' entitlement used to
facilitate debugging (we now add that entitlement by hand), and (c)
building up all of our entitlements by hand via a single custom
script. Because of the addition of this custom script, many other
scripts and entitlements files could now be removed.
* Configurations/BaseXPCService.xcconfig:
* Configurations/Databases-iOS.entitlements: Removed.
* Configurations/Network-OSX-restricted.entitlements: Removed.
* Configurations/Network-OSX-sandbox.entitlements: Removed.
* Configurations/Network-OSX.entitlements: Removed.
* Configurations/NetworkService.xcconfig:
* Configurations/PluginService.64.xcconfig:
* Configurations/PluginService.entitlements: Removed.
* Configurations/WebContent-OSX-sandbox.entitlements: Removed.
* Configurations/WebContent-OSX.entitlements: Removed.
* Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
* Configurations/WebContentService.xcconfig:
* Scripts/copy-webcontent-resources-to-private-headers.sh:
* Scripts/process-entitlements.sh: Added.
* Scripts/process-network-sandbox-entitlements.sh: Removed.
* Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
* Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
* WebKit.xcodeproj/project.pbxproj:
2019-02-07 Alex Christensen <achristensen@webkit.org>
Fix internal build after r241127
https://bugs.webkit.org/show_bug.cgi?id=191394
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Add some (un)availability macros.
2019-02-07 Youenn Fablet <youenn@apple.com>
Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
https://bugs.webkit.org/show_bug.cgi?id=194312
Reviewed by Eric Carlson.
Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
Use the 'ended' mechanism to do the clean-up on WebProcess side.
As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
On WebProcess crash case, clean-up the proxy as well.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::end):
(WebKit::UserMediaCaptureManagerProxy::clear):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::sourceEnded):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2019-02-07 Alex Christensen <achristensen@webkit.org>
Print backgrounds preference should be honored instead of WKWebViewConfiguration value
https://bugs.webkit.org/show_bug.cgi?id=194364
<rdar://problem/47627599>
Reviewed by Tim Horton.
Without this patch, changing the preference for printing the background has no effect.
This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
are used when printing. Actually printing verifies this change fixes the bug.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
2019-02-07 Chris Dumez <cdumez@apple.com>
Mark DisplayLink as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194400
Reviewed by Geoffrey Garen.
* UIProcess/mac/DisplayLink.h:
2019-02-07 Per Arne Vollan <pvollan@apple.com>
[macOS] API test times out after r241026
https://bugs.webkit.org/show_bug.cgi?id=194372
Reviewed by Alex Christensen.
The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
for clients to decide which milestones they would like to listen for.
* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(layoutMilestones):
(setUpPageLoaderClient):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2019-02-07 Alex Christensen <achristensen@webkit.org>
Deprecate WKBundlePageSetDefersLoading
https://bugs.webkit.org/show_bug.cgi?id=191394
Reviewed by Dean Jackson.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetDefersLoading):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _defersLoading]):
(-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2019-02-07 Alex Christensen <achristensen@webkit.org>
Digital crown should scroll safe browsing warning on watchOS
https://bugs.webkit.org/show_bug.cgi?id=194363
<rdar://problem/47348124>
Reviewed by Wenson Hsieh.
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
(-[WKSafeBrowsingWarning addContent]):
2019-02-07 Alex Christensen <achristensen@webkit.org>
Shrink and hyphenate safe browsing warning text on watchOS
https://bugs.webkit.org/show_bug.cgi?id=194361
<rdar://problem/47466549>
Reviewed by Geoffrey Garen.
Some internationalizations use long words that didn't fit on small watches.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
2019-02-07 Miguel Gomez <magomez@igalia.com>
[WPE] Implement GStreamer based holepunch
https://bugs.webkit.org/show_bug.cgi?id=193715
Reviewed by Xabier Rodriguez-Calvar.
Add a new parameter to the calls of TextureMapper::drawSolidColor().
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2019-02-06 Benjamin Poulain <benjamin@webkit.org>
Unreviewed, rolling out r240759 and r240944.
Some timer uses are done off the main thread, WebCore::Timer
cannot be used
Reverted changesets:
"<rdar://problem/47570443> Responsiveness timers are too
expensive for frequent events"
https://bugs.webkit.org/show_bug.cgi?id=194003
https://trac.webkit.org/changeset/240759
"Use deferrable timer to restart the Responsiveness Timer on
each wheel event"
https://bugs.webkit.org/show_bug.cgi?id=194135
https://trac.webkit.org/changeset/240944
2019-02-06 chris fleizach <cfleizach@apple.com>
AX: com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
https://bugs.webkit.org/show_bug.cgi?id=194306
<rdar://problem/47764549>
Reviewed by Zalan Bujtas.
Check the page reference is still valid.
Modernize code in this area.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2019-02-06 Daniel Bates <dabates@apple.com>
Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
https://bugs.webkit.org/show_bug.cgi?id=194321
Reviewed by Jer Noble.
Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
and UIDelegate.mm among other benefits.
* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::toNSEventModifierFlags):
(WebKit::WebEventFactory::toNSButtonNumber):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]):
(-[WKNavigationAction buttonNumber]):
(toNSEventModifierFlags): Deleted.
(toNSButtonNumber): Deleted.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
(WebKit::toNSEventModifierFlags): Deleted.
2019-02-06 Andy Estes <aestes@apple.com>
[Payment Request] It should be possible to require a phonetic name for shipping contacts
https://bugs.webkit.org/show_bug.cgi?id=194311
<rdar://46733045>
Reviewed by Alex Christensen.
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:
2019-02-06 Keith Rollin <krollin@apple.com>
Really enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194357
<rdar://problem/47861231>
Reviewed by Chris Dumez.
Bug 194124 was supposed to enable the automatic checking and
regenerating of .xcfilelist files during the build. While related
changes were included in that patch, the change to actually enable the
operation somehow was omitted. This patch actually enables the
operation. The check-xcfilelist.sh scripts now check
WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
from the checking.
* Scripts/check-xcfilelists.sh:
2019-02-06 John Wilander <wilander@apple.com>
Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
https://bugs.webkit.org/show_bug.cgi?id=194325
<rdar://problem/47840283>
Reviewed by Chris Dumez.
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
Now holds an optional WebCore::AdClickAttribution object.
2019-02-06 Daniel Bates <dabates@apple.com>
Fix the Apple Internal build. See <rdar://problem/47860943> for more details.
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
(-[WKFullscreenStackView init]):
2019-02-06 Daniel Bates <dabates@apple.com>
Standardize on ControlKey instead of CtrlKey
https://bugs.webkit.org/show_bug.cgi?id=194317
Reviewed by Tim Horton.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::handleKeyPress):
2019-02-06 Per Arne Vollan <pvollan@apple.com>
Roll out parts of r238819 since it is a PLT performance regression.
https://bugs.webkit.org/show_bug.cgi?id=194346
Unreviewed performance fix.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didFinishLoadForFrame):
(globalObjectIsAvailableForFrame):
(didRemoveFrameFromHierarchy):
(didCommitLoadForFrame):
(didFinishDocumentLoadForFrame):
(didFailProvisionalLoadWithErrorForFrame):
(didFailLoadWithErrorForFrame):
(didSameDocumentNavigationForFrame):
(didLayoutForFrame):
(didReachLayoutMilestone):
(didFirstVisuallyNonEmptyLayoutForFrame):
(didHandleOnloadEventsForFrame):
(userAgentForURL):
(setUpPageLoaderClient):
(willSendRequestForFrame):
(didInitiateLoadForResource):
(didFinishLoadForResource):
(didFailLoadForResource):
(setUpResourceLoadClient):
(-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
(ResourceLoadClient::ResourceLoadClient): Deleted.
(ResourceLoadClient::loadDelegate const): Deleted.
(ResourceLoadClient::pluginContextController const): Deleted.
(PageLoaderClient::PageLoaderClient): Deleted.
(PageLoaderClient::loadDelegate const): Deleted.
(PageLoaderClient::pluginContextController const): Deleted.
(PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didFinishLoadForFrame): Deleted.
(PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
(PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
(PageLoaderClient::didCommitLoadForFrame): Deleted.
(PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
(PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
(PageLoaderClient::didLayoutForFrame): Deleted.
(PageLoaderClient::didReachLayoutMilestone): Deleted.
(PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
(PageLoaderClient::layoutMilestones const): Deleted.
(PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
(PageLoaderClient::userAgentForURL const): Deleted.
(ResourceLoadClient::willSendRequestForFrame): Deleted.
(ResourceLoadClient::didInitiateLoadForResource): Deleted.
(ResourceLoadClient::didFinishLoadForResource): Deleted.
(ResourceLoadClient::didFailLoadForResource): Deleted.
2019-02-06 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r240785): [SOUP] Broke cookie persistent storage
https://bugs.webkit.org/show_bug.cgi?id=194209
Reviewed by Carlos Garcia Campos.
I missed a spot when moving the persistent storage parameters from NetworkProcess to
NetworkSession. They have to be initialized separately for the default session.
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2019-02-05 Alex Christensen <achristensen@webkit.org>
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027
Reviewed by Youenn Fablet.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::singleton): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
(WebKit::NetworkBlobRegistry::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
(WebKit::NetworkConnectionToWebProcess::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initialize):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkBlobRegistry):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PreconnectTask.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2019-02-05 Daniel Bates <dabates@apple.com>
Fix a typo in r241006. Substitute Modifier for Modifiers.
* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2019-02-05 Daniel Bates <dabates@apple.com>
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)
Substitute OptionSet<WebEvent::Modifier> for Modifiers.
* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
* Shared/mac/WebGestureEvent.h:
(WebKit::WebGestureEvent::WebGestureEvent):
2019-02-05 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240984.
Revision casued two API timeouts
Reverted changeset:
"Stop using blobRegistry in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=194027
https://trac.webkit.org/changeset/240984
2019-02-05 Youenn Fablet <youenn@apple.com>
UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
https://bugs.webkit.org/show_bug.cgi?id=194246
Reviewed by Eric Carlson.
With PSON enabled, the manager proxy can be destroyed.
It is thus important for its callbacks to check for 'this' to be valid.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2019-02-05 Daniel Bates <dabates@apple.com>
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)
Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::protocolModifierToWebEventModifier):
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):
2019-02-05 Daniel Bates <dabates@apple.com>
Make WebEvent::Modifiers an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=194241
Reviewed by Simon Fraser.
Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
OptionSet.
While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
this enum more closely match WebCore::PlatformEvent::Modifier.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* Shared/WebEvent.cpp:
(WebKit::WebEvent::WebEvent):
* Shared/WebEvent.h:
(WebKit::WebEvent::shiftKey const):
(WebKit::WebEvent::controlKey const):
(WebKit::WebEvent::altKey const):
(WebKit::WebEvent::metaKey const):
(WebKit::WebEvent::capsLockKey const):
(WebKit::WebEvent::modifiers const):
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
* Shared/WebTouchEvent.cpp:
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
(WebIOSEventFactory::createWebKeyboardEvent):
(WebIOSEventFactory::createWebMouseEvent):
* Shared/libwpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* Shared/win/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
(WebKit::modifiersForCurrentKeyState):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::mouseDidMoveOverElement):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/API/glib/WebKitPrivate.cpp:
(toPlatformModifiers):
* UIProcess/API/glib/WebKitPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewMouseTargetChanged):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::simulateMouseInteraction):
(WebKit::protocolModifierToWebEventModifier):
(WebKit::WebAutomationSession::performMouseInteraction):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):
(WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(WebKit::InjectedBundleNavigationAction::modifiers const):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showContextMenuAtPoint):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent const):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mouseDidMoveOverElement):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):
2019-02-05 Tim Horton <timothy_horton@apple.com>
Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
https://bugs.webkit.org/show_bug.cgi?id=194301
<rdar://problem/47719379>
Reviewed by Beth Dakin.
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet presentWithParameters:completionHandler:]):
NSSharingServicePicker's delegate callbacks can be called synchronously.
We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
there was nothing keeping the NSSharingServicePicker alive inside
showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
fall and result in sending a message to a released NSSharingServicePicker.
To resolve this, keep an extra reference to the WKShareSheet until
presentation is complete.
2019-02-05 Keith Rollin <krollin@apple.com>
Enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194124
<rdar://problem/47721277>
Reviewed by Tim Horton.
Bug 193790 add a facility for checking -- during build time -- that
any needed .xcfilelist files are up-to-date and for updating them if
they are not. This facility was initially opt-in by setting
WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
the process seemed robust. Its now time to enable this facility and
make it opt-out. If there is a need to disable this facility, set and
export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
running `make` or `build-webkit`, or before running Xcode from the
command line.
Additionally, remove the step that generates a list of source files
going into the UnifiedSources build step. It's only necessarily to
specify Sources.txt and SourcesCocoa.txt as inputs.
* UnifiedSources-input.xcfilelist: Removed.
* WebKit.xcodeproj/project.pbxproj:
2019-02-05 Brady Eidson <beidson@apple.com>
Add a new DownloadMap type that manages taking an assertion automatically.
https://bugs.webkit.org/show_bug.cgi?id=194294
Reviewed by Alex Christensen.
If we don't need the download assertion, we use a vanilla HashMap like today.
If we need the download assertion, we use the new DownloadMap class instead.
The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::downloadFinished):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/DownloadMap.cpp: Added.
(WebKit::DownloadMap::get const):
(WebKit::DownloadMap::isEmpty const):
(WebKit::DownloadMap::size const):
(WebKit::DownloadMap::contains const):
(WebKit::DownloadMap::add):
(WebKit::DownloadMap::remove):
* NetworkProcess/Downloads/DownloadMap.h: Added.
* Sources.txt:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
* WebKit.xcodeproj/project.pbxproj:
2019-02-05 Brady Eidson <beidson@apple.com>
Fix iOS simulator build after r240954
Unreviewed.
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.
2019-02-05 Alex Christensen <achristensen@webkit.org>
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027
Reviewed by Youenn Fablet.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::singleton): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
(WebKit::NetworkBlobRegistry::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
(WebKit::NetworkConnectionToWebProcess::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initialize):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkBlobRegistry):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PreconnectTask.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2019-02-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r240742.
Causes crashes on iOS simulator.
Reverted changeset:
"[iOS] Keyups for non-modifier keys identified as "Dead" when
not focused in a content-editable element"
https://bugs.webkit.org/show_bug.cgi?id=192824
https://trac.webkit.org/changeset/240742
2019-02-05 Alex Christensen <achristensen@webkit.org>
Protect globalWebSocketStreamMap with a Lock
https://bugs.webkit.org/show_bug.cgi?id=194224
<rdar://problem/47581081>
Reviewed by Ryosuke Niwa.
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::streamWithIdentifier):
(WebKit::WebSocketStream::networkProcessCrashed):
(WebKit::WebSocketStream::WebSocketStream):
(WebKit::WebSocketStream::~WebSocketStream):
2019-02-04 Alex Christensen <achristensen@webkit.org>
Add Networking Daemon skeleton
https://bugs.webkit.org/show_bug.cgi?id=194278
Reviewed by Zalan Bujtas.
Daemon skeletons? This is spooky stuff.
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
(WebKit::DaemonMain):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
* Shared/API/Cocoa/WKMain.h:
* Shared/API/Cocoa/WKMain.mm:
(WKDaemonMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
(main):
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
2019-02-04 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
https://bugs.webkit.org/show_bug.cgi?id=193993
Reviewed by Keith Miller.
* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.h:
2019-02-04 Simon Fraser <simon.fraser@apple.com>
Move some macOS/iOS scrolling code into the scrolling/cocoa directory
https://bugs.webkit.org/show_bug.cgi?id=194245
Reviewed by Zalan Bujtas.
Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2019-02-04 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Add webkit_uri_for_display for GTK and WPE.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:
2019-02-04 Alex Christensen <achristensen@webkit.org>
Move XPCService main to a shared file calling a C function
https://bugs.webkit.org/show_bug.cgi?id=194256
Reviewed by Brady Eidson.
This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
This is similar to r236075 but more general.
* Shared/API/Cocoa/WKMain.h: Added.
* Shared/API/Cocoa/WKMain.mm: Added.
(WKXPCServiceMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
(main):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main): Deleted.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-02-04 Alex Christensen <achristensen@webkit.org>
Make MessageSender functions const
https://bugs.webkit.org/show_bug.cgi?id=194247
Reviewed by Brady Eidson.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::messageSenderConnection const):
(WebKit::Download::messageSenderDestinationID const):
(WebKit::Download::messageSenderConnection): Deleted.
(WebKit::Download::messageSenderDestinationID): Deleted.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::messageSenderConnection const):
(WebKit::PendingDownload::messageSenderDestinationID const):
(WebKit::PendingDownload::messageSenderConnection): Deleted.
(WebKit::PendingDownload::messageSenderDestinationID): Deleted.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::messageSenderConnection const):
(WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::messageSenderConnection const):
(WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::messageSenderConnection const):
(WebKit::NetworkSocketStream::messageSenderDestinationID const):
(WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
(WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::messageSenderConnection const):
(WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
(WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
(WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* Platform/IPC/MessageSender.h:
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::messageSenderConnection const):
(WebKit::AuxiliaryProcess::messageSenderDestinationID const):
(WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
(WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
* Shared/AuxiliaryProcess.h:
* UIProcess/WebConnectionToWebProcess.cpp:
(WebKit::WebConnectionToWebProcess::messageSenderConnection const):
(WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
(WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
(WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
* UIProcess/WebConnectionToWebProcess.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::messageSenderConnection const):
(WebKit::WebPageProxy::messageSenderDestinationID const):
(WebKit::WebPageProxy::messageSenderConnection): Deleted.
(WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
* UIProcess/WebPageProxy.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection const):
(WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderConnection const):
(WebKit::WebResourceLoader::messageSenderDestinationID const):
(WebKit::WebResourceLoader::messageSenderConnection): Deleted.
(WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::messageSenderConnection const):
(WebKit::WebSocketStream::messageSenderDestinationID const):
(WebKit::WebSocketStream::messageSenderConnection): Deleted.
(WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
* WebProcess/Network/WebSocketStream.h:
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/WebConnectionToUIProcess.cpp:
(WebKit::WebConnectionToUIProcess::messageSenderConnection const):
(WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
(WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
(WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
* WebProcess/WebConnectionToUIProcess.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::messageSenderConnection const):
(WebKit::WebPage::messageSenderDestinationID const):
(WebKit::WebPage::messageSenderConnection): Deleted.
(WebKit::WebPage::messageSenderDestinationID): Deleted.
* WebProcess/WebPage/WebPage.h:
2019-02-04 Brady Eidson <beidson@apple.com>
Take additional process assertion while downloading.
<rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
Reviewed by Chris Dumez.
When the first download starts, grab this new assertion.
When the last download ends, release it.
* Configurations/Network-iOS.entitlements:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::downloadFinished):
* NetworkProcess/Downloads/DownloadManager.h:
* Platform/spi/ios/AssertionServicesSPI.h:
* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::ProcessAssertion):
* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertion::ProcessAssertion):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didSetAssertionState):
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::flagsForState):
(WebKit::reasonForState):
(WebKit::ProcessAssertion::ProcessAssertion):
2019-02-04 Said Abou-Hallawa <said@apple.com>
[CG] Enable setAdditionalSupportedImageTypes for WK1
https://bugs.webkit.org/show_bug.cgi?id=194190
Reviewed by Tim Horton.
Move the function webCoreStringVectorFromNSStringArray from WebKit to
WebCore so it can be used by both WebKit and WebKitLegacy.
* Platform/mac/StringUtilities.h:
* Platform/mac/StringUtilities.mm:
(WebKit::webCoreStringVectorFromNSStringArray): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
2019-02-04 Benjamin Poulain <benjamin@webkit.org>
Use deferrable timer to restart the Responsiveness Timer on each wheel event
https://bugs.webkit.org/show_bug.cgi?id=194135
Reviewed by Simon Fraser.
Simon Fraser suggested a neat improvement over my previous optimization
of ResponsivenessTimer.
Instead of reseting the deadline with every event, we can let the timer
fire and add the missing time from the last start.
I implemented that behavior in the new Deferrable Timer class and use
it from ResponsivenessTimer.
* NetworkProcess/watchos/NetworkProximityAssertion.h:
* UIProcess/ResponsivenessTimer.h:
* WebProcess/Plugins/PluginView.h:
2019-02-04 Simon Fraser <simon.fraser@apple.com>
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, improve preprocessor guard
https://bugs.webkit.org/show_bug.cgi?id=194166
<rdar://problem/47694328>
AC mode is only optional in GTK port. Requested by Zan.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2019-02-04 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak WebIDBConnectionToServer in layout tests
https://bugs.webkit.org/show_bug.cgi?id=193688
<rdar://problem/47353263>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
2019-02-04 Antoine Quint <graouts@apple.com>
<rdar://problem/47788802>
Unreviewed build fix.
* Platform/spi/ios/UIKitSPI.h:
2019-02-04 Youenn Fablet <youenn@apple.com>
Capture state should be managed consistently when doing process swapping
https://bugs.webkit.org/show_bug.cgi?id=194122
<rdar://problem/47609293>
Reviewed by Eric Carlson.
When doing PSON, WebPageProxy::resetState is called.
It resets the media state, but does not call the client delegates.
Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
Covered by new API test and layout test.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaCaptureState]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::updatePlayingMediaDidChange):
* UIProcess/WebPageProxy.h:
2019-02-04 Antoine Quint <graouts@apple.com>
Use a dedicated type instead of int32_t for pointer identifiers
https://bugs.webkit.org/show_bug.cgi?id=194217
Reviewed by Antti Koivisto.
* Scripts/webkit/messages.py:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::cancelPointer):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::cancelPointer):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, avoid -Wswitch warnings introduced in r240880
https://bugs.webkit.org/show_bug.cgi?id=193740
<rdar://problem/47527267>
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
2019-02-04 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Allow pinch zoom on touchpad
https://bugs.webkit.org/show_bug.cgi?id=194201
Reviewed by Michael Catanzaro.
Enable touchpad events for WebkitWebViewBase, then feed touchpad
pinch events to GestureController.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
(webkitWebViewBaseEvent): Added.
(webkit_web_view_base_class_init): Override event vfunc.
2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=194166
<rdar://problem/47694328>
Accelerated compositing is broken for me at least. We're a long way from being able to force
it.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2019-02-04 Abderrahim Kitouni <akitouni@gnome.org>
[GTK] Remove last python2 dependency from CMake build process
https://bugs.webkit.org/show_bug.cgi?id=194218
Reviewed by Michael Catanzaro.
* InspectorGResources.cmake:
2019-02-04 Antti Koivisto <antti@apple.com>
Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
https://bugs.webkit.org/show_bug.cgi?id=194215
Reviewed by Frédéric Wang.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
2019-02-03 Antti Koivisto <antti@apple.com>
[iOS] Tiles not created in large scrollable iframes
https://bugs.webkit.org/show_bug.cgi?id=193665
Reviewed by Simon Fraser.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
We now use scrollContainerLayer consistently so remove the special cases.
2019-02-03 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
https://bugs.webkit.org/show_bug.cgi?id=194141
Reviewed by Ross Kirsling.
Implemented WebKit::NetworkProcess::switchToNewTestingSession and
WebKit::NetworkProcess::ensureSession for curl port.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession):
(WebKit::NetworkProcess::ensureSession):
2019-02-03 Simon Fraser <simon.fraser@apple.com>
Make setNeedsLayout on the root more explicitly about triggering its side-effects
https://bugs.webkit.org/show_bug.cgi?id=194198
Reviewed by Antti Koivisto.
Call the newly named functions.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::updateScrollbars):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHeaderBannerHeightForTesting):
(WebKit::WebPage::setFooterBannerHeightForTesting):
* WebProcess/WebPage/mac/PageBannerMac.mm:
(WebKit::PageBanner::addToPage):
(WebKit::PageBanner::detachFromPage):
(WebKit::PageBanner::hide):
2019-02-03 Ryosuke Niwa <rniwa@webkit.org>
Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
https://bugs.webkit.org/show_bug.cgi?id=194189
Reviewed by Geoffrey Garen.
Pass the policy check identifier around functions and store it in PolicyDecisionSender
so that we can send it back to WebCore with the navigation policy decision.
We also store it in WebFrame in the case the policy decision had to be invalidated
before the decision was received (via WebFrame::invalidatePolicyListener).
* Scripts/webkit/messages.py:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
(WebKit::WebPageProxy::PolicyDecisionSender::create):
(WebKit::WebPageProxy::PolicyDecisionSender::send):
(WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setUpPolicyListener):
(WebKit::WebFrame::invalidatePolicyListener):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-02-03 Megan Gardner <megan_gardner@apple.com>
Turn on Smart Paste
https://bugs.webkit.org/show_bug.cgi?id=193786
Reviewed by Ryosuke Niwa.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/TextCheckerIOS.mm:
(WebKit::TextChecker::isSmartInsertDeleteEnabled):
Use the flag from UIKit to determine if smart copy paste should be
turned on.
2019-02-02 Simon Fraser <simon.fraser@apple.com>
Tidy up data memebers of FrameView and related classes to shrink class sizes
https://bugs.webkit.org/show_bug.cgi?id=194197
Reviewed by Zalan Bujtas.
* UIProcess/PageClient.h: Declare enum size.
2018-12-16 Darin Adler <darin@apple.com>
Convert additional String::format clients to alternative approaches
https://bugs.webkit.org/show_bug.cgi?id=192746
Reviewed by Alexey Proskuryakov.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
Use makeString and FormattedNumber.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Added a comment about an
incorrect format specifier and left this code as is for now.
2019-02-01 David Kilzer <ddkilzer@apple.com>
Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
<https://webkit.org/b/193866>
Reviewed by Alex Christensen.
* Platform/mac/MenuUtilities.mm:
- Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
- Add soft-linking code formerly in TUCallSPI.h.
2019-02-01 Alex Christensen <achristensen@webkit.org>
Move XPCService entry points from mac directory to new Cocoa directory
https://bugs.webkit.org/show_bug.cgi?id=194129
Reviewed by Chris Dumez.
* Configurations/NetworkService.xcconfig:
* Configurations/PluginService.64.xcconfig:
* Configurations/WebContentService.xcconfig:
* NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
* NetworkProcess/EntryPoint/mac: Removed.
* PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
* PluginProcess/EntryPoint/mac: Removed.
* Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
* Shared/EntryPointUtilities/mac: Removed.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
* WebProcess/EntryPoint/mac: Removed.
2019-02-01 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
https://bugs.webkit.org/show_bug.cgi?id=194140
<rdar://problem/47728098>
Reviewed by Tim Horton.
Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
blocked.
By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
process.
Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
* Shared/ios/InteractionInformationAtPosition.h:
(WebKit::InteractionInformationAtPosition::invalidInformation):
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
Add a new flag to indicate whether an interaction information response can be valid. Interaction information
cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
messages from the web process.
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
(WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView ensurePositionInformationIsUpToDate:]):
(-[WKContentView _positionInformationDidChange:]):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
(WebKit::WebChromeClient::print):
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
gesture recognizer delegate hooks.
(WebKit::WebPage::touchEventSync):
* WebProcess/WebPage/WebPage.h:
Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
IPC::SendSyncOption::InformPlatformProcessWillSuspend.
* WebProcess/WebPage/WebPage.messages.in:
Change these from LegacySync to Delayed messages.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
cancelGesturesBlockedOnSynchronousReplies().
(WebKit::WebPage::positionInformation):
Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
a separate helper.
(WebKit::WebPage::requestPositionInformation):
2019-02-01 David Quesada <david_quesada@apple.com>
Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
https://bugs.webkit.org/show_bug.cgi?id=194144
rdar://problem/47553456
Reviewed by Geoffrey Garen.
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
Make a mutable copy of the root object decoded from the resume data.
It might have been originally encoded as an immutable dictionary.
2019-02-01 Chris Dumez <cdumez@apple.com>
REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
https://bugs.webkit.org/show_bug.cgi?id=193740
<rdar://problem/47527267>
Reviewed by Alex Christensen.
The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to
start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess.
Getting such IPC after a provisional load has started would mess up our state machine and trip assertions.
This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame()
/ DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old
process when the load is continuing in a new process, instead of sending it "Ignore".
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionResponseDisposition):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2019-02-01 Jer Noble <jer.noble@apple.com>
Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating
WebPreferencesStoreDefaultsMap.cpp.
* page/SettingsBase.h:
2019-02-01 Antoine Quint <graouts@apple.com>
Dispatch pointercancel events when content is panned or zoomed on iOS
https://bugs.webkit.org/show_bug.cgi?id=193962
<rdar://problem/47629134>
Reviewed by Dean Jackson.
When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
PointerCaptureController::cancelPointer().
* Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
UITouches by the identifier generated for the matching WebKit touch.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
top-level UIScrollView.
(-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
* UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
forward the call to WKContentViewInteraction.
(WebKit::PageClient::cancelPointersForGestureRecognizer):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
(WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
(-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
pinch gesture on a nested UIScrollView.
(-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::cancelPointer):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
through the WebPageProxy, for all touches associated with the provided gesture recognizer.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::cancelPointer):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-02-01 Jer Noble <jer.noble@apple.com>
Make the WebKit default for media source based on the WebCore default.
https://bugs.webkit.org/show_bug.cgi?id=194172
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setMediaSourceEnabled:]):
(-[WKPreferences _mediaSourceEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-02-01 Simon Fraser <simon.fraser@apple.com>
Force settings.acceleratedCompositingEnabled() to true for WebKit
https://bugs.webkit.org/show_bug.cgi?id=194166
rdar://problem/47694328
Reviewed by Tim Horton.
WebKit relies on accelerated compositing for its drawing areas to function correctly,
and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings,
so force this setting to be always on (and release log if this happens).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2019-02-01 Antti Koivisto <antti@apple.com>
Don't use base layer() as the scroll layer in scrolling tree.
https://bugs.webkit.org/show_bug.cgi?id=194160
Reviewed by Simon Fraser.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateNode>::encode):
(ArgumentCoder<ScrollingStateNode>::decode):
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2019-02-01 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Improve use of SoupCookiePersistentStorageType
https://bugs.webkit.org/show_bug.cgi?id=194103
Reviewed by Carlos Garcia Campos.
Turn it into an enum class, and stop casting it to and from uint32_t.
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* Shared/soup/SoupCookiePersistentStorageType.h:
(): Deleted.
* UIProcess/API/glib/WebKitCookieManager.cpp:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/soup/WebCookieManagerProxySoup.cpp:
(WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
(WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
2019-02-01 Per Arne Vollan <pvollan@apple.com>
[macOS] Revert parts of r240811, since it causes kernel panics.
https://bugs.webkit.org/show_bug.cgi?id=194061
Unreviewed crash fix.
* WebProcess/com.apple.WebProcess.sb.in:
2019-02-01 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Improve use of PAL::SessionID in WebKitCookieManager
https://bugs.webkit.org/show_bug.cgi?id=194092
Reviewed by Carlos Garcia Campos.
Always get it from the data store instead of assuming the default session ID, and add a
helper function for this.
* UIProcess/API/glib/WebKitCookieManager.cpp:
(_WebKitCookieManagerPrivate::sessionID const):
(_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
(webkitCookieManagerCreate):
(webkit_cookie_manager_set_persistent_storage):
(webkit_cookie_manager_set_accept_policy):
(webkit_cookie_manager_get_accept_policy):
(webkit_cookie_manager_add_cookie):
(webkit_cookie_manager_get_cookies):
(webkit_cookie_manager_delete_cookie):
2019-01-31 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Remove unnecessary member from NetworkStorageSession.
https://bugs.webkit.org/show_bug.cgi?id=194137
Reviewed by Don Olmstead.
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2019-01-31 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, build fix after r240805
This patch reverts the BlockPtr change since it breaks iOS builds.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryInterceptNavigation):
2019-01-31 Chris Dumez <cdumez@apple.com>
Page zoom level is lost after a process swap or a crash
https://bugs.webkit.org/show_bug.cgi?id=194105
<rdar://problem/47610781>
Reviewed by Alex Christensen.
Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy,
we would update the WebPageProxy's corresponding data members and send an IPC to the
WebProcess to apply the zoom factors.
The issue is that on process crash or process-swap, we never communicate those zoom factors
to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with
the same factors again, it would be a no-op since the WebPageProxy's data members already
reflect the expected values.
To address the issue, pass both the page zoom and the text zoom factors to the WebProcess
via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're
sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process
side upon creation (whether after a crash or a process swap).
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
2019-01-31 Per Arne Vollan <pvollan@apple.com>
[macOS] Disable permissive call logging in sandbox
https://bugs.webkit.org/show_bug.cgi?id=194061
Reviewed by Alexey Proskuryakov.
Strict call filtering should be reenabled.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-31 Per Arne Vollan <pvollan@apple.com>
[macOS] Crash when control-clicking or copying text rendered with a web font
https://bugs.webkit.org/show_bug.cgi?id=193913
<rdar://problem/47541039>
Reviewed by Brent Fulgham.
On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-31 Benjamin Poulain <benjamin@webkit.org>
Remove WKPageIsWebProcessResponsive
https://bugs.webkit.org/show_bug.cgi?id=194096
Reviewed by Alex Christensen.
It is not used by any client.
It is also bad API. It is better to let WebKit track
responsiveness and tell the client with processDidBecomeResponsive.
* UIProcess/API/C/WKPage.cpp:
(WKPageIsWebProcessResponsive): Deleted.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isWebProcessResponsive): Deleted.
* UIProcess/WebPageProxy.h:
2019-01-31 Alex Christensen <achristensen@webkit.org>
Revert r238819 which is unneeded and caused a performance regression.
https://bugs.webkit.org/show_bug.cgi?id=192272
<rdar://problem/46664625>
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(PageLoaderClient::didStartProvisionalLoadForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-01-31 Jiewen Tan <jiewen_tan@apple.com>
Formalize WebKitAdditions mechanism of LoadOptimizer
https://bugs.webkit.org/show_bug.cgi?id=193886
<rdar://problem/47696809>
Reviewed by Brent Fulgham.
This patch does the following few things:
1) formalizes WebKitAdditions mechanism of LoadOptimizer;
2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
3) lets AppLinks have higher precedence than LoadOptimizer.
* SourcesCocoa.txt:
* UIProcess/Cocoa/LoadOptimizer.h: Removed.
* UIProcess/Cocoa/LoadOptimizer.mm: Removed.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryOptimizingLoad):
(WebKit::tryInterceptNavigation):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::loadOptimizer): Deleted.
* WebKit.xcodeproj/project.pbxproj:
2019-01-31 Chris Dumez <cdumez@apple.com>
Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
https://bugs.webkit.org/show_bug.cgi?id=194094
<rdar://problem/47580753>
Reviewed by Ryosuke Niwa.
If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
the completion handler cannot try and use the suspended page proxy while it is being destroyed.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2019-01-31 Timothy Hatcher <timothy@apple.com>
Fix LSAppLink deprecation warnings.
https://bugs.webkit.org/show_bug.cgi?id=194097
Unreviewed build fix.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
2019-01-30 Simon Fraser <simon.fraser@apple.com>
[Mac] Implement basic hit testing in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=172917
<rdar://problem/34215516>
Reviewed by Antti Koivisto.
Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h:
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
(WebKit::ScrollerPairMac::handleWheelEvent):
(WebKit::ScrollerPairMac::handleMouseEvent):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
2019-01-31 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=194075
Reviewed by Alex Christensen.
Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
NetworkSession to reduce globals. This removes two of the six soup-specific variables in
NetworkProcessCreationParameters
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitCookieManager.cpp:
(webkit_cookie_manager_set_persistent_storage):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
(WebKit::WebsiteDataStore::platformSetParameters): Deleted.
* UIProcess/soup/WebCookieManagerProxySoup.cpp:
(WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
(WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2019-01-31 Ryosuke Niwa <rniwa@webkit.org>
iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=194083
Reviewed by Tim Horton.
We think this crash is a regression from r236966. Prior to r236966, we could only called
removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.
This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
when SnapshotRemovalTracker has a valid removal callback set.
Unfortunately no new tests since there is no reproducible test case, and neither API tests
nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
r240765 bypass UIKit and emulates the action instead.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
2019-01-30 Benjamin Poulain <benjamin@webkit.org>
<rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
https://bugs.webkit.org/show_bug.cgi?id=194003
Reviewed by Geoffrey Garen.
The problem here is specific to wheel events.
For every wheel event, we start a responsiveness timer and send
a ping to the WebProcess. When the WebProcess respond, we stop the timer.
The cost of setting up the timers adds up since we get many events.
The first step to improve the situation was to switch ResponsivenessTimer
to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
we save the allocation/deallocation, insertion in the event loop, etc.
Using WebCore::Timer saves some instructions but we were still hitting
the kernel at 120hz to set up then kill each timer.
The second improvement of the patch is to avoid that by not killing the timer
when we hear back from the WebProcess.
Instead of killing the timer, we let it run and ignore the result.
When the next event comes, we reschedule the existing timer.
This brings down the timers to 60Hz, the same rate as the events.
The very last event does time out. In that case, we have a bad idle wake up:
we wake up a sleeping CPU do do nothing.
In the case of wheel events, this is fine since we saved a bunch of CPU already.
For all the other cases, I kept the normal operating mode to avoid the idle wake.
* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::ResponsivenessTimer):
(WebKit::ResponsivenessTimer::invalidate):
(WebKit::ResponsivenessTimer::timerFired):
(WebKit::ResponsivenessTimer::start):
(WebKit::ResponsivenessTimer::startWithLazyStop):
(WebKit::ResponsivenessTimer::stop):
(WebKit::ResponsivenessTimer::processTerminated):
(WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
* UIProcess/ResponsivenessTimer.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendWheelEvent):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::isResponsiveWithLazyStop):
* UIProcess/WebProcessProxy.h:
2019-01-30 Daniel Bates <dabates@apple.com>
[iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
https://bugs.webkit.org/show_bug.cgi?id=193987
<rdar://problem/47230785>
Reviewed by Tim Horton.
It is unnecessary to relinquish first responder status when a user explicitly dismissing
the keyboard. Moreover, doing so prevents key commands from being intercepted when a
hardware keyboard is subsequently attached.
Following r238635 a page becomes focused (accepting of keyboard input) and defocused
when the WKContentView becomes first responder and resigns first responder, respectively.
When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
button (iPad) then UIKit tells WKContentView to resign its first responder status only
to make its superview, WKWebView, first responder. When a person subsequently taps on the
page again, the WKContentView requests to become the first responder. However changes to
page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
will schedule an update). In particular, they are not guaranteed to be sent before the
WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
focus state of the page. Instead we should detect when WKWebView is being asked to resign
as a result of the keyboard dismissal and refuse the request, taking care to end the current
editing session, blur the focused element, and dismiss the on-screen keyboard.
* Platform/spi/ios/UIKitSPI.h: Expose some SPI.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Register to receive notifications whenever a user
explicitly dismisses the keyboard.
(-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
result of a user explicitly dismissing the keyboard then refuse to resign.
(-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.
2019-01-30 Keith Rollin <krollin@apple.com>
Add default constructor for NetworkActivityTracker
https://bugs.webkit.org/show_bug.cgi?id=194058
<rdar://problem/47685457>
Reviewed by Chris Dumez.
ResourceNetworkActivityTracker has a default constructor. It also has
a NetworkActivityTracker data member, which does not have a default
constructor. This will cause some compilers to complain -- they can't
default-create a ResourceNetworkActivityTracker because they can't
default-create its data members. Address this by adding a default
constructor for NetworkActivityTracker.
* NetworkProcess/NetworkActivityTracker.h:
2019-01-30 Daniel Steffen <dsteffen@apple.com>
<rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
https://bugs.webkit.org/show_bug.cgi?id=193992
Reviewed by Geoffrey Garen.
The denap SPI is deprecated.
The new way of staying out of AppNap is through a voucher.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):
* Platform/IPC/mac/ImportanceAssertion.h:
(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::~ImportanceAssertion):
2019-01-30 Chris Dumez <cdumez@apple.com>
Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194054
Reviewed by Brent Fulgham.
The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
2019-01-30 Daniel Bates <dabates@apple.com>
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/47100332>
Reviewed by Wenson Hsieh.
Use the same code path for key events to editable elements and non-editable elements.
Currently we have different code paths for hardware key events depending on whether the active element
is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
presses this differentiation was a necessary workaround for UIKit's event processing precedence of
interpreting key events for system text editing commands and app commands before dispatching unhandled
key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
key events use the same code path.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
(-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
element (by returning NO in -_requiresKeyboardWhenFirstResponder).
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
automatic keyboard UI.
(-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
now that we require a keyboard when first responder even if the focused element is non-editable.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
its chance to interpret the UIEvent, we intercepted, for app key commands.
(-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
(e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
when the popover is presented.
2019-01-30 Per Arne Vollan <pvollan@apple.com>
[macOS] Sandbox fails to compile on 10.12
https://bugs.webkit.org/show_bug.cgi?id=194035
<rdar://problem/47651260>
Reviewed by Brent Fulgham.
This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
10.14 and later.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-29 Conrad Shultz <conrad_shultz@apple.com>
Ensure image picker sourceType is set before cameraDevice
https://bugs.webkit.org/show_bug.cgi?id=193998
Reviewed by Beth Dakin.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2019-01-30 Chris Dumez <cdumez@apple.com>
Regression(PSON) Load hang can occur on history navigation
https://bugs.webkit.org/show_bug.cgi?id=194030
<rdar://problem/47656939>
Reviewed by Antti Koivisto.
We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
if we decide to reuse an existing process on process-swap, we need to make sure that we either use
its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
make sure we drop the existing suspended page for this process / pagePID combination, so that the
WebPage on WebProcess side gets closed before we attempt to do the new load.
We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
whose process is still alive (presumably because it is kept alive by another suspended page). This
patch fixes this third place to remove any suspended page in the process for the current page before
reusing the process. An assertion was also added to the call site in
WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
future.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
(WebKit::WebProcessPool::hasSuspendedPageFor const):
* UIProcess/WebProcessPool.h:
2019-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
https://bugs.webkit.org/show_bug.cgi?id=194024
Reviewed by Michael Catanzaro.
Fixes a crash in gdk_gl_context_dispose().
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
2019-01-30 Antti Koivisto <antti@apple.com>
Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
https://bugs.webkit.org/show_bug.cgi?id=193897
<rdar://problem/47427750>
Reviewed by Simon Fraser.
There has been some null pointer crashes where we fail to find a remote layer tree node that matches
the transaction properties.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::updateChildren):
Null check the nodes.
2019-01-30 Simon Fraser <simon.fraser@apple.com>
Add some basic geometry information to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194002
Reviewed by Antti Koivisto.
Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
2019-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
https://bugs.webkit.org/show_bug.cgi?id=193903
Reviewed by Michael Catanzaro.
The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
accelerated compositing issues in Wayland.
We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
created in the new context will be accessible from the painting one.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/AcceleratedBackingStore.h:
(WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
(WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
(WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
(WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
WebView GL context.
(WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
(WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
resources when unset.
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
(WebKit::WaylandCompositor::Surface::commit): Ditto.
(WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
* UIProcess/gtk/WaylandCompositor.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
2019-01-29 Ryosuke Niwa <rniwa@webkit.org>
iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
https://bugs.webkit.org/show_bug.cgi?id=193996
Reviewed by Wenson Hsieh.
Added a missing nullptr check.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
2019-01-29 Simon Fraser <simon.fraser@apple.com>
Add nodes to the scrolling tree in z-index order.
https://bugs.webkit.org/show_bug.cgi?id=192529
<rdar://problem/47402708>
Reviewed by Dean Jackson.
FrameHosting nodes have layers, so need to update them.
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2019-01-29 Alex Christensen <achristensen@webkit.org>
Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
https://bugs.webkit.org/show_bug.cgi?id=193974
Reviewed by Tim Horton.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
2019-01-29 Youenn Fablet <youenn@apple.com>
Adopt new SPI to evaluate server certificate trust
https://bugs.webkit.org/show_bug.cgi?id=193355
Reviewed by Alex Christensen.
Use new SPI provided in NSURLSession to evaluate server certificates.
If successful, let loading proceed as usual.
Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(canNSURLSessionTrustEvaluate):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
2019-01-29 Tim Horton <timothy_horton@apple.com>
Fix the build
* UIProcess/ios/WKDrawingCoordinator.h:
* UIProcess/ios/WKDrawingCoordinator.mm:
* UIProcess/ios/WKDrawingView.mm:
2019-01-29 Alex Christensen <achristensen@webkit.org>
Remove unused NetworkProcessProxy::writeBlobToFilePath
https://bugs.webkit.org/show_bug.cgi?id=193990
Reviewed by Wenson Hsieh.
This code was only used in code that was introduced in r235202
but that has since been refactored to not use blobs. Its tests still pass.
This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
* UIProcess/WebPageProxy.h:
2019-01-29 Devin Rousso <drousso@apple.com>
Web Inspector: expose a way of determining if a detached frontend is for a remote target
https://bugs.webkit.org/show_bug.cgi?id=193951
<rdar://problem/47621366>
Reviewed by Joseph Pecoraro.
* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::InspectionTargetType): Added.
(WebKit::WebInspectorProxy::createFrontendWindow):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::createFrontendWindow):
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
* UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
* UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
(-[WKInspectorWindow isRemote]): Added.
* Shared/API/Cocoa/_WKNSWindowExtras.mm:
(-[NSWindow _web_isWebInspectorWindow]):
* PlatformMac.cmake:
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
2019-01-29 Alex Christensen <achristensen@webkit.org>
Rename ChildProcess to AuxiliaryProcess
https://bugs.webkit.org/show_bug.cgi?id=193943
Reviewed by Andy Estes.
"Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/Cookies/WebCookieManager.cpp:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::callExitSoon):
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::initializeConnection):
(WebKit::NetworkProcess::terminate):
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessSupplement.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::NetworkProcessMainUnix):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* NetworkProcess/watchos/NetworkProximityManager.h:
* NetworkProcess/watchos/NetworkProximityManager.mm:
(WebKit::NetworkProximityManager::NetworkProximityManager):
* NetworkProcess/win/NetworkProcessMainWin.cpp:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::NetworkProcessMainWin):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::initializeProcess):
(WebKit::PluginProcess::initializeConnection):
(WebKit::PluginProcess::didReceiveMessage):
(WebKit::PluginProcess::initializeProcessName):
(WebKit::PluginProcess::initializeSandbox):
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess):
(WebKit::PluginProcess::initializeProcessName):
(WebKit::PluginProcess::initializeSandbox):
(WebKit::PluginProcess::stopRunLoop):
* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix):
* PluginProcess/unix/PluginProcessUnix.cpp:
(WebKit::PluginProcess::platformInitializeProcess):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::AuthenticationManager):
* Shared/Authentication/AuthenticationManager.h:
* Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
(WebKit::AuxiliaryProcess::AuxiliaryProcess):
(WebKit::AuxiliaryProcess::~AuxiliaryProcess):
(WebKit::AuxiliaryProcess::didClose):
(WebKit::AuxiliaryProcess::initialize):
(WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
(WebKit::AuxiliaryProcess::initializeProcess):
(WebKit::AuxiliaryProcess::initializeProcessName):
(WebKit::AuxiliaryProcess::initializeConnection):
(WebKit::AuxiliaryProcess::addMessageReceiver):
(WebKit::AuxiliaryProcess::removeMessageReceiver):
(WebKit::AuxiliaryProcess::disableTermination):
(WebKit::AuxiliaryProcess::enableTermination):
(WebKit::AuxiliaryProcess::messageSenderConnection):
(WebKit::AuxiliaryProcess::messageSenderDestinationID):
(WebKit::AuxiliaryProcess::terminationTimerFired):
(WebKit::AuxiliaryProcess::stopRunLoop):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::AuxiliaryProcess::terminate):
(WebKit::AuxiliaryProcess::shutDown):
(WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
(WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
(WebKit::ChildProcess::ChildProcess): Deleted.
(WebKit::ChildProcess::~ChildProcess): Deleted.
(WebKit::ChildProcess::didClose): Deleted.
(WebKit::ChildProcess::initialize): Deleted.
(WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
(WebKit::ChildProcess::initializeProcess): Deleted.
(WebKit::ChildProcess::initializeProcessName): Deleted.
(WebKit::ChildProcess::initializeConnection): Deleted.
(WebKit::ChildProcess::addMessageReceiver): Deleted.
(WebKit::ChildProcess::removeMessageReceiver): Deleted.
(WebKit::ChildProcess::disableTermination): Deleted.
(WebKit::ChildProcess::enableTermination): Deleted.
(WebKit::ChildProcess::messageSenderConnection): Deleted.
(WebKit::ChildProcess::messageSenderDestinationID): Deleted.
(WebKit::ChildProcess::terminationTimerFired): Deleted.
(WebKit::ChildProcess::stopRunLoop): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
(WebKit::ChildProcess::terminate): Deleted.
(WebKit::ChildProcess::shutDown): Deleted.
(WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
(WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
* Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
(WebKit::ChildProcess::parentProcessConnection const): Deleted.
(WebKit::ChildProcess::messageReceiverMap): Deleted.
(WebKit::ChildProcess::setTerminationTimeout): Deleted.
(WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
* Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
* Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
(WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
(WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
(WebKit::ChildProcessSupplement::initializeConnection): Deleted.
* Shared/ChildProcess.cpp: Removed.
* Shared/ChildProcess.h: Removed.
* Shared/ChildProcess.messages.in: Removed.
* Shared/ChildProcessSupplement.h: Removed.
* Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
(WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
* Shared/Cocoa/ChildProcessCocoa.mm: Removed.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::initializeAuxiliaryProcess):
(WebKit::XPCServiceInitializer):
(WebKit::initializeChildProcess): Deleted.
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
(WebKit::m_childProcessType): Deleted.
* Shared/WebSQLiteDatabaseTracker.h:
* Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::setQOS):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::setQOS): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
* Shared/ios/ChildProcessIOS.mm: Removed.
* Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
(WebKit::SandboxInfo::SandboxInfo):
(WebKit::AuxiliaryProcess::launchServicesCheckIn):
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::processStorageClass):
(WebKit::sandboxDirectory):
(WebKit::applySandbox):
(WebKit::initializeSandboxParameters):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::stopNSAppRunLoop):
(WebKit::AuxiliaryProcess::stopNSRunLoop):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::AuxiliaryProcess::setQOS):
(WebKit::AuxiliaryProcess::isSystemWebKit):
(WebKit::ChildProcess::launchServicesCheckIn): Deleted.
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
(WebKit::ChildProcess::stopNSRunLoop): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
(WebKit::ChildProcess::setQOS): Deleted.
(WebKit::ChildProcess::isSystemWebKit): Deleted.
* Shared/mac/ChildProcessMac.mm: Removed.
* Shared/mac/SecItemShim.cpp:
(WebKit::globalNetworkProcess):
(WebKit::sendSecItemRequest):
(WebKit::initializeSecItemShim):
* Shared/mac/SecItemShim.h:
* Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
(WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
* Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
(WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
(WebKit::initializeAuxiliaryProcess):
(WebKit::AuxiliaryProcessMain):
(WebKit::ChildProcessMainBase::platformInitialize): Deleted.
(WebKit::ChildProcessMainBase::platformFinalize): Deleted.
(WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
(WebKit::initializeChildProcess): Deleted.
(WebKit::ChildProcessMain): Deleted.
* Shared/unix/ChildProcessMain.cpp: Removed.
* Shared/unix/ChildProcessMain.h: Removed.
* Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
(WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
* Shared/win/ChildProcessMainWin.cpp: Removed.
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
* UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
(WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
(WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
(WebKit::AuxiliaryProcessProxy::connect):
(WebKit::AuxiliaryProcessProxy::terminate):
(WebKit::AuxiliaryProcessProxy::state const):
(WebKit::AuxiliaryProcessProxy::sendMessage):
(WebKit::AuxiliaryProcessProxy::addMessageReceiver):
(WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
(WebKit::AuxiliaryProcessProxy::dispatchMessage):
(WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
(WebKit::AuxiliaryProcessProxy::shutDownProcess):
(WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
(WebKit::AuxiliaryProcessProxy::connectionWillOpen):
(WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
(WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
(WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
(WebKit::ChildProcessProxy::connect): Deleted.
(WebKit::ChildProcessProxy::terminate): Deleted.
(WebKit::ChildProcessProxy::state const): Deleted.
(WebKit::ChildProcessProxy::sendMessage): Deleted.
(WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
(WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
(WebKit::ChildProcessProxy::dispatchMessage): Deleted.
(WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
(WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
(WebKit::ChildProcessProxy::shutDownProcess): Deleted.
(WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
(WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
* UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
(WebKit::AuxiliaryProcessProxy::send):
(WebKit::AuxiliaryProcessProxy::sendSync):
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
(WebKit::ChildProcessProxy::send): Deleted.
(WebKit::ChildProcessProxy::sendSync): Deleted.
(WebKit::ChildProcessProxy::connection const): Deleted.
(WebKit::ChildProcessProxy::hasConnection const): Deleted.
(WebKit::ChildProcessProxy::processIdentifier const): Deleted.
(WebKit::ChildProcessProxy::canSendMessage const): Deleted.
(WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
(WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
(WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
* UIProcess/ChildProcessProxy.cpp: Removed.
* UIProcess/ChildProcessProxy.h: Removed.
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::DownloadProxyMap):
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getLaunchOptions):
(WebKit::NetworkProcessProxy::createDownloadProxy):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions):
(WebKit::PluginProcessProxy::sendMemoryPressureEvent):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendMemoryPressureEvent):
(WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::getLaunchOptions):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
(WebKit::WebProcessProxy::shouldTerminate):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
* UIProcess/WebProcessProxy.h:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::terminate):
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::initializeSandbox):
(WebKit::WebProcess::platformInitializeProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcessSupplement.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):
(WebKit::WebProcess::stopRunLoop):
(WebKit::WebProcess::initializeSandbox):
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMainUnix):
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMainWin):
* WebProcess/wpe/WebProcessMainWPE.cpp:
(WebKit::WebProcessMainUnix):
2019-01-29 Simon Fraser <simon.fraser@apple.com>
REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
https://bugs.webkit.org/show_bug.cgi?id=193907
Reviewed by Frédéric Wang.
Remove encode/decode of removedNodes.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::encode const):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
2019-01-29 Brent Fulgham <bfulgham@apple.com>
StorageAccess API calls should be direct to the Network Process
https://bugs.webkit.org/show_bug.cgi?id=193924
<rdar://problem/47611249>
Reviewed by Alex Christensen.
Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
API should happen directly between the WebContent and Network processes.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::requestStorageAccessGranted):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
(WebKit::WebPageProxy::hasStorageAccess): Deleted.
(WebKit::WebPageProxy::requestStorageAccess): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
(WebKit::nextRequestStorageAccessContextId): Deleted.
(WebKit::WebPage::storageAccessResponse): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-01-29 Chris Dumez <cdumez@apple.com>
Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
https://bugs.webkit.org/show_bug.cgi?id=193967
<rdar://problem/47635348>
Reviewed by Alex Christensen.
Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
the old process when the load is continuing in a new process due to PSON.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
* UIProcess/WebPageProxy.h:
2019-01-29 Keith Rollin <krollin@apple.com>
Add .xcfilelists to Run Script build phases
https://bugs.webkit.org/show_bug.cgi?id=193792
<rdar://problem/47201785>
Reviewed by Alex Christensen.
As part of supporting XCBuild, update the necessary Run Script build
phases in their Xcode projects to refer to their associated
.xcfilelist files.
Note that the addition of these files bumps the Xcode project version
number to something that's Xcode 10 compatible. This change means that
older versions of the Xcode IDE can't read these projects. Nor can it
fully load workspaces that refer to these projects (the updated
projects are shown as non-expandable placeholders). `xcodebuild` can
still build these projects; it's just that the IDE can't open them.
Make special accommodations for incorporating .xcfilelists from
WebKitAdditions.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* WebKit.xcodeproj/project.pbxproj:
2019-01-29 Antti Koivisto <antti@apple.com>
REGRESSION (PSON): Flash on link navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193961
<rdar://problem/47482507>
Reviewed by Chris Dumez.
The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach): Deleted.
Not needed anymore.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
Move message sending logic fully to TiledCoreAnimationDrawingArea.
Unfreezing the layer tree is sufficient to trigger the message.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
There is no need to treat process swap case differently.
(WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
Send this after the first successful layer flush with the root layer set.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
2019-01-29 Timothy Hatcher <timothy@apple.com>
Add back some includes that got removed at some point.
https://bugs.webkit.org/show_bug.cgi?id=193942
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
2019-01-29 Chris Dumez <cdumez@apple.com>
Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
https://bugs.webkit.org/show_bug.cgi?id=193848
Reviewed by Youenn Fablet.
* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
* UIProcess/ChildProcessProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebProcessPool.cpp:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
2019-01-29 Chris Dumez <cdumez@apple.com>
REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
https://bugs.webkit.org/show_bug.cgi?id=193932
<rdar://problem/47598947>
Reviewed by Brady Eidson.
When doing a client side redirect from origin A to origin B, we would swap process and
create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
that the BackForwardList is locked for such redirect so we end up updating the current
BackForwardListItem with origin B's URL while origin A's suspended page remained on
the item. When going to another URL in the same origin A, we would not create a suspended
page since no process-swap would occur. When pressing the back button, we would go back
to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
wrong URL (The pre-client redirect one).
To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
redirects. There will be no way no go back to this suspended page anyway since the
back/forward list item will be updated with the redirection URL.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2019-01-29 Chris Dumez <cdumez@apple.com>
Regression(r240046) VoiceOver is no longer working after a process swap
https://bugs.webkit.org/show_bug.cgi?id=193953
<rdar://problem/47612398>
Reviewed by Alex Christensen.
ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
the provisional WebProcess to the WebPageProxy right away. This in turn would notify
the PageClient whose logic would rely on WebPageProxy::process(), which returns the
committed process instead of the provisional one.
To address the issue, the ProvisionalPageProxy now stores the token sent by the
provisional WebProcess and we only call registerWebProcessAccessibilityToken()
on the WebPageProxy *after* we've swapped to the provisional process.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/ProvisionalPageProxy.h:
(WebKit::ProvisionalPageProxy::takeAccessibilityToken):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::commitProvisionalPage):
2019-01-28 Ryosuke Niwa <rniwa@webkit.org>
User agent string override for navigator.userAgent should be site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=193950
Reviewed by Brent Fulgham.
Renamed the various member variables, functions, properties and selectors.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
(-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.
2019-01-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r240630.
https://bugs.webkit.org/show_bug.cgi?id=193958
Broke Apple internal builds (Requested by rniwa on #webkit).
Reverted changeset:
"Add back some includes that got removed at some point."
https://bugs.webkit.org/show_bug.cgi?id=193942
https://trac.webkit.org/changeset/240630
2019-01-28 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to edit page WebRTC settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193863
<rdar://problem/47572764>
Reviewed by Joseph Pecoraro.
* Shared/WebPreferences.yaml:
Add page-level settings for WebRTC preferences.
2019-01-28 Ross Kirsling <ross.kirsling@sony.com>
Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
https://bugs.webkit.org/show_bug.cgi?id=193941
Reviewed by Alex Christensen.
* Shared/linux/WebMemorySamplerLinux.cpp:
2019-01-28 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] WebCore/platform/Process.h is conflicting with process.h
https://bugs.webkit.org/show_bug.cgi?id=193944
Reviewed by Ross Kirsling.
* Shared/ChildProcess.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
* Shared/unix/ChildProcessMain.cpp:
* UIProcess/API/APINavigation.h:
* UIProcess/ChildProcessProxy.h:
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessProxy.h:
2019-01-28 Jon Lee <jonlee@apple.com>
Update Screen Capture preference
https://bugs.webkit.org/show_bug.cgi?id=193947
rdar://problem/47620199
Reviewed by Youenn Fablet.
* Shared/WebPreferences.yaml:
2019-01-28 Andy Estes <aestes@apple.com>
[watchOS] Enable Parental Controls content filtering
https://bugs.webkit.org/show_bug.cgi?id=193939
<rdar://problem/46641912>
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
2019-01-28 David Kilzer <ddkilzer@apple.com>
REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
<https://webkit.org/b/193884>
Reviewed by Jiewen Tan.
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
- Add LocalAuthenticationSoftLink.mm to the project.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
- Move soft-linking implementation to
LocalAuthenticationSoftLink.mm.
2019-01-28 Timothy Hatcher <timothy@apple.com>
Add back some includes that got removed at some point.
https://bugs.webkit.org/show_bug.cgi?id=193942
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
2019-01-28 Timothy Hatcher <timothy@apple.com>
Make it easier for non-Apple ports to enable dark mode CSS support.
https://bugs.webkit.org/show_bug.cgi?id=193882
Reviewed by Megan Gardner.
Make modern WebKit code for dark mode usable by other ports, to match
the WebCore parts that have been cross-platform all along.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/PageClient.h:
(WebKit::PageClient::effectiveAppearanceIsDark const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::setUseDarkAppearance):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-01-28 Andy Estes <aestes@apple.com>
[Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentRuleListStore
https://bugs.webkit.org/show_bug.cgi?id=193927
Reviewed by Tim Horton.
This is useful for clients migrating from _WKUserContentExtensionStore to the modern
WKContentRuleList* APIs.
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(-[_WKUserContentExtensionStore _contentRuleListStore]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2019-01-28 David Kilzer <ddkilzer@apple.com>
Move soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
<https://webkit.org/b/193868>
Reviewed by Daniel Bates.
* Platform/spi/ios/ManagedConfigurationSPI.h:
- Remove soft-linking code from header.
- Add PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) guard.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _defineForWebView:]):
- Add soft-linking code formerly in ManagedConfigurationSPI.h.
- Change MCFeatureDefinitionLookupAllowed to use soft-link
function getMCFeatureDefinitionLookupAllowed() to remove the
#define.
2019-01-28 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r240348): Loading netflix home page panics device
https://bugs.webkit.org/show_bug.cgi?id=193936
Reviewed by Alexey Proskuryakov.
Temporarily enable permissive call filtering.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-28 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes crash
https://bugs.webkit.org/show_bug.cgi?id=193456
<rdar://problem/47275642>
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
Allow access to iconservices.
2019-01-28 Daniel Bates <dabates@apple.com>
[iOS] Make Window virtual key code computation match Mac
https://bugs.webkit.org/show_bug.cgi?id=193452
Reviewed by Ryosuke Niwa.
Compute the Windows virtual key code from the WebEvent.
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):
2019-01-28 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r240498): Storage Access API prompts result is not remembered
https://bugs.webkit.org/show_bug.cgi?id=193922
<rdar://problem/47608767>
Reviewed by Chris Dumez.
The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore
that kept track of whether a successful user prompt had been encountered. This
patch corrects this codepath so the user is not prompted repeatedly after approving
use of the Storage Access API.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to
const reference to allow the method to be called by the NetworkProcess.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics
object, rather than jumping directly to the NetworkStorageSession.
2019-01-28 Chris Dumez <cdumez@apple.com>
Regression(PSON) Crash under WebPageProxy::didStartProgress()
https://bugs.webkit.org/show_bug.cgi?id=193915
<rdar://problem/47560907>
Reviewed by Alex Christensen.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
IPC after this or even worse, commit the provisional page.
(WebKit::WebPageProxy::didStartProgress):
Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
closed.
2019-01-28 Antoine Quint <graouts@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
Unreviewed build fix.
* UIProcess/API/Cocoa/WKWebView.mm:
2019-01-28 Antoine Quint <graouts@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
Unreviewed build fix.
* UIProcess/ios/WKContentViewInteraction.mm:
2019-01-28 Brent Fulgham <bfulgham@apple.com>
Remove the UIProcess components of the ResourceLoadStatistics code
https://bugs.webkit.org/show_bug.cgi?id=193303
<rdar://problem/47160073>
Reviewed by Chris Dumez.
Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid
of the UIProcess copies of these routines.
Tested by existing ResourceLoadStatistics and StorageAccess tests.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
(WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
(WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::resetParametersToDefaultValues):
(WebKit::WebsiteDataStore::submitTelemetry):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
(WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::webProcessWillOpenConnection):
(WebKit::WebsiteDataStore::webProcessDidCloseConnection):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebsiteDataStore::didCreateNetworkProcess):
(WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted.
(WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted.
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted.
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted.
(WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted.
(WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted.
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted.
(WebKit::WebsiteDataStore::removePrevalentDomains): Deleted.
(WebKit::WebsiteDataStore::isGrandfathered): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-01-28 Antoine Quint <graouts@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
<rdar://problem/47283874>
Reviewed by Antti Koivisto and Simon Fraser.
Handle the "none", "pan-x", "pan-y" and "pinch-zoom" values for the touch-action property by querying the scrolling tree whenever a touch begins
to identify whether its point is contained within the region of an element with a non-auto touch-action property. If it is, we use the list of
permitted touch actions such to then customize the behavior of the nearest scroll view to pan or zoom only as instructed.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TouchActionData>::encode):
(IPC::ArgumentCoder<TouchActionData>::decode):
(IPC::ArgumentCoder<EventTrackingRegions>::encode):
(IPC::ArgumentCoder<EventTrackingRegions>::decode):
(IPC::ArgumentCoder<Region>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Account for panning constraints set on the content view to prevent deceleration
to pan the view if it ought not.
(-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Implement an additional
UIScrollView delegation method to apply the panning constraints set on the content view while panning.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const):
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const):
(WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier):
(WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Apply the same logic as in WKWebView.
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Apply
the same logic as in WKWebView.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isScrollingOrZooming const):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView preventsPanningInXAxis]):
(-[WKContentView preventsPanningInYAxis]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _handleTouchActionsForTouchEvent:]): As we process touches, check whether there are touch actions set for this touch's points' locations. Based
on those touch actions, either setDefaultPrevented on the _touchEventGestureRecognizer if the touch action is "none" or selectively disable panning and zooming.
(-[WKContentView _resetPanningPreventionFlags]):
(-[WKContentView _didEndScrollingOrZooming]):
2019-01-28 Antti Koivisto <antti@apple.com>
WebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete itself
https://bugs.webkit.org/show_bug.cgi?id=193901
<rdar://problem/47338669>
Reviewed by David Kilzer.
Don't know how to repro.
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
Calling userMessageHandlers.removeFirstMatching() may remove the last ref to this
(because WebUserMessageHandlerDescriptorProxy refs WebUserContentController).
Fix by protecting this over the function.
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.
2019-01-27 Jiewen Tan <jiewen_tan@apple.com>
Use a load optimizer for some sites
https://bugs.webkit.org/show_bug.cgi?id=193881
<rdar://problem/46325455>
Reviewed by Brent Fulgham.
We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives
within the WebsiteDataStore as one client instance should have only one and it should live
as long as the client lives. How does the load optimizer work? It intercepts every load in
the navigation state. If a request meets some requirements, it will then fetch the request
from its own cache. Once the fetch succeeds, the original load will be ignored and the
optimizer will display the cached content.
Covered by API tests.
* SourcesCocoa.txt:
* UIProcess/Cocoa/LoadOptimizer.h: Added.
* UIProcess/Cocoa/LoadOptimizer.mm: Added.
* UIProcess/Cocoa/MediaCaptureUtilities.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryInterceptNavigation):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::tryAppLink): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::loadOptimizer):
* WebKit.xcodeproj/project.pbxproj:
2019-01-25 Brian Burg <bburg@apple.com>
Web Automation: add support for simulating single touches to Automation.performInteractionSequence
https://bugs.webkit.org/show_bug.cgi?id=193852
<rdar://problem/28360781>
Reviewed by Joseph Pecoraro and Simon Fraser.
This patch makes it possible to simulate touches via the Actions API. The approach is to
use a stripped down version of HIDEventGenerator to send HID events to the UIWindow.
The initial version supports a single touch point; this may be expanded if needed, but
so far it hasn't been an impediment when running desktop-oriented WebDriver test suites.
As part of implementing this support, I went through and added [somewhat obnoxious] ENABLE()
guards so that we don't mistakenly compile mouse support on iOS and touch on Mac,
and vice versa. Each of the interaction methods---touch, mouse, keyboard---can be independently
compiled out. If none is supported (i.e., Windows), then we don't even try to compile
platformSimulate*Interaction methods or SimulatedInputDispatcher. This allows WebAutomationSession
to not include members and code that are never going to be used on a particular platform.
This functionality is covered by existing WebDriver test suites that use Element Click command.
Additional tests that explicitly include 'touch' pointerType will be submitted to WPT later.
* UIProcess/Automation/Automation.json: Update comment.
* UIProcess/Automation/SimulatedInputDispatcher.h:
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
- Add appropriate guards for code specific to each interaction type.
- Handle SimulatedInputSourceType::Touch and call out to dispatch events.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::terminate):
(WebKit::WebAutomationSession::willShowJavaScriptDialog):
(WebKit::WebAutomationSession::mouseEventsFlushedForPage):
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
(WebKit::WebAutomationSession::willClosePage):
Add appropriate guards for code specific to each interaction type.
(WebKit::WebAutomationSession::isSimulatingUserInteraction const):
Add new hook so that we can detect when a touch simulation is in progress.
We don't rely on checking WebKit's event queue, so use a flag.
(WebKit::WebAutomationSession::simulateTouchInteraction):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::cancelInteractionSequence):
(WebKit::WebAutomationSession::performInteractionSequence):
- Add appropriate guards for code specific to each interaction type.
- Bail out immediately if a requested interaction type is not supported.
- Shim Touch input type to Mouse if mouse is not supported but touches are.
Nearly all WebDriver tests in the wild will be requesting a 'mouse' pointerType,
so this is necessary for compatibility. It's easier to shim at this level than try
to implement platformSimulateMouseInteraction for iOS because
platformSimulateMouseinteraction does not use a completion handler but the iOS
implementation would require that.
(WebKit::WebAutomationSession::platformSimulateMouseInteraction): Deleted.
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Deleted.
- Remove these stubs. Platform methods of this class are no longer being filled
with stubs on unsupported platforms because we expect the command to fail earlier.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateTouchInteraction):
- Add appropriate guards for code specific to each interaction type.
- Implement new platform method to simulate touches. This uses _WKTouchEventGenerator.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
Add appropriate guards for code specific to each interaction type.
* UIProcess/_WKTouchEventGenerator.h: Added.
* UIProcess/_WKTouchEventGenerator.mm: Added.
(simpleCurveInterpolation):
(calculateNextCurveLocation):
(delayBetweenMove):
(+[_WKTouchEventGenerator sharedTouchEventGenerator]):
(+[_WKTouchEventGenerator nextEventCallbackID]):
(-[_WKTouchEventGenerator init]):
(-[_WKTouchEventGenerator dealloc]):
(-[_WKTouchEventGenerator _createIOHIDEventType:]):
(-[_WKTouchEventGenerator _sendHIDEvent:]):
(-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
(-[_WKTouchEventGenerator _updateTouchPoints:count:]):
(-[_WKTouchEventGenerator touchDownAtPoints:touchCount:]):
(-[_WKTouchEventGenerator touchDown:touchCount:]):
(-[_WKTouchEventGenerator touchDown:]):
(-[_WKTouchEventGenerator liftUpAtPoints:touchCount:]):
(-[_WKTouchEventGenerator liftUp:touchCount:]):
(-[_WKTouchEventGenerator liftUp:]):
(-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
(-[_WKTouchEventGenerator touchDown:completionBlock:]):
(-[_WKTouchEventGenerator liftUp:completionBlock:]):
(-[_WKTouchEventGenerator moveToPoint:duration:completionBlock:]):
(-[_WKTouchEventGenerator receivedHIDEvent:]):
Copied and simplified from HIDEventGenerator in WebKitTestRunner.
* WebKit.xcodeproj/project.pbxproj:
Add _WKTouchEventGenerator.{h,mm} and make it a private header. The client needs to
route received HID events to -receivedHIDEvent: in order to detect when the marker
HID event has been processed (and thus the interaction is completed).
* config.h: Add ENABLE(WEBDRIVER_*_INTERACTIONS) macros here.
2019-01-26 Simon Fraser <simon.fraser@apple.com>
Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
https://bugs.webkit.org/show_bug.cgi?id=193879
Reviewed by Antti Koivisto.
Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::dump):
2019-01-27 Chris Fleizach <cfleizach@apple.com>
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2019-01-26 Simon Fraser <simon.fraser@apple.com>
Allow scrolling tree nodes to exist in a detached state
https://bugs.webkit.org/show_bug.cgi?id=193754
Reviewed by Zalan Bujtas.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
2019-01-25 Tim Horton <timothy_horton@apple.com>
REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
https://bugs.webkit.org/show_bug.cgi?id=193860
<rdar://problem/47535022>
Reviewed by Antti Koivisto.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
Treat provisional load and same document load the same: they already both
unpause the snapshot removal tracker, request render tree size notifications,
but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
and thus would get stuck waiting for RepaintAfterNavigation.
2019-01-25 Ryosuke Niwa <rniwa@webkit.org>
Need a mechanism to override navigator.userAgent
https://bugs.webkit.org/show_bug.cgi?id=193762
<rdar://problem/47504939>
Reviewed by Brent Fulgham.
This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
navigator.userAgent without affecting the user agent string used to send network requests.
Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
WebKit.WebsitePoliciesCustomUserAgents
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
(-[_WKWebsitePolicies customJavaScriptUserAgent]):
2019-01-25 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to edit page settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193813
<rdar://problem/47359510>
Reviewed by Joseph Pecoraro.
* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::isRemote() const): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
(WebKit::RemoteWebInspectorUI::isRemote() const): Added.
2019-01-25 Dean Jackson <dino@apple.com>
REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
https://bugs.webkit.org/show_bug.cgi?id=193831
<rdar://problem/47399263>
Reviewed by Chris Dumez.
A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
a navigation. If the link was cross origin, it was causing a process swap,
which meant that the response defaulted back to a navigation.
The fix is to not cause a PSON when the navigation is a system preview.
* UIProcess/API/APINavigation.h:
(API::Navigation::shouldForceDownload const): This is now just tracking
the "download" attribute, and not including System Preview.
(API::Navigation::isSystemPreview const): New method to check for a
navigation triggered as a System Preview.
* UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
receivedNavigationPolicyDecision, so that downloads and System Previews are
detected before we decide to change process.
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
2019-01-25 Tim Horton <timothy_horton@apple.com>
Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
https://bugs.webkit.org/show_bug.cgi?id=193853
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
There is no reason to scroll/zoom to the find indicator just because the
holes are up, we should only do it on initial indicator presentation.
This was a mistake in r178755 that was previously never exercised because
isShowingOverlay was always false.
2019-01-25 Keith Rollin <krollin@apple.com>
Update Xcode projects with "Check .xcfilelists" build phase
https://bugs.webkit.org/show_bug.cgi?id=193790
<rdar://problem/47201374>
Reviewed by Alex Christensen.
Support for XCBuild includes specifying inputs and outputs to various
Run Script build phases. These inputs and outputs are specified as
.xcfilelist files. Once created, these .xcfilelist files need to be
kept up-to-date. In order to check that they are up-to-date or not,
add an Xcode build step that invokes an external script that performs
the checking. If the .xcfilelists are found to be out-of-date, update
them, halt the build, and instruct the developer to restart the build
with up-to-date files.
At this time, the checking and regenerating is performed only if the
WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
who want to use this facility can set this variable and test out the
checking/regenerating. Once it seems like there are no egregious
issues that upset a developer's workflow, we'll unconditionally enable
this facility.
* Scripts/check-xcfilelists.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
2019-01-25 Alex Christensen <achristensen@webkit.org>
Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
https://bugs.webkit.org/show_bug.cgi?id=193844
Reviewed by Andy Estes.
This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcess):
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
2019-01-25 Keith Rollin <krollin@apple.com>
Update Xcode projects with "Apply Configuration to XCFileLists" build target
https://bugs.webkit.org/show_bug.cgi?id=193781
<rdar://problem/47201153>
Reviewed by Alex Christensen.
Part of generating the .xcfilelists used as part of adopting XCBuild
includes running `make DerivedSources.make` from a standalone script.
It’s important for this invocation to have the same environment as
when the actual build invokes `make DerivedSources.make`. If the
environments are different, then the two invocations will provide
different results. In order to get the same environment in the
standalone script, have the script launch xcodebuild targeting the
"Apply Configuration to XCFileLists" build target, which will then
re-invoke our standalone script. The script is now running again, this
time in an environment with all workspace, project, target, xcconfig
and other environment variables established.
The "Apply Configuration to XCFileLists" build target accomplishes
this task via a small embedded shell script that consists only of:
eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
The process that invokes "Apply Configuration to XCFileLists" first
sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
evaluated and exports it into the shell environment. When xcodebuild
is invoked, it inherits the value of this variable and can `eval` the
contents of that variable. Our external standalone script can then set
WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
of command-line parameters needed to restart itself in the appropriate
state.
* WebKit.xcodeproj/project.pbxproj:
2019-01-25 Alex Christensen <achristensen@webkit.org>
Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
https://bugs.webkit.org/show_bug.cgi?id=193802
<rdar://problem/46010580>
Reviewed by Andy Estes.
* UIProcess/API/APIUIClient.h:
(API::UIClient::didClickGoBackFromSafeBrowsingWarning):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-01-25 Daniel Bates <dabates@apple.com>
[iOS] Pressing Tab key doesn't move to next cell with Google Sheets
https://bugs.webkit.org/show_bug.cgi?id=193048
<rdar://problem/46433836>
Reviewed by Brent Fulgham.
WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
sends key events for these commands to us. This will make the behavior of these key commands when executed
in an editable field match the behavior of these command when executed in a non-editable field since
both code paths will now go through WebCore.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
2019-01-25 Alex Christensen <achristensen@webkit.org>
Fix Linux build.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
2019-01-25 Keith Rollin <krollin@apple.com>
Update WebKitAdditions.xcconfig with correct order of variable definitions
https://bugs.webkit.org/show_bug.cgi?id=193793
<rdar://problem/47532439>
Reviewed by Alex Christensen.
XCBuild changes the way xcconfig variables are evaluated. In short,
all config file assignments are now considered in part of the
evaluation. When using the new build system and an .xcconfig file
contains multiple assignments of the same build setting:
- Later assignments using $(inherited) will inherit from earlier
assignments in the xcconfig file.
- Later assignments not using $(inherited) will take precedence over
earlier assignments. An assignment to a more general setting will
mask an earlier assignment to a less general setting. For example,
an assignment without a condition ('FOO = bar') will completely mask
an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
This affects some of our .xcconfig files, in that sometimes platform-
or sdk-specific definitions appear before the general definitions.
Under the new evaluations rules, the general definitions alway take
effect because they always overwrite the more-specific definitions. The
solution is to swap the order, so that the general definitions are
established first, and then conditionally overwritten by the
more-specific definitions.
* Configurations/BaseTarget.xcconfig:
* Configurations/Version.xcconfig:
* Configurations/WebKit.xcconfig:
2019-01-25 Keith Rollin <krollin@apple.com>
Update existing .xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=193791
<rdar://problem/47201706>
Reviewed by Alex Christensen.
Many .xcfilelist files were added in r238824 in order to support
XCBuild. Update these with recent changes to the set of build files
and with the current generate-xcfilelist script.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* UnifiedSources-input.xcfilelist:
* UnifiedSources-output.xcfilelist:
2019-01-25 Per Arne Vollan <pvollan@apple.com>
[iOS] Deny mach lookups to services not used.
https://bugs.webkit.org/show_bug.cgi?id=193828
Reviewed by Brent Fulgham.
Start denying mach lookups to iOS services, which were previously allowed with reporting.
Living-on has indicated that these services are not used.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-25 Brent Fulgham <bfulgham@apple.com>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>
Reviewed by Alex Christensen.
This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
it off in the UIProcess. It also updates test infrastructure to work with this change
in architecture.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
* Webprocess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
2019-01-25 Ryosuke Niwa <rniwa@webkit.org>
iOS: inputmode="none" disables hardware keyboard's globe key
https://bugs.webkit.org/show_bug.cgi?id=193811
<rdar://problem/47406553>
Reviewed by Wenson Hsieh.
Removed the support for inputmode="none" for now since we need a new SPI from UIKit
to properly implement this feature some time in the future.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView inputView]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView textInputTraits]):
2019-01-25 David Kilzer <ddkilzer@apple.com>
Move soft-linking of Lookup.framework out of LookupSPI.h
<https://webkit.org/b/193815>
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKWindowVisibilityObserver dealloc]):
(-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
- Move soft-linking to LookupSoftLink.{h,mm}.
2019-01-25 Antti Koivisto <antti@apple.com>
REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
https://bugs.webkit.org/show_bug.cgi?id=193818
<rdar://problem/47456584>
Reviewed by Tim Horton.
We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
from a wrong process (the one we are leaving behind).
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):
Don't request immediately, save the threshold to SnapshotRemovalTracker.
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
Do the request to the right process.
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
Ensure we send the notification even if we reached the threshold before it was requested.
(WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
(WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
https://bugs.webkit.org/show_bug.cgi?id=193829
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setDragCaretRect):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didHandleDragStartRequest):
(WebKit::PageClientImpl::didConcludeEditDrag):
(WebKit::PageClientImpl::didChangeDragCaretRect):
(WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
(WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
(WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView setupDragAndDropInteractions]):
(-[WKContentView teardownDragAndDropInteractions]):
(-[WKContentView _didHandleDragStartRequest:]):
(-[WKContentView _didConcludeEditDrag:]):
(-[WKContentView _didChangeDragCaretRect:currentRect:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView setupDataInteractionDelegates]): Deleted.
(-[WKContentView teardownDataInteractionDelegates]): Deleted.
(-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
(-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
(-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didHandleDragStartRequest):
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::didConcludeEditDrag):
(WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
(WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
(WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::didConcludeEditDrag):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDragStart):
(WebKit::WebPage::requestAdditionalItemsForDragSession):
(WebKit::WebPage::didConcludeEditDrag):
(WebKit::WebPage::requestStartDataInteraction): Deleted.
(WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
2019-01-25 Alex Christensen <achristensen@webkit.org>
WKWebView.goBack should reload if there is a safe browsing warning
https://bugs.webkit.org/show_bug.cgi?id=193805
<rdar://problem/46908216>
Reviewed by Geoff Garen.
If a WKWebView is showing a safe browsing warning and the user clicks a back button
in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
so actually going back will appear to the user to go back twice. We can't just do nothing because the
app is in a state where it is expecting a navigation to happen. Reloading achieves what the user expects
and makes the app work like the app expects.
* UIProcess/API/C/WKPage.cpp:
(WKPageGoBack):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView goBack]):
* UIProcess/PageClient.h:
(WebKit::PageClient::hasSafeBrowsingWarning const):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::hasSafeBrowsingWarning const):
2019-01-25 Chris Dumez <cdumez@apple.com>
Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
https://bugs.webkit.org/show_bug.cgi?id=193788
<rdar://problem/47531231>
Reviewed by Alex Christensen.
When the page starts a new provisional load, make sure we cancel any pending one in the provisional
process, as it would have happened in the first provisional load happened in the same process.
Without this, we could have 2 parallel loads happening, one in the committed process and another
in the provisional one, leading to assertion failures in debug.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2019-01-25 Chris Dumez <cdumez@apple.com>
Drop WebKit::WebKitPolicyAction type as it is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=193827
Reviewed by Antti Koivisto.
Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
WebCore::PolicyAction.
* Shared/WebPolicyAction.h: Removed.
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
(WebKit::toPolicyAction): Deleted.
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
2019-01-25 Per Arne Vollan <pvollan@apple.com>
[iOS] Add logging of calls
https://bugs.webkit.org/show_bug.cgi?id=193784
Reviewed by Brent Fulgham.
Add permissive logging of calls on iOS.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-25 Chris Dumez <cdumez@apple.com>
Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
https://bugs.webkit.org/show_bug.cgi?id=193779
<rdar://problem/46170903>
Reviewed by Antti Koivisto.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryAppLink):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
We were crashing when trying to get the URL of the main frame, which was sad because we never
ended up using the main frame URL. Therefore, this patch drops the code in question.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
from the process is related to its main frame.
2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Need a way for JavaScript (or bundle) code to participate in undo
https://bugs.webkit.org/show_bug.cgi?id=190009
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
UndoItem and additionally disconnect the UndoItem from its UndoManager.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addWebUndoStep):
(WebKit::WebPage::removeWebEditCommand):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::invalidate):
2019-01-25 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Add API to add paths to sandbox
https://bugs.webkit.org/show_bug.cgi?id=193571
This allows applications to add paths to the web process
if required by web extensions.
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_add_path_to_sandbox):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
* UIProcess/WebProcessPool.h:
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
2019-01-24 Ryosuke Niwa <rniwa@webkit.org>
iOS: Split keyboard should not shrink visualViewport.height
https://bugs.webkit.org/show_bug.cgi?id=193798
Reviewed by Tim Horton.
Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
No new tests since while it's possible to transition between split and merged keyboard using some SPI,
there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2019-01-24 Eric Carlson <eric.carlson@apple.com>
[iOS] Silence MediaPlayer compile warnings
https://bugs.webkit.org/show_bug.cgi?id=193780
<rdar://problem/47518428>
Reviewed by Jer Noble.
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2019-01-24 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240446.
Casued 5 API failures
Reverted changeset:
"Activate the WebResourceLoadStatisticsStore in the
NetworkProcess and deactivate it in the UIProcess."
https://bugs.webkit.org/show_bug.cgi?id=193297
https://trac.webkit.org/changeset/240446
2019-01-24 Brent Fulgham <bfulgham@apple.com>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>
Reviewed by Alex Christensen.
This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
it off in the UIProcess. It also updates test infrastructure to work with this change
in architecture.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
* Webprocess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
2019-01-24 John Wilander <wilander@apple.com>
Add Ad Click Attribution as an internal/experimental feature
https://bugs.webkit.org/show_bug.cgi?id=193685
<rdar://problem/47450399>
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
2019-01-24 Antti Koivisto <antti@apple.com>
[PSON] Flash on back navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193716
<rdar://problem/47148458>
Reviewed by Chris Dumez.
We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::close):
Track closed state so we don't send the message twice, causing unhandled message errors in web process.
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Close the suspended page if the suspension fails.
Skip this if we are using web process side compositing on Mac.
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
Don't close the page on suspension failure. This is now managed by the UI process.
2019-01-24 Chris Dumez <cdumez@apple.com>
Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
https://bugs.webkit.org/show_bug.cgi?id=193761
<rdar://problem/47456405>
Reviewed by Alex Christensen.
When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
navigate to the expected back/forward list item.
WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
(processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
its constructor like so:
`{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
of subframes could end up as the WebBackForwardListItem's mainframe URL.
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::applyFrameState):
Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
2019-01-24 Ross Kirsling <ross.kirsling@sony.com>
Move FileSystem to WTF
https://bugs.webkit.org/show_bug.cgi?id=193602
Reviewed by Yusuke Suzuki.
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/cache/CacheStorageEngine.cpp:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheData.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
* PluginProcess/unix/PluginProcessMainUnix.cpp:
* Shared/PersistencyUtils.cpp:
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
* Shared/Plugins/unix/PluginSearchPath.cpp:
* Shared/WebMemorySampler.h:
* Shared/glib/ProcessExecutablePathGLib.cpp:
* Shared/ios/ChildProcessIOS.mm:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/SandboxExtensionMac.mm:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
* UIProcess/API/glib/IconDatabase.cpp:
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
* UIProcess/API/glib/WebKitFileChooserRequest.cpp:
* UIProcess/API/glib/WebKitWebContext.cpp:
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
* UIProcess/Cocoa/DownloadClient.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/DeviceIdHashSaltStorage.cpp:
* UIProcess/Downloads/DownloadProxy.cpp:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
* UIProcess/ServiceWorkerProcessProxy.cpp:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
* UIProcess/glib/WebProcessProxyGLib.cpp:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/win/WebProcessPoolWin.cpp:
* UIProcess/win/WebView.cpp:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
* WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
* WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/PluginProcessConnection.cpp:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
* WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
* WebProcess/WebPage/win/WebInspectorUIWin.cpp:
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-01-23 Simon Fraser <simon.fraser@apple.com>
Create "frame hosting" nodes for the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=193753
Reviewed by Antti Koivisto.
When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
require the iframe's scrolling node to get reparented in a new ancestor, which requires
a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
to provide a consistent parent node for the subframe's scrolling node.
This patch adds the node types, but does not instantiate them yet.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
(ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2019-01-23 Ross Kirsling <ross.kirsling@sony.com>
[Curl] Unreviewed build fix for r240292 and friends.
WinCairo test stability must be restored in subsequent patch.
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
(WebKit::NetworkProcess::setNetworkProxySettings):
2019-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r240403.
https://bugs.webkit.org/show_bug.cgi?id=193757
"Causes multiple crashes on macOS port (probably used wrong
ENABLE macro)" (Requested by ddkilzer on #webkit).
Reverted changeset:
"[Curl] Unreviewed build fix for r240292 and friends."
https://trac.webkit.org/changeset/240403
2019-01-23 Ross Kirsling <ross.kirsling@sony.com>
[Curl] Unreviewed build fix for r240292 and friends.
WinCairo test stability must be restored in subsequent patch.
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
(WebKit::NetworkProcess::setNetworkProxySettings):
2019-01-23 Alex Christensen <achristensen@webkit.org>
Stop using NetworkProcess::singleton
https://bugs.webkit.org/show_bug.cgi?id=193700
Reviewed by Don Olmstead.
This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::singleton): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* NetworkProcess/win/NetworkProcessMainWin.cpp:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::initializeChildProcess):
(WebKit::XPCServiceInitializer):
2019-01-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r240343.
Caused 4 PSON API test failures.
Reverted changeset:
"[PSON] Flash on back navigation on Mac"
https://bugs.webkit.org/show_bug.cgi?id=193716
https://trac.webkit.org/changeset/240343
2019-01-23 Chris Dumez <cdumez@apple.com>
Deprecate API to limit the maximum number of WebProcesses
https://bugs.webkit.org/show_bug.cgi?id=193725
<rdar://problem/47464879>
Reviewed by Geoff Garen.
Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
complexity and is not safe (conflicts with PSON).
Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
Note that enabling the single WebProcess mode will disable PSON and process prewarming.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration maximumProcessCount]):
(-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
(-[_WKProcessPoolConfiguration usesSingleWebProcess]):
(-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
(-[_WKProcessPoolConfiguration description]):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_set_web_process_count_limit):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
2019-01-23 Brent Fulgham <bfulgham@apple.com>
Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
https://bugs.webkit.org/show_bug.cgi?id=193659
<rdar://problem/47433290>
Reviewed by Alex Christensen.
Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
consistent, and should reduce the possibility of bookkeeping errors in the message handling
implementations.
Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
(and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
a connection is established to the network process, causing initialization messages to get dropped
leading to test system flakiness.
Finally: The WK API test code was updated to ensure that completion handlers are always called, even
when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
* NetworkProcess/Classifier/StorageAccessStatus.h: Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::removeAllStorageAccess):
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::deleteWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
is now autogenerated.
(WebKit::NetworkProcessProxy::didClose): Ditto.
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
(WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
(WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
(WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
(WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
(WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
causing initialization messages to get dropped.
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setCacheMaxAgeCap):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit.xcodeproj/project.pbxproj:
2019-01-23 Sihui Liu <sihui_liu@apple.com>
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
<rdar://problem/46824999>
Reviewed by Geoffrey Garen.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllIndexedDatabases):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
2019-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
https://bugs.webkit.org/show_bug.cgi?id=193182
<rdar://problem/47452154>
Reviewed by Tim Horton.
Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidBlur]):
2019-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
Minor improvements to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193708
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
(WebKit::NetworkProcess::ensureSession): Add useful assertion.
(WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
(WebKit::NetworkProcess::destroySession): Add useful assertion.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2019-01-23 Daniel Bates <dabates@apple.com>
Fix the Apple Internal build. See <rdar://problem/47486758>.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
2019-01-23 Per Arne Vollan <pvollan@apple.com>
[macOS] Sandbox fails to compile
https://bugs.webkit.org/show_bug.cgi?id=193727
<rdar://problem/47476903>
Reviewed by Brent Fulgham.
Use '(with send-signal SIGKILL)' instead of '(with termination)'.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-23 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
https://bugs.webkit.org/show_bug.cgi?id=193723
<rdar://problem/47476802>
Reviewed by David Kilzer.
The new code added in r240243 could attempt to submit telemetry after the relevant
WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2019-01-23 Antti Koivisto <antti@apple.com>
[PSON] Flash on back navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193716
<rdar://problem/47148458>
Reviewed by Chris Dumez.
We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Remove the suspended page (so closing it on web process side) if the suspension fails.
Skip this if we are using web process side compositing on Mac.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
Don't close the page on suspension failure.
2019-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
https://bugs.webkit.org/show_bug.cgi?id=193706
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:
Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::label const):
(WebKit::WebEditCommandProxy::invalidate):
(WebKit::WebEditCommandProxy::editAction const): Deleted.
Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
(WebKit::WebPageProxy::resetState):
Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
and then iterating over the Vector.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::registerEditCommand):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):
2019-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Remove libsoup cruft from WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193710
Reviewed by Carlos Garcia Campos.
SoupNetworkSession is no longer accessible from the web process because it's owned
(indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
* NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
(AsyncReadData::AsyncReadData):
(webkitSoupRequestInputStreamReadAsyncResultComplete):
(webkitSoupRequestInputStreamPendingReadAsyncComplete):
(webkitSoupRequestInputStreamHasDataToRead):
(webkitSoupRequestInputStreamIsWaitingForData):
(webkitSoupRequestInputStreamReadAsync):
(webkitSoupRequestInputStreamReadFinish):
(webkitSoupRequestInputStreamFinalize):
(webkit_soup_request_input_stream_init):
(webkit_soup_request_input_stream_class_init):
(webkitSoupRequestInputStreamNew):
(webkitSoupRequestInputStreamAddData):
(webkitSoupRequestInputStreamDidFailWithError):
(webkitSoupRequestInputStreamFinished):
* NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):
2019-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Clean up NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=193707
Reviewed by Carlos Garcia Campos.
Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
adapt to NetworkStorageSessions API changes.
* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
(WebKit::LegacyCustomProtocolManager::registerScheme):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged):
(WebKit::NetworkProcess::setNetworkProxySettings):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::soupSession const):
2019-01-23 Philippe Normand <pnormand@igalia.com>
[GTK] Crash when browsing inspector:// uri without port set
https://bugs.webkit.org/show_bug.cgi?id=193721
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
back to caller after setting the error, if no port was provided
along with the inspector URL.
2019-01-23 David Kilzer <ddkilzer@apple.com>
Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
<https://webkit.org/b/193694>
<rdar://problem/47464025>
Reviewed by Tim Horton.
* Shared/ios/WebIconUtilities.mm:
- Switch to using CoreMediaSoftLink.{h,mm} in PAL.
2019-01-22 Chris Dumez <cdumez@apple.com>
Regression(r240178) Some API tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=193680
Reviewed by Alex Christensen.
r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
properly populated in the WebPageCreationParameters. This was needed in case we need to
reconstruct the WebUserContentController on the WebProcess side. However, this caused a
regression in the case we reuse a process where the WebUserContentController still exists
(because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
entries to the existing WebUserContentController instance because its "add" methods did not
have duplicate checks. To address the issue, this patch adds duplicate checks to the
WebUserContentController "add" methods.
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
(WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
(WebKit::WebUserContentController::addUserScriptInternal):
(WebKit::WebUserContentController::removeUserScriptInternal):
(WebKit::WebUserContentController::addUserStyleSheetInternal):
(WebKit::WebUserContentController::removeUserStyleSheetInternal):
(WebKit::WebUserContentController::forEachUserMessageHandler const):
* WebProcess/UserContent/WebUserContentController.h:
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed attempt to fix GTK/WPE bots
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>
Doesn't make sense to clear the storage session right after creating it. This should fix
network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
not having a cookie jar.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
2019-01-22 Megan Gardner <megan_gardner@apple.com>
Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
https://bugs.webkit.org/show_bug.cgi?id=193687
<rdar://problem/47056717>
Reviewed by Tim Horton.
Cancel web gestures when a long press is recognized.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _cancelWebGestureRecognizer]):
(-[WKContentView _longPressRecognized:]):
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix an internal build failure after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
Rubber-stamped by Wenson Hsieh.
* SourcesCocoa.txt:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKMenuTarget forwardContextMenuAction:]):
* WebKit.xcodeproj/project.pbxproj:
It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wunused-but-set-variable warning
https://bugs.webkit.org/show_bug.cgi?id=193660
<rdar://problem/47433602>
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>
Oops.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::defaultStorageSession const):
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>
This builds for libsoup. Doesn't work, but at least builds.
Also, speculative fixes for curl.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::defaultStorageSession const):
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>
Still not working yet.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* UIProcess/API/APIHTTPCookieStore.h:
2019-01-22 Antti Koivisto <antti@apple.com>
[iOS] Flash when swiping back to Google search result page
https://bugs.webkit.org/show_bug.cgi?id=193668
<rdar://problem/47071684>
Reviewed by Simon Fraser.
If the google page is scrolled, there is sometimes a short flash.
When restoring the page state we also restore exposedContentRect which is used to determine
which part of the page to create layers for. Scroll position is restored by the UI process
later so we rely on this to get the right layers for the initial view update.
A viewport configuration update may sometimes trample over the restored exposedContentRect,
moving it to top left. In this case the initial layer tree unfreeze commit may not have
layers to cover the actual visible view position.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
Set a bit to indicate we have already restored the exposedContentRect.
(WebKit::WebPage::viewportConfigurationChanged):
Only reset exposedContentRect if wasn't already set by restorePageState.
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix more builds.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Another build fix after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>
Unreviewed, still not enough to fix soup builds, but closer.
* UIProcess/API/APIHTTPCookieStore.h:
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix some builds after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
2019-01-22 Brian Burg <bburg@apple.com>
Automation.computeElementLayout should return visual viewport-aware coordinates
https://bugs.webkit.org/show_bug.cgi?id=193598
<rdar://problem/35325644>
Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
* Shared/CoordinateSystem.h:
2019-01-22 Alex Christensen <achristensen@webkit.org>
Move NetworkStorageSession ownership to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193580
Reviewed by Geoff Garen.
* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::WebCookieManager):
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteCookiesForHostname):
(WebKit::WebCookieManager::deleteAllCookies):
(WebKit::WebCookieManager::deleteCookie):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::getAllCookies):
(WebKit::WebCookieManager::getCookies):
(WebKit::WebCookieManager::setCookie):
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::startObservingCookieChanges):
(WebKit::WebCookieManager::stopObservingCookieChanges):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::storageSession):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::clearCachedCredentials):
(WebKit::NetworkProcess::switchToNewTestingSession):
(WebKit::NetworkProcess::ensureSession):
(WebKit::NetworkProcess::storageSession const):
(WebKit::NetworkProcess::defaultStorageSession const):
(WebKit::NetworkProcess::forEachNetworkStorageSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::getAllStorageAccessEntries):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::removeAllStorageAccess):
(WebKit::NetworkProcess::removePrevalentDomains):
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::networkStorageSession const):
* NetworkProcess/NetworkStorageSessionProvider.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::makeEntry):
(WebKit::NetworkCache::Cache::makeRedirectEntry):
(WebKit::NetworkCache::Cache::update):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSyncAllCookies):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* SourcesCocoa.txt:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
(API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
(API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
(API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
(API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
(API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
(API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
(API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
(API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
(API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
(API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCachedCredentials):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::clearCachedCredentials): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-01-22 Per Arne Vollan <pvollan@apple.com>
[macOS] Adjust logging policy in WebKit's sandbox
https://bugs.webkit.org/show_bug.cgi?id=193454
Reviewed by Brent Fulgham.
Add a rule to initially deny all calls, since the default is to allow every call.
Later rules allow syscalls that we determined are needed for proper WebKit function.
This reduces the API surface available to attackers.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-22 Daniel Bates <dabates@apple.com>
[iOS] WebKit should handle shift state changes when using the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=191475
<rdar://problem/45949246>
Reviewed by Brent Fulgham.
Implement UIKit SPI to be notified of shift state changes to the software keyboard
and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
key.
A side benefit of this change is that we now show and hide the caps lock indicator
in a focused password field when caps lock is enabled or disabled using the software
keyboard, respectively.
* Platform/spi/ios/UIKitSPI.h: Expose more SPI.
* SourcesCocoa.txt:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
web event based on the state change and dispatch it.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
was a synethic flags change event so that we do not notify UIKit about this event
as it does not know anything about such synthetic events.
* UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
* UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
(-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
(-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
(-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
* WebKit.xcodeproj/project.pbxproj:
2019-01-22 Daniel Bates <dabates@apple.com>
[iOS] Interpret text key commands on keydown and app key commands on keypress
https://bugs.webkit.org/show_bug.cgi?id=192897
<rdar://problem/46857378>
Reviewed by Brent Fulgham.
Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
is false) and keypress (isCharEvent is true), respectively.
* Platform/spi/ios/UIKitSPI.h: Add more SPI.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
2019-01-22 David Kilzer <ddkilzer@apple.com>
C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
<https://webkit.org/b/193607>
<rdar://problem/47334613>
Reviewed by Alex Christensen.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection):
* UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
- Update name of constants.
* Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
* Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
- Put constant values in a namespace, and move values to
ClientCertificateAuthenticationXPCConstants.cpp.
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
- Add ClientCertificateAuthenticationXPCConstants.cpp.
2019-01-22 David Kilzer <ddkilzer@apple.com>
Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
<https://webkit.org/b/193654>
<rdar://problem/47430290>
Reviewed by Alex Christensen.
- Moves QuickLookSoftLink.{h,mm} to PAL.
- Adds soft-link to 3 classes to consolidate QuickLook.framework
soft-linking.
- Updates existing source to work with above changes.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
(WebKit::SystemPreviewController::start):
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
- Switch to using QuickLookSoftLink.{h,mm} in PAL.
2019-01-22 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Reviewed by Simon Fraser and Antti Koivisto.
Add a CSSLogicalEnabled runtime flag.
* Shared/WebPreferences.yaml:
2019-01-22 Frederic Wang <fwang@igalia.com>
Enable CSSOMViewScrollingAPI
https://bugs.webkit.org/show_bug.cgi?id=189472
Reviewed by Simon Fraser.
This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
enabled in tests since r235855. Basically, this change fixes an old compatibility issue
regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
document.body while Gecko/Edge/Chromium use document.documentElement as described in the
CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
for that purpose, so that they work independently of whether the option is enabled.
[1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
* Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
accordance with the new policy. Instead, keep an internal flag only for developers.
2019-01-21 Antti Koivisto <antti@apple.com>
[iOS] Handle hit testing for subframes
https://bugs.webkit.org/show_bug.cgi?id=192303
Reviewed by Frédéric Wang.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Only set delegatesScrolling for the main frame.
2019-01-21 Brent Fulgham <bfulgham@apple.com>
Unreviewed test fix after r240243
Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
<rdar://problem/47433602>
The new ResourceLoadStatistics section of 'removeData' was incrementing the
pending callback count before deciding whether to send a message to delete
data. This left the count out-of-balance leading to the operation never
completing.
This patch also prevents sending a second message to the NetworkProcess
requesting data be deleted if the message was already sent in an earlier
section of the method (e.g., as typically happens when all website data
is being deleted).
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
2019-01-21 Brent Fulgham <bfulgham@apple.com>
Implement message handlers for NetworkProcess-based ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=193556
<rdar://problem/47368501>
Reviewed by Alex Christensen.
This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
observations are being handled in the NetworkProcess, rather than the UIProcess. The
original versions of these methods will be removed as part of Bug 193303.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
(WebKit::ResourceLoadStatisticsMemoryStore::store const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
(WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::submitTopList):
(WebKit::submitTopLists):
(WebKit::notifyPages):
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
(WebKit::nonEphemeralWebPageProxy): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::dumpResourceLoadStatistics):
(WebKit::NetworkProcess::isGrandfathered):
(WebKit::NetworkProcess::isPrevalentResource):
(WebKit::NetworkProcess::isVeryPrevalentResource):
(WebKit::NetworkProcess::setGrandfathered):
(WebKit::NetworkProcess::setPrevalentResource):
(WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcess::setVeryPrevalentResource):
(WebKit::NetworkProcess::clearPrevalentResource):
(WebKit::NetworkProcess::submitTelemetry):
(WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
(WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcess::resetParametersToDefaultValues):
(WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcess::setLastSeen):
(WebKit::NetworkProcess::hasStorageAccess):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::logUserInteraction):
(WebKit::NetworkProcess::hadUserInteraction):
(WebKit::NetworkProcess::clearUserInteraction):
(WebKit::NetworkProcess::setGrandfatheringTime):
(WebKit::NetworkProcess::setMaxStatisticsEntries):
(WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::NetworkProcess::setPruneEntriesDownTo):
(WebKit::NetworkProcess::setTimeToLiveUserInteraction):
(WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
(WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::filterForTopLevelDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
(WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
(WebKit::NetworkSession::logDiagnosticMessageWithValue):
(WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
(WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreDumpResourceLoadStatistics):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
(WKWebsiteDataStoreStatisticsSubmitTelemetry):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearCallbackStates):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::nonEphemeralWebPageProxy):
(WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
(WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
(WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::didUpdateBlockCookies):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isPrevalentResourceResult):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
(WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
(WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
(WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::didHaveUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
(WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
(WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::didIsGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::storageAccessRequestResult):
(WebKit::NetworkProcessProxy::storageAccessOperationResult):
(WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
(WebKit::NetworkProcessProxy::setGrandfatheringTime):
(WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
(WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
(WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
(WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
(WebKit::NetworkProcessProxy::submitTelemetry):
(WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
(WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
(WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
(WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
(WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
(WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::nonEphemeralWebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
(WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setCacheMaxAgeCap):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::resetParametersToDefaultValues):
(WebKit::WebsiteDataStore::submitTelemetry):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
(WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
(WebKit::WebsiteDataStore::grantStorageAccessHandler):
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
(WebKit::WebsiteDataStore::removePrevalentDomains):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::isGrandfathered):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::webPageWasAdded):
(WebKit::WebsiteDataStore::webPageWasInvalidated):
(WebKit::WebsiteDataStore::webProcessWillOpenConnection):
(WebKit::WebsiteDataStore::webPageWillOpenConnection):
(WebKit::WebsiteDataStore::webPageDidCloseConnection):
(WebKit::WebsiteDataStore::webProcessDidCloseConnection):
(WebKit::WebsiteDataStore::isAssociatedProcessPool const):
(WebKit::WebsiteDataStore::processPools const):
(WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
(WebKit::WebsiteDataStore::logTestingEvent):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setStatisticsTestingCallback):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2019-01-15 Darin Adler <darin@apple.com>
Use references rather than pointers for register/unregister functions, and more
https://bugs.webkit.org/show_bug.cgi?id=175028
Reviewed by Daniel Bates.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
functions in Document; pass a reference.
(WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
(WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
(WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
(WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::~PluginView): Ditto.
(WebKit::PluginView::initializePlugin): Ditto.
2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wreturn-type warning
https://bugs.webkit.org/show_bug.cgi?id=193333
<rdar://problem/45649489>
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::toProtocol):
2019-01-20 chris fleizach <cfleizach@apple.com>
AX: Support returning relative frames for accessibility
https://bugs.webkit.org/show_bug.cgi?id=193414
<rdar://problem/47268501>
Reviewed by Zalan Bujtas.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView accessibilityAttributeValue:forParameter:]):
(-[WKWebView IGNORE_WARNINGS_END]):
* UIProcess/API/mac/WKView.mm:
(-[WKView accessibilityAttributeValue:forParameter:]):
(-[WKView IGNORE_WARNINGS_END]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::accessibilityAttributeValue):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r240209.
Broke GTK/WPE injected bundle
Reverted changeset:
"AX: Support returning relative frames for accessibility"
https://bugs.webkit.org/show_bug.cgi?id=193414
https://trac.webkit.org/changeset/240209
2019-01-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
<rdar://problem/40591038>
Reviewed by Sam Weinig.
* Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
HIToolbox header.
* UIProcess/Cocoa/WebViewImpl.mm: Ditto.
* UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
* UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
header.
* WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
PDFKit header.
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
* WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
2019-01-20 chris fleizach <cfleizach@apple.com>
AX: Support returning relative frames for accessibility
https://bugs.webkit.org/show_bug.cgi?id=193414
<rdar://problem/47268501>
Reviewed by Zalan Bujtas.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView accessibilityAttributeValue:forParameter:]):
(-[WKWebView IGNORE_WARNINGS_END]):
* UIProcess/API/mac/WKView.mm:
(-[WKView accessibilityAttributeValue:forParameter:]):
(-[WKView IGNORE_WARNINGS_END]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::accessibilityAttributeValue):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2019-01-20 Antoine Quint <graouts@apple.com>
Add a POINTER_EVENTS feature flag
https://bugs.webkit.org/show_bug.cgi?id=193577
<rdar://problem/47408511>
Unreviewed. Also enable Pointer Events for iosmac.
* Configurations/FeatureDefines.xcconfig:
2019-01-19 David Kilzer <ddkilzer@apple.com>
Follow-up: iOS: Updating input mode should update the software keyboard
<https://bugs.webkit.org/show_bug.cgi?id=193565>
<rdar://problem/47376334>
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
Debug builds after r240199 by downcasting `element` to
`HTMLElement` before calling canonicalInputMode().
2019-01-19 David Kilzer <ddkilzer@apple.com>
Sort WebKit Xcode project file
* WebKit.xcodeproj/project.pbxproj:
2019-01-19 Antoine Quint <graouts@apple.com>
Add a POINTER_EVENTS feature flag
https://bugs.webkit.org/show_bug.cgi?id=193577
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
2019-01-18 Ryosuke Niwa <rniwa@webkit.org>
iOS: Updating input mode should update the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=193565
<rdar://problem/47376334>
Reviewed by Wenson Hsieh.
Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
* Scripts/webkit/messages.py:
* Shared/WebCoreArgumentCoders.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::focusedElementDidChangeInputMode):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didUpdateInputMode:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::focusedElementDidChangeInputMode):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::focusedElementDidChangeInputMode):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedElementDidChangeInputMode):
* WebProcess/WebPage/WebPage.h:
2019-01-18 Tim Horton <timothy_horton@apple.com>
Adjust WKDrawingView protocol method name
https://bugs.webkit.org/show_bug.cgi?id=193604
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView canvasViewDrawingDidChange:]):
(-[WKDrawingView drawingDidChange:]): Deleted.
2019-01-18 David Kilzer <ddkilzer@apple.com>
[WebKit] Change Xcode folders to map to folders on disk
* WebKit.xcodeproj/project.pbxproj: Update these folders:
- Shared/Authentication
- Shared/Authentication/cocoa
2019-01-18 Brian Burg <bburg@apple.com>
Automation.computeElementLayout should return visual viewport-aware coordinates
https://bugs.webkit.org/show_bug.cgi?id=193598
<rdar://problem/35325644>
Reviewed by Simon Fraser.
Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
But I think that it's a mistake for safaridriver to care about VisualViewport
being enabled or not, because it is a runtime-switchable setting.
This patch removes CoordinateSystem::VisualViewport. Make the existing
CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
This is tested by WebDriver element clicking tests. There should not be any
difference in behavior until it is possible to zoom with gestures via WebDriver.
* Shared/CoordinateSystem.h:
* UIProcess/Automation/Automation.json:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::protocolStringToCoordinateSystem):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
2019-01-18 Daniel Bates <dabates@apple.com>
Fix some build issues.
Include missing header WKDrawingCoordinator.
* UIProcess/ios/WKInkPickerView.mm:
2019-01-18 Tim Horton <timothy_horton@apple.com>
Get rid of ADVANCED_SPELL_CHECKING
https://bugs.webkit.org/show_bug.cgi?id=193592
Reviewed by Wenson Hsieh.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
(WebKit::WebViewImpl::insertText):
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::getGuessesForWord):
2019-01-18 Chris Dumez <cdumez@apple.com>
Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
https://bugs.webkit.org/show_bug.cgi?id=193588
<rdar://problem/47131566>
Reviewed by Alex Christensen.
When the WebPageProxy needs to create initialization parameters for its WebPage in the
WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
register the WebProcessProxy with the WebUserContentControllerProxy and adding the
contentRuleLists to the WebPageCreationParameters. The issue is that if the
WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
early and not populate the WebPageCreationParameters.
In PSON world, when navigating back to a page that failed to enter page cache, we reuse
the process where we previously loaded the page but re-create a new WebPage on the
WebContent process site. When this happens, WebUserContentControllerProxy would not
add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
previously-suspended process would be missing them.
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
2019-01-18 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
2019-01-18 Antti Koivisto <antti@apple.com>
Implement asynchronous frame scrolling for iOS
https://bugs.webkit.org/show_bug.cgi?id=193539
<rdar://problem/47379873>
Reviewed by Simon Fraser.
Add a scrolling node type that can handle UIScrollView backed frames.
It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
* WebKit.xcodeproj/project.pbxproj:
2019-01-18 Chris Dumez <cdumez@apple.com>
Regression(PSON) Scroll position is not always restored properly when navigating back
https://bugs.webkit.org/show_bug.cgi?id=193578
<rdar://problem/47386331>
Reviewed by Tim Horton.
Fix issues causing the scroll position to not be restored at all (or incorrectly) when
navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
snapshot really stays up until we've restored the scroll position.
Note that even after those changes, I can still sometimes reproduce a white flash when
swiping back to Google search results (scroll position being correct now). This is
tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
* Shared/SessionState.cpp:
(WebKit::FrameState::encode const):
(WebKit::FrameState::decode):
* Shared/SessionState.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
properly restore the scrollPosition (position was 70px off on my iPad without this).
With PSON enabled, if you swipe back cross-process and the previous page was not put
into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
in the process since the UIProcess never knew about it.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
Drop logic that was causing the ViewGestureController to not wait for the scroll position
to be restored before taking down the snapshot, when UI-side compositing is enabled.
If you look at the comment above the code, you'll see that the code in question was meant
to impact only the non-UI side compositing code path. As a matter of fact, when the code
was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
#if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
would have often restored the scroll position by the time the load is finished so it would
not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
do on process-swap, the first post-scroll restoration layer tree commit may now occur a
little bit later and we would lose the race more often.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateBackForwardItem):
* UIProcess/WebProcessProxy.h:
When adding PageCache support to PSON, we used to navigate the "suspended" page to
about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
in particular with regards to the scroll position and the pageScaleFactor. So if you
swiped and then quickly enough did a cross-site navigation, the UIProcess'
WebBackForwardList would not get updated with the latest scroll position and we would
thus fail to restore it later on. To address the issue, we now stop ignoring updates
from the old WebProcess after a swap. This logic is no longer needed since we no longer
navigate the old page to about:blank after a swap, we merely suspend it "in place".
2019-01-18 Wenson Hsieh <wenson_hsieh@apple.com>
Remove some last vestiges of assisted node terminology in WebKit
https://bugs.webkit.org/show_bug.cgi?id=193572
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView _showKeyboard]):
(-[WKContentView _hideKeyboard]):
Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView updateCurrentFocusedElementInformation:]):
(-[WKContentView _startAssistingKeyboard]): Deleted.
(-[WKContentView _stopAssistingKeyboard]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
2019-01-18 Youenn Fablet <youenn@apple.com>
Add a new SPI to request for cache storage quota increase
https://bugs.webkit.org/show_bug.cgi?id=193323
Reviewed by Alex Christensen.
Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
The current SPI is currently CacheStorage specific but future work should
make it so that other storage like IDB use the same mechanism.
By default, quota remains unchanged if delegate is not implemented.
* NetworkProcess/NetworkProcess.cpp:
* UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
(-[WKWebsiteDataStore _quotaDelegate]):
(-[WKWebsiteDataStore set_quotaDelegate:]):
* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestCacheStorageSpace):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::quotaManager):
(WebKit::WebsiteDataStore::setQuotaManager):
* UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
(WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
(WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
* WebKit.xcodeproj/project.pbxproj:
2019-01-18 Philippe Normand <pnormand@igalia.com>
[WPE] Add Qt extension
https://bugs.webkit.org/show_bug.cgi?id=191464
Reviewed by Carlos Garcia Campos.
This new extension is a QML plugin embedding a WPE ViewBackend
implementation. It provides a public API very similar to Qt's
WebView module. It comes with a simple mini-browser implemented in
QML.
QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
compositors) and EGLFS QPAs.
* PlatformWPE.cmake:
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
(WPEQmlExtensionPlugin::registerTypes):
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
* UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
(WPEQtView::WPEQtView):
(WPEQtView::~WPEQtView):
(WPEQtView::geometryChanged):
(WPEQtView::configureWindow):
(WPEQtView::createOffscreen):
(WPEQtView::backendCreated):
(WPEQtView::notifyUrlChangedCallback):
(WPEQtView::notifyTitleChangedCallback):
(WPEQtView::notifyLoadProgressCallback):
(WPEQtView::notifyLoadChangedCallback):
(WPEQtView::notifyLoadFailedCallback):
(WPEQtView::updatePaintNode):
(WPEQtView::url const):
(WPEQtView::setUrl):
(WPEQtView::loadProgress const):
(WPEQtView::title const):
(WPEQtView::canGoBack const):
(WPEQtView::isLoading const):
(WPEQtView::canGoForward const):
(WPEQtView::goBack):
(WPEQtView::goForward):
(WPEQtView::reload):
(WPEQtView::stop):
(WPEQtView::loadHtml):
(WPEQtView::jsAsyncReadyCallback):
(WPEQtView::handleJsResult):
(WPEQtView::runJavaScript):
(WPEQtView::mousePressEvent):
(WPEQtView::mouseReleaseEvent):
(WPEQtView::hoverEnterEvent):
(WPEQtView::hoverLeaveEvent):
(WPEQtView::hoverMoveEvent):
(WPEQtView::wheelEvent):
(WPEQtView::keyPressEvent):
(WPEQtView::keyReleaseEvent):
(WPEQtView::touchEvent):
* UIProcess/API/wpe/qt/WPEQtView.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
(configureCallback):
(WPEQtViewBackend::WPEQtViewBackend):
(WPEQtViewBackend::~WPEQtViewBackend):
(WPEQtViewBackend::configureGlibEglDisplay):
(WPEQtViewBackend::configureEglDisplay):
(WPEQtViewBackend::initialize):
(WPEQtViewBackend::backend const):
(WPEQtViewBackend::resize):
(WPEQtViewBackend::getTexture):
(WPEQtViewBackend::initSurface):
(WPEQtViewBackend::displayImage):
(WPEQtViewBackend::modifiers const):
(WPEQtViewBackend::dispatchHoverEnterEvent):
(WPEQtViewBackend::dispatchHoverLeaveEvent):
(WPEQtViewBackend::dispatchHoverMoveEvent):
(WPEQtViewBackend::dispatchMousePressEvent):
(WPEQtViewBackend::dispatchMouseReleaseEvent):
(WPEQtViewBackend::dispatchWheelEvent):
(WPEQtViewBackend::dispatchKeyEvent):
(WPEQtViewBackend::dispatchTouchEvent):
* UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
(WPEQtViewLoadRequest::WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::url const):
(WPEQtViewLoadRequest::status const):
(WPEQtViewLoadRequest::errorString const):
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
(WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
(WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
* UIProcess/API/wpe/qt/qmldir: Added.
2019-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
https://bugs.webkit.org/show_bug.cgi?id=193494
<rdar://problem/46859627>
Reviewed by Simon Fraser and Tim Horton.
Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
surrounding the unobscured content rect. See WebCore ChangeLog for more details.
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::contentInsets const):
(WebKit::operator==):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _computedObscuredInset]):
(-[WKWebView _computedContentInset]):
(-[WKWebView _computedUnobscuredSafeAreaInset]):
We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
target checks to simply `PLATFORM(IOS)`.
(-[WKWebView _updateVisibleContentRects]):
Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
content coordinates.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(floatBoxExtent):
Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
Update the Page's content insets.
2019-01-17 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240124.
This commit broke an internal build.
Reverted changeset:
"SDK_VARIANT build destinations should be separate from non-
SDK_VARIANT builds"
https://bugs.webkit.org/show_bug.cgi?id=189553
https://trac.webkit.org/changeset/240124
2019-01-17 John Wilander <wilander@apple.com>
Add infrastructure to enable/disable ITP Debug Mode through Preferences
https://bugs.webkit.org/show_bug.cgi?id=193510
<rdar://problem/47330969>
Reviewed by Dean Jackson.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
These functions are now suited for runtime switching of ITP Debug Mode.
* Shared/WebPreferences.yaml:
Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setItpDebugModeEnabled:]):
(-[WKPreferences _itpDebugModeEnabled]):
New private preferences functions.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
Removed support for old experimental user default. Added a new one that's
not connected to any UI, i.e. merely for command line debugging where
ITP Debug Mode needs to be on all the time.
2019-01-17 Tim Horton <timothy_horton@apple.com>
Adopt NSTextCheckingSuppressInitialCapitalizationKey
https://bugs.webkit.org/show_bug.cgi?id=193545
Reviewed by Dean Jackson.
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::getGuessesForWord):
2019-01-17 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
2019-01-16 Dean Jackson <dino@apple.com>
(iPad) Link tapping is sluggish on many sites
https://bugs.webkit.org/show_bug.cgi?id=193522
<rdar://problem/47102987>
Reviewed by Wenson Hsieh.
Some WKWebView clients might set the initial zoom scale of the page to
something other than 1, which disables the "fast tap" behaviour.
The fix is very simple -- just check against the initial scale rather
than 1.
The most likely regression from this would be pages designed for desktop,
but provide a viewport tag saying width=device-width and initial-scale.
They might stop allowing double-tap-to-zoom.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
2019-01-17 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession::storageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193529
Reviewed by Tim Horton.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::create):
(WebKit::NetworkSocketStream::NetworkSocketStream):
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/NetworkStorageSessionProvider.h: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::WebCookieJar):
* WebProcess/WebPage/WebCookieJar.h:
2019-01-16 Youenn Fablet <youenn@apple.com>
Add a new SPI for controlling getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=192793
Reviewed by Eric Carlson.
Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
In particular:
- The hash salt should be handled by WebKit not by apps using WebKit.
- No need to expose the frame URL, only the top level origin is needed.
- The names of the callback are changed to improve the intent of these callbacks.
Addressed these by creating a new SPI which will replace the current one.
The current SPI will be removed later on.
Did some refactoring by making the callbacks not return false.
Instead, implement the default behavior inside the request objects as deny methods.
Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
* UIProcess/API/APIUIClient.h:
(API::UIClient::decidePolicyForUserMediaPermissionRequest):
(API::UIClient::checkUserMediaPermissionForOrigin):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaCaptureState]):
(-[WKWebView _setMediaCaptureMuted:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
* UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::requestUserMediaAuthorizationForFrame):
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
(WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
* UIProcess/UserMediaPermissionCheckProxy.h:
(WebKit::UserMediaPermissionCheckProxy::deny):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
* UIProcess/UserMediaPermissionRequestProxy.h:
2019-01-16 Youenn Fablet <youenn@apple.com>
Pipe cache quota request from Network Process to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=193296
Reviewed by Alex Christensen.
When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
No record will be put until the quota request is answered.
The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
NetworkProcess then sends it to NetworkProcessProxy.
Currently NetworkProcessProxy just answers by keeping the quota as it is.
In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
make a decision on the quota. This will allow prompting user to bump it as done for other data.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestCacheStorageSpace):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::~Engine):
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::Engine):
(WebKit::CacheStorage::Engine::requestSpace):
(WebKit::CacheStorage::Engine::requestSpaceCompleted):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::put):
(WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
* NetworkProcess/cache/CacheStorageEngineCache.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
(WebKit::CacheStorage::Caches::isRequestingSpace const):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestCacheStorageSpace):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
2019-01-16 Alex Christensen <achristensen@webkit.org>
sendBeacon to previously-unvisited https domain always fails
https://bugs.webkit.org/show_bug.cgi?id=193508
Reviewed by Geoffrey Garen.
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveChallenge):
If a ping load is doing a TLS handshake, continue if the server has good certificates.
2019-01-16 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
https://bugs.webkit.org/show_bug.cgi?id=189097
<rdar://problem/43856423>
Reviewed by Alex Christensen.
In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
* NetworkProcess/NetworkResourceLoader.h:
2019-01-16 Alex Christensen <achristensen@webkit.org>
Revert r239938
https://bugs.webkit.org/show_bug.cgi?id=193267
<rdar://problem/47297304>
* Configurations/WebContent-iOS.entitlements:
2019-01-16 Chris Dumez <cdumez@apple.com>
Regression(r240046) Several API tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=193509
Reviewed by Geoffrey Garen.
The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
our process reference.
To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
our process stays alive.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didPerformClientRedirect):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
(WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::startURLSchemeTask):
(WebKit::ProvisionalPageProxy::backForwardGoToItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::willSubmitForm):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformClientRedirectShared):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::printFrame):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::learnWord):
(WebKit::WebPageProxy::ignoreWord):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::focusedFrameChanged):
(WebKit::WebPageProxy::frameSetLargestFrameChanged):
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::stopURLSchemeTask):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
* UIProcess/WebPageProxy.h:
2019-01-16 Chris Dumez <cdumez@apple.com>
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>
Reviewed by Geoffrey Garen.
The issue tracked by rdar://problem/47099573 is that a provisional load may get
canceled (or converted into a download) *after* we've decided to process-swap.
In such cases, the view should keep displaying the current site and it should
still be interactive. However, with the previous PSON model, the view (pageProxy)
would have already swapped to the new process and would end up displaying the
initially empty document.
To address the issue, this patch introduces the concept of a provisional load
in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
provisional page until after the load was committed in the new process. This means
that the view / WebPageProxy keeps using the old process and displays the current
content until a load has committed in the provisional page. If no load commits
in the provisional process (e.g. because the load is cancelled or converted into
a download), then we merely destroy the ProvisionalPageProxy and terminate its
process, without impacting the WebPageProxy.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
delay attaching the drawing area in case of a process-swap, no matter what
now that the previous process is kept alive until the provisional load is
committed in the new process.
* Shared/WebPolicyAction.h:
Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
process-swap, we now tell the previous process to simply ignore the load, while
we create a ProvisionalPageProxy to do the new load in a new process.
Suspension of the previous page in the old process, happens later, when a load
is actually committed in the new process.
* Sources.txt:
Add new ProvisionalPageProxy file.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcessAndResetState]):
When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
process and the provisional one, to maintain previous behavior in our API tests.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
(WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
(WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
* UIProcess/AcceleratedDrawingAreaProxy.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createDrawingAreaProxy):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::~DrawingAreaProxy):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::process):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::update):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _createDrawingAreaProxy:]):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
(WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/PageClientImpl.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Pass the drawing area's associated process when constructing it and store it as a member
in addition to the page. This is necessary now that a page can be associated with 2
WebProcesses at a time, each having its own drawing area.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
Pass the process.
* UIProcess/ProvisionalPageProxy.cpp: Added.
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::processDidTerminate):
(WebKit::ProvisionalPageProxy::takeDrawingArea):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::processDidFinishLaunching):
(WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didPerformClientRedirect):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
(WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
(WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::startURLSchemeTask):
(WebKit::ProvisionalPageProxy::backForwardGoToItem):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h: Added.
(WebKit::ProvisionalPageProxy::page):
(WebKit::ProvisionalPageProxy::mainFrame const):
(WebKit::ProvisionalPageProxy::process):
(WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
(WebKit::ProvisionalPageProxy::navigationID const):
(WebKit::ProvisionalPageProxy::drawingArea const):
New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
the provisional process.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
which tries to register itself as an IPC message receiver for the same pageID when
a process-swap occurs and we're switching to a suspended page.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::isMainFrame const):
WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
m_mainFrame to maintain previous behavior.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::provisionalDrawingArea const):
Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
(WebKit::WebPageProxy::swapToWebProcess):
swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
to initialize some data members such as the drawing area and the main frame as it is transferring them over from
the ProvisionalPageProxy which started the provisional load.
(WebKit::WebPageProxy::finishAttachingToWebProcess):
We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.
(WebKit::WebPageProxy::setDrawingArea):
(WebKit::WebPageProxy::initializeWebPage):
- We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.
- Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::stopLoading):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
Suspension now happens later, only if we end up committing the provisional load in the new process.
Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
to happen a bit later but it is clearer if we do this as early as possible I think.
(WebKit::WebPageProxy::commitProvisionalPage):
When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
- Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
- Suspending the current page.
- Letting the client know the load is comitted
- Destroy the ProvisionalPageProxy.
This work used to happen earlier in continueNavigationInNewProcess().
(WebKit::WebPageProxy::continueNavigationInNewProcess):
Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
without actually having the WebPageProxy switch to the new process yet.
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didCreateWindow):
Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
(WebKit::WebPageProxy::didDestroyNavigation):
On process-swap, when telling the previous process to ignore the load and starting the new load in a new
ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
the call since the navigation is merely taken over by the ProvisionalPageProxy.
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
Moved some PSON logic to the ProvisionalPageProxy instead.
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::willSubmitForm):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformClientRedirectShared):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::printFrame):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::learnWord):
(WebKit::WebPageProxy::ignoreWord):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::focusedFrameChanged):
(WebKit::WebPageProxy::frameSetLargestFrameChanged):
(WebKit::WebPageProxy::provisionalProcessDidTerminate):
Cancel the provisiona load and destroy the ProvisionalPageProxy if
the provisional process crashes.
(WebKit::WebPageProxy::resetState):
Drop some code that is no longer needed.
(WebKit::WebPageProxy::creationParameters):
- Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
more than one call site. This was just some bad factoring.
- Take the process in parameter now that we page can be associated with several processes at a time.
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::stopURLSchemeTask):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
(WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
(WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::visitedLinkStore):
(WebKit::WebPageProxy::provisionalPageProxy const):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::updateBackForwardItem):
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::canTerminateChildProcess):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::addProvisionalPageProxy):
(WebKit::WebProcessProxy::removeProvisionalPageProxy):
Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
associated with this process yet, because it is still a ProvisionalPageProxy.
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::create):
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
(WebKit::WebURLSchemeTask::didPerformRedirection):
(WebKit::WebURLSchemeTask::didReceiveResponse):
(WebKit::WebURLSchemeTask::didReceiveData):
(WebKit::WebURLSchemeTask::didComplete):
(WebKit::WebURLSchemeTask::pageDestroyed):
* UIProcess/WebURLSchemeTask.h:
Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
associated with the page in case of process swap.
* WebKit.xcodeproj/project.pbxproj:
Add ProvisionalPageProxy class.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didReceivePolicyDecision):
Stop dealing with WebPolicyAction::Suspend as it no longer exists.
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::setIsSuspended):
Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
setIsSuspended(true) IPC is sent when we actually commit the provisional page.
* WebProcess/WebPage/WebPage.h:
2019-01-16 Tim Horton <timothy_horton@apple.com>
Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>
Reviewed by Zalan Bujtas.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
Adjust the null-check a bit; Zalan pointed out that the layout could
be responsible for the Frame/RenderView going away, so we should bail
*after* layout, not before.
2019-01-15 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed WinCairo build fix.
* WebProcess/WebPage/WebPageInspectorTargetController.cpp:
(WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
(WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
(WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
2019-01-15 Alex Christensen <achristensen@webkit.org>
Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193368
Reviewed by Geoff Garen.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):
2019-01-15 Alex Christensen <achristensen@webkit.org>
Remove more NetworkProcess::singleton use
https://bugs.webkit.org/show_bug.cgi?id=193484
Reviewed by Geoffrey Garen.
This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
one NetworkProcess object. To make it work well enough until we remove LegacyCustomProtocolManager,
use the last NetworkProcess object that has been created.
* NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
(newestNetworkProcess):
(LegacyCustomProtocolManager::networkProcessCreated):
(+[WKCustomProtocol canInitWithRequest:]):
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
(-[WKCustomProtocol startLoading]):
(-[WKCustomProtocol stopLoading]):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
(WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
(WebKit::LegacyCustomProtocolManager::startLoading):
(WebKit::LegacyCustomProtocolManager::stopLoading):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
2019-01-15 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r240014
https://bugs.webkit.org/show_bug.cgi?id=161106
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2019-01-15 Ryosuke Niwa <rniwa@webkit.org>
VisualViewport API should be updated upon opening of keyboard
https://bugs.webkit.org/show_bug.cgi?id=193475
Reviewed by Simon Fraser.
The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
while the keyboard is getting brought up.
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::operator==):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
2019-01-15 Megan Gardner <megan_gardner@apple.com>
Add Reveal support in iOSMac
https://bugs.webkit.org/show_bug.cgi?id=193408
<rdar://problem/47300699>
Reviewed by Tim Horton.
Add calls to DictionaryLookup from the appropriate places.
* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didPerformDictionaryLookup):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
2019-01-15 Claudio Saavedra <csaavedra@igalia.com>
[SOUP] Remove usage of NetworkProcess::singleton()
https://bugs.webkit.org/show_bug.cgi?id=193444
Reviewed by Michael Catanzaro.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::download):
(WebKit::NetworkDataTaskSoup::didWriteDownload):
(WebKit::NetworkDataTaskSoup::didFinishDownload):
(WebKit::NetworkDataTaskSoup::didFailDownload):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
2019-01-15 Eric Carlson <eric.carlson@apple.com>
Fix incorrect ASSERT added in r239840
https://bugs.webkit.org/show_bug.cgi?id=193466
<rdar://problem/47095142>
Reviewed by Youenn Fablet.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
2019-01-15 Tim Horton <timothy_horton@apple.com>
Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>
Reviewed by Beth Dakin.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
I'm not sure why this got *worse*, but we should null-check RenderView.
It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
the next time we paint (which will surely happen if we gain a RenderView).
2019-01-15 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r239993, r239995, r239997, and
r239999.
Caused assertions under
ViewGestureController::disconnectFromProcess()
Reverted changesets:
"Regression(PSON) View becomes blank after click a cross-site
download link"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239993
"Unreviewed iOS build fix after r239993."
https://trac.webkit.org/changeset/239995
"Fix iOS build after r239993"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239997
"Unreviewed, revert part of r239997 as it is not needed to fix
the build."
https://trac.webkit.org/changeset/239999
2019-01-15 Alex Christensen <achristensen@webkit.org>
Stop using CookiesStrategy
https://bugs.webkit.org/show_bug.cgi?id=161106
Reviewed by Don Olmstead and Antti Koivisto.
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
* NetworkProcess/NetworkProcessPlatformStrategies.h:
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
* Scripts/webkit/messages.py:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::cookiesForURL):
(WebKit::PluginView::setCookiesForURL):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
(WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebKit::WebPlatformStrategies::getRawCookies): Deleted.
(WebKit::WebPlatformStrategies::deleteCookie): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebPage/WebCookieJar.cpp: Added.
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
(WebKit::WebCookieJar::deleteCookie):
* WebProcess/WebPage/WebCookieJar.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2019-01-15 Per Arne Vollan <pvollan@apple.com>
Remove reporting for iOS mach lookups confirmed in-use
https://bugs.webkit.org/show_bug.cgi?id=193455
<rdar://problem/47259551>
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-15 Tim Horton <timothy_horton@apple.com>
Cannot tab out of WKWebView on macOS
https://bugs.webkit.org/show_bug.cgi?id=161448
<rdar://problem/28100085>
Reviewed by Dean Jackson.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::takeFocus):
If the UIDelegate doesn't implement takeFocus, provide a simple default
implementation that just uses AppKit's key view loop to move the focus.
* UIProcess/API/APIUIClient.h:
(API::UIClient::takeFocus):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::takeFocus):
Make API::UIClient's takeFocus return a bool indicating whether the
client implements it or not.
* UIProcess/PageClient.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::takeFocus):
Plumb takeFocus to WebViewImpl.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
Borrow the relevant portion of WebKitLegacy's implementation of takeFocus,
shifting focus to the next/previous key view in the window.
2019-01-15 Youenn Fablet <youenn@apple.com>
Remove the specific handling of ephemeral sessions from CacheStorage::Engine::from
https://bugs.webkit.org/show_bug.cgi?id=193400
Reviewed by Alex Christensen.
It is no longer needed as we correctly handle ephemeral sessions removal.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::from):
2019-01-15 Alex Christensen <achristensen@webkit.org>
Fix iOS build after r239993
https://bugs.webkit.org/show_bug.cgi?id=193361
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/SuspendedPageProxy.h:
2019-01-15 Per Arne Vollan <pvollan@apple.com>
[macOS] Adjust logging policy in WebKit's sandbox
https://bugs.webkit.org/show_bug.cgi?id=193454
<rdar://problem/47256325>
Reviewed by Brent Fulgham.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-15 Chris Dumez <cdumez@apple.com>
Unreviewed iOS build fix after r239993.
* UIProcess/SuspendedPageProxy.h:
2019-01-15 Per Arne Vollan <pvollan@apple.com>
Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
https://bugs.webkit.org/show_bug.cgi?id=193453
<rdar://problem/47268166>
Reviewed by Brent Fulgham.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-15 Chris Dumez <cdumez@apple.com>
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>
Reviewed by Geoff Garen.
The issue tracked by rdar://problem/47099573 is that a provisional load may get
canceled (or converted into a download) *after* we've decided to process-swap.
In such cases, the view should keep displaying the current site and it should
still be interactive. However, with the previous PSON model, the view (pageProxy)
would have already swapped to the new process and would end up displaying the
initially empty document.
To address the issue, this patch introduces the concept of a provisional load
in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
provisional page until after the load was committed in the new process. This means
that the view / WebPageProxy keeps using the old process and displays the current
content until a load has committed in the provisional page. If no load commits
in the provisional process (e.g. because the load is cancelled or converted into
a download), then we merely destroy the ProvisionalPageProxy and terminate its
process, without impacting the WebPageProxy.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
delay attaching the drawing area in case of a process-swap, no matter what
now that the previous process is kept alive until the provisional load is
committed in the new process.
* Shared/WebPolicyAction.h:
Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
process-swap, we now tell the previous process to simply ignore the load, while
we create a ProvisionalPageProxy to do the new load in a new process.
Suspension of the previous page in the old process, happens later, when a load
is actually committed in the new process.
* Sources.txt:
Add new ProvisionalPageProxy file.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcessAndResetState]):
When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
process and the provisional one, to maintain previous behavior in our API tests.
* UIProcess/PageClient.h:
Tiny build fix.
* UIProcess/ProvisionalPageProxy.cpp: Added.
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::takeDrawingArea):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::loadDataWithNavigation):
(WebKit::ProvisionalPageProxy::loadRequestWithNavigation):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h: Added.
(WebKit::ProvisionalPageProxy::page):
(WebKit::ProvisionalPageProxy::mainFrame const):
(WebKit::ProvisionalPageProxy::process):
(WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
(WebKit::ProvisionalPageProxy::navigationID const):
Add new ProvisionalPageProxy class to wrap the provisional load in the new process
after a swap. The provisional page is owned by the WebPageProxy and we only commit
the provisional page when the load is committed. Until then, the WebPageProxy keeps
using the old process and displaying the current content.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
which tries to register itself as an IPC message receiver for the same pageID when
a process-swap occurs and we're switching to a suspended page.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::isMainFrame const):
WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
m_mainFrame to maintain previous behavior.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
to initialize some data members such as the drawing area and the main frame as it is transferring them over from
the ProvisionalPageProxy which started the provisional load.
(WebKit::WebPageProxy::finishAttachingToWebProcess):
We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.
(WebKit::WebPageProxy::initializeWebPage):
- We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.
- Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
(WebKit::WebPageProxy::loadRequestWithNavigation):
Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
Suspension now happens later, only if we end up committing the provisional load in the new process.
Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
to happen a bit later but it is clearer if we do this as early as possible I think.
(WebKit::WebPageProxy::commitProvisionalPage):
When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
- Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
- Suspending the current page.
- Letting the client know the load is comitted
- Destroy the ProvisionalPageProxy.
This work used to happen earlier in continueNavigationInNewProcess().
(WebKit::WebPageProxy::continueNavigationInNewProcess):
Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
without actually having the WebPageProxy switch to the new process yet.
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateWindow):
Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
(WebKit::WebPageProxy::didDestroyNavigation):
On process-swap, when telling the previous process to ignore the load and starting the new load in a new
ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
the call since the navigation is merely taken over by the ProvisionalPageProxy.
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
Moved some PSON logic to the ProvisionalPageProxy instead.
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForResponse):
Capture the process in the lambda, to make sure we send the policy decision to the same process that
asked for it, so as to not get confused by process swaps.
(WebKit::WebPageProxy::resetState):
Drop some code that is no longer needed.
(WebKit::WebPageProxy::creationParameters):
Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
more than one call site. This was just some bad factoring.
(WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride):
(WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::temporarilyOverrideProcess):
Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when
the ProvisionalPageProxy interacts with the WebPageProxy.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::updateBackForwardItem):
Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
associated with this process yet, because it is still a ProvisionalPageProxy.
(WebKit::WebProcessProxy::canTerminateChildProcess):
Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it.
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::addProvisionalPageProxy):
(WebKit::WebProcessProxy::removeProvisionalPageProxy):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
Stop dealing with WebPolicyAction::Suspend as it no longer exists.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didReceivePolicyDecision):
(WebKit::WebPage::setIsSuspended):
Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
setIsSuspended(true) IPC is sent when we actually commit the provisional page.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2019-01-15 Brian Burg <bburg@apple.com>
WebDriver: update Create Window implementation to support newest specification
https://bugs.webkit.org/show_bug.cgi?id=193333
<rdar://problem/45649489>
Reviewed by Carlos Garcia Campos.
Spec link: https://w3c.github.io/webdriver/#create-window
The command as specified returns a value indicating whether the new browsing context
was presented as a new tab or new window. Add a new delegate method to query the current
'presentation' of the browsing context. The presentation can change over time due to
things such as screen orientation, so the value that is returned by the command only
reflects how the browsing context was initially presented to the user.
This is covered by existing WPT and internal tests. More will be added when Selenium
exposes this command in its various bindings.
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Add new SPI delegate method to query the 'presentation' (tab or window) for an automated WKWebView.
* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::currentPresentationOfPage):
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::toImpl):
(WebKit::AutomationSessionClient::currentPresentationOfPage):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::toProtocol):
(WebKit::WebAutomationSession::createBrowsingContext):
Add plumbing between ObjC delegate and C++.
* UIProcess/Automation/Automation.json:
Include the initial presentation in the createBrowsingContext command result.
2019-01-14 Alex Christensen <achristensen@webkit.org>
Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=193429
Reviewed by Joseph Pecoraro.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::makeEntry):
(WebKit::NetworkCache::Cache::makeRedirectEntry):
(WebKit::NetworkCache::Cache::update):
2019-01-14 Tim Horton <timothy_horton@apple.com>
Fix a style mistake in PageClientImplMac
* UIProcess/mac/PageClientImplMac.h:
Somehow these methods ended up above the members.
2019-01-14 Per Arne Vollan <pvollan@apple.com>
[macOS] Remove reporting for mach lookups confirmed in-use
https://bugs.webkit.org/show_bug.cgi?id=193415
<rdar://problem/47266542>
Reviewed by Brent Fulgham.
Also, start denying the services which have not been confirmed to be in use.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239901, r239909, r239910, r239912,
r239913, and r239914.
https://bugs.webkit.org/show_bug.cgi?id=193407
These revisions caused an internal failure (Requested by
Truitt on #webkit).
Reverted changesets:
"[Cocoa] Avoid importing directly from subumbrella frameworks"
https://bugs.webkit.org/show_bug.cgi?id=186016
https://trac.webkit.org/changeset/239901
"Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
https://trac.webkit.org/changeset/239909
"Tried to fix the build."
https://trac.webkit.org/changeset/239910
"Fixed iOS builds after r239910."
https://trac.webkit.org/changeset/239912
"More build fixing."
https://trac.webkit.org/changeset/239913
"Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
https://trac.webkit.org/changeset/239914
2019-01-14 Mark Lam <mark.lam@apple.com>
Re-enable ability to build --cloop builds.
https://bugs.webkit.org/show_bug.cgi?id=192955
<rdar://problem/46882363>
Reviewed by Saam barati and Keith Miller.
* Configurations/FeatureDefines.xcconfig:
2019-01-14 Alex Christensen <achristensen@webkit.org>
Remove unused networking entitlement from iOS WebProcess entitlements
https://bugs.webkit.org/show_bug.cgi?id=193267
Reviewed by Dean Jackson.
* Configurations/WebContent-iOS.entitlements:
This gave access to VPN stuff. It's not needed any more.
2019-01-14 Youenn Fablet <youenn@apple.com>
Enable MDNS ICE candidate support by default
https://bugs.webkit.org/show_bug.cgi?id=193358
Reviewed by Geoffrey Garen.
* Shared/WebPreferences.yaml:
2019-01-11 Matt Rajca <mrajca@apple.com>
Expose preference for site-specific quirks on iOS
https://bugs.webkit.org/show_bug.cgi?id=193353
Reviewed by Dean Jackson.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setNeedsSiteSpecificQuirks:]):
(-[WKPreferences _needsSiteSpecificQuirks]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-01-14 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Expose SPI to access the current sentence boundary and selection state
https://bugs.webkit.org/show_bug.cgi?id=193398
<rdar://problem/45893108>
Reviewed by Dean Jackson.
Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
far, this only includes whether the selection is a caret or a range, and whether or not the start of the
selection is at the start of a new sentence.
Test: EditorStateTests.ObserveSelectionAttributeChanges
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.
* UIProcess/API/Cocoa/WKWebView.mm:
(selectionAttributes):
(-[WKWebView _didChangeEditorState]):
(-[WKWebView _selectionAttributes]):
Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
whenever the selection attributes change.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
2019-01-14 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
* gtk/NEWS: Add release notes for 2.23.3.
2019-01-13 Dan Bernstein <mitz@apple.com>
Fixed iOS builds after r239910.
* Platform/spi/ios/PDFKitSPI.h:
2019-01-13 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* Platform/spi/ios/PDFKitSPI.h:
2019-01-13 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
Patch by Keith Rollin.
* Platform/IPC/mac/ConnectionMac.mm:
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::launchServicesCheckIn):
2019-01-12 Timothy Hatcher <timothy@apple.com>
Have prefers-color-scheme: light always match on macOS versions before Mojave.
https://bugs.webkit.org/show_bug.cgi?id=191655
rdar://problem/46074680
Reviewed by Megan Gardner.
* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsDark):
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
2019-01-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
<rdar://problem/40591038>
Reviewed by Sam Weinig.
* Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
HIToolbox header.
* UIProcess/Cocoa/WebViewImpl.mm: Ditto.
* UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
* UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
header.
* WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
PDFKit header.
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
* WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
2019-01-11 Ryosuke Niwa <rniwa@webkit.org>
Enable visual viewport API by default
https://bugs.webkit.org/show_bug.cgi?id=193376
Reviewed by Simon Fraser.
Enable this feature by default since the remaining issue on iOS is mostly about test failures,
not an issue with the core functionality of the API.
* Shared/WebPreferences.yaml:
2019-01-11 Brent Fulgham <bfulgham@apple.com>
Allow WebContent process access to some drawing-related IOKit properties
https://bugs.webkit.org/show_bug.cgi?id=193086
<rdar://problem/46568088>
Reviewed by Eric Carlson.
Add one missing IOKit property, and revise the regexp used for another.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-11 John Wilander <wilander@apple.com>
Compile out Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=193370
<rdar://problem/45388584>
Reviewed by Brent Fulgham.
* Configurations/FeatureDefines.xcconfig:
Defined ENABLE_WEB_API_STATISTICS, off by default.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
Skipped encoding of web API statistics.
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
Skipped decoding of web API statistics.
2019-01-11 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak WebIDBConnectionToClient for retain cycle
https://bugs.webkit.org/show_bug.cgi?id=193097
<rdar://problem/46899601>
Reviewed by Brady Eidson.
Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break
the cycle.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2019-01-11 Sihui Liu <sihui_liu@apple.com>
Make "Disable Web SQL" on by default
https://bugs.webkit.org/show_bug.cgi?id=193354
<rdar://problem/46524584>
Reviewed by Geoffrey Garen.
* Shared/WebPreferences.yaml:
2019-01-11 Devin Rousso <drousso@apple.com>
Fix style CFNetworkSPI style checker warnings from r239698
https://bugs.webkit.org/show_bug.cgi?id=193369
Reviewed by Joseph Pecoraro.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Precision drop state thrashes when dragging near the top edge of an editable element
https://bugs.webkit.org/show_bug.cgi?id=193364
<rdar://problem/47214117>
Reviewed by Tim Horton.
On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance
either upwards or downwards from the actual location of the user's finger. When dragging over an editable
element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an
editable element, what happens is that the hit-testing location is offset to a location outside of the editable
element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes
the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and
the cycle continues.
In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the
highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text
form control, use the form control as the editable element instead).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragCaretEditableElementRect const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:sessionDidUpdate:]):
Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect.
Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum
distance to the content view's coordinate space by dividing by the content scale factor.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
2019-01-11 Tim Horton <timothy_horton@apple.com>
REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
https://bugs.webkit.org/show_bug.cgi?id=193366
<rdar://problem/46097212>
Reviewed by Simon Fraser.
A pair of unrelated changes broke Firefox's use of WKWebView internals
to override the long-press menu. Maintain binary compatibility by
introducing linked-on-or-after checks.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
Because gestures are very stateful, we always swap them out when swapping
processes (changing that behavior is fairly risky). Also, we don't always
inform the client when we swap processes (only when the process actually crashes),
so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
Synchronously install gesture recognizers under -init when linked against
an SDK before the version that introduces lazy gesture recognizer installation.
r237331 is an optimization that made us lazily install gestures when the
view is parented, but Firefox (and potentially other clients) depend
on them being installed synchronously in order to find and override them.
2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=193109
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
Add a new SPI configuration flag to enable the UndoManager API. This is off by default.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setUndoManagerAPIEnabled:]):
(-[WKWebViewConfiguration _undoManagerAPIEnabled]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2019-01-10 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Change the nonce in the CTAP kInit command to weak random values
https://bugs.webkit.org/show_bug.cgi?id=192061
<rdar://problem/46471091>
Reviewed by Chris Dumez.
Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
for being a probabilistically unique global identifier for hand shakes, instead of
preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.
The patch also removes all logging when debugging the test case flakiness.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::deviceAdded):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::Worker::write):
(WebKit::CtapHidDriver::Worker::read):
(WebKit::CtapHidDriver::Worker::returnMessage):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::continueAfterResponseReceived):
2019-01-10 Timothy Hatcher <timothy@apple.com>
Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
https://bugs.webkit.org/show_bug.cgi?id=193327
rdar://problem/47093222
Reviewed by Tim Horton.
Tests: WebKit.ForceLightAppearanceInBundle API Test
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance): Added.
(WKBundlePageIsUsingDarkAppearance): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2019-01-10 Eric Carlson <eric.carlson@apple.com>
DeviceID hash salt manager can be NULL
https://bugs.webkit.org/show_bug.cgi?id=193334
<rdar://problem/47179650>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
(WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
(WebKit::WebsiteDataStore::removeData): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.
2019-01-10 Per Arne Vollan <pvollan@apple.com>
[macOS] Add name of IORegistry key in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=193335
<rdar://problem/47184951>
Reviewed by Alexey Proskuryakov.
The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
Also, the property IOGVAHEVCEncodeCapabilities needs to be added.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-10 Zalan Bujtas <zalan@apple.com>
REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
https://bugs.webkit.org/show_bug.cgi?id=193294
<rdar://problem/46006678>
Reviewed by Simon Fraser.
Input type elements should always paint tap highlight (ignore size heuristic).
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didGetTapHighlightGeometries):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didGetTapHighlightGeometries):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
2019-01-10 Alexey Proskuryakov <ap@apple.com>
Remove unneeded XPCService variant for plugin service
https://bugs.webkit.org/show_bug.cgi?id=193326
Reviewed by Tim Horton.
* Configurations/PluginService.32.xcconfig: Removed.
* Configurations/PluginService.64.xcconfig:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
* WebKit.xcodeproj/project.pbxproj:
2019-01-10 Eric Carlson <eric.carlson@apple.com>
Define page media state flags for display capture.
https://bugs.webkit.org/show_bug.cgi?id=193230
<rdar://problem/47095142>
Reviewed by Youenn Fablet.
* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState):
* UIProcess/API/C/WKPagePrivate.h:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):
2019-01-10 Alex Christensen <achristensen@webkit.org>
REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
https://bugs.webkit.org/show_bug.cgi?id=193325
Reviewed by Joseph Pecoraro.
InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
This functionality is only used for testing, so it's no big deal to revert that part of the patch.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
* WebProcess/WebProcess.h:
2019-01-10 Per Arne Vollan <pvollan@apple.com>
[macOS] Add name of IORegistry key in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=193324
Reviewed by Brent Fulgham.
IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-10 John Wilander <wilander@apple.com>
Override the session configuration for cookieAcceptPolicy
https://bugs.webkit.org/show_bug.cgi?id=190925
<rdar://problem/45497382>
Reviewed by Alexey Proskuryakov and Alex Christensen.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.
2019-01-09 Matt Rajca <mrajca@apple.com>
Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
https://bugs.webkit.org/show_bug.cgi?id=193301
Reviewed by Jer Noble.
Register a new quirk that can be configured per-load for per-document media
autoplay behaviors.
* Shared/WebsiteAutoplayQuirk.h:
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesSetAllowedAutoplayQuirks):
(WKWebsitePoliciesGetAllowedAutoplayQuirks):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
(-[_WKWebsitePolicies allowedAutoplayQuirks]):
2019-01-10 Tim Horton <timothy_horton@apple.com>
Rename some entitlements files to be more clear about their target platform
https://bugs.webkit.org/show_bug.cgi?id=193311
Reviewed by Alexey Proskuryakov.
* Configurations/Network-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/Network-iOS-minimalsimulator.entitlements.
* Configurations/NetworkService.xcconfig:
* Configurations/WebContent-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/WebContent-iOS-minimalsimulator.entitlements.
* Configurations/WebContentService.xcconfig:
* WebKit.xcodeproj/project.pbxproj:
2019-01-09 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r239816.
Although EWS had no problem with the patch, I'm seeing build errors on the actual bots.
This patch corrects the problem.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::logFrameNavigation):
(WebKit::NetworkProcess::logUserInteraction):
2019-01-09 Brent Fulgham <bfulgham@apple.com>
Create a WebResourceLoadStatisticsStore attached to the NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=193261
<rdar://problem/47158616>
Reviewed by Alex Christensen.
This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore
object. This object is only created if the ResourceLoadStatistics feature is turned on.
The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed
with an owning NetworkSession as an alternative to the current practice of using a
WebsiteDataStore object.
Two initial messages from the WebContent process are added (logFrameNavigation and
logUserNavigation) that notify the network process of these actions. Currently they
are called in addition the calls to the WebsiteDataStore object. These redundant calls
will be removed in a future patch.
This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by
default, so there should be no change in behavior with this patch.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::logFrameNavigation):
(WebKit::NetworkProcess::logUserInteraction):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::enableResourceLoadStatistics):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::resourceLoadStatistics const):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didLogUserInteraction):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebsiteDataStore::parameters):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::logFrameNavigation):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
2019-01-09 Alex Christensen <achristensen@webkit.org>
Replace SessionTracker with HashMap member of NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193266
Reviewed by Joseph Pecoraro.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::clearCachedCredentials):
(WebKit::NetworkProcess::networkSession):
(WebKit::NetworkProcess::setSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::preconnectTo):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
(WebKit::NetworkResourceLoader::shouldLogCookieInformation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(WebKit::logCookieInformationInternal):
(WebKit::NetworkResourceLoader::logCookieInformation):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::loadRequest):
* NetworkProcess/PingLoad.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::PreconnectTask):
* NetworkProcess/PreconnectTask.h:
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/SessionTracker.cpp: Removed.
* Shared/SessionTracker.h: Removed.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/Network/WebLoaderStrategy.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-01-09 Alex Christensen <achristensen@webkit.org>
Expand use of sourceApplicationAuditData
https://bugs.webkit.org/show_bug.cgi?id=192995
<rdar://problem/46627875>
Reviewed by Brady Eidson.
sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
The NetworkProcess needed an additional entitlement on Mac to continue to load anything, which is desirable.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::sourceApplicationAuditData const):
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::getAuditToken):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::sourceApplicationAuditData const):
2019-01-09 Brent Fulgham <bfulgham@apple.com>
[iOS] Update sandbox profile to use iconservices instead of lsdiconservice
https://bugs.webkit.org/show_bug.cgi?id=193115
<rdar://problem/44867379>
Reviewed by Eric Carlson.
Add access to the 'com.apple.iconservices' endpoint. We will remove access to
the older name ('com.apple.lsdiconservices') once existing clients have completed
the switch.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-09 Antti Koivisto <antti@apple.com>
[PSON] Flash of blank content while transitioning from page A to page B.
https://bugs.webkit.org/show_bug.cgi?id=193283
Reviewed by Chris Dumez.
Layer tree is not frozen during WebPage construction. If the flush timer (started for the initial
empty document) manages to run before the actual page load starts, we'll get a flash.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Rename shouldDelayAttachingDrawingArea bit to isSwapFromSuspended and make it available on all platforms.
* UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Removed.
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Removed.
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Removed.
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Removed.
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Removed.
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
Freeze the layer tree in WebPage constructor if this is a swap from a suspended process.
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didCompletePageTransition):
Unfreeze on first non-initial empty document page transition.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2019-01-09 Chris Dumez <cdumez@apple.com>
WebKit Networking process crashes if the HTTPSUpgradeList is not found in the bundle
https://bugs.webkit.org/show_bug.cgi?id=193285
<rdar://problem/47147610>
Reviewed by Geoffrey Garen.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::networkHTTPSUpgradeCheckerDatabasePath):
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2019-01-09 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Add missing autocleanups
https://bugs.webkit.org/show_bug.cgi?id=193068
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/WebKitAutocleanups.h:
2019-01-08 Alex Christensen <achristensen@webkit.org>
Fix CompletionHandler assertions introduced today.
https://bugs.webkit.org/show_bug.cgi?id=193237
This reverts part of r239710 and all of r239725, r239738, and r239748 which unsuccessfully tried to fix all the assertions.
This code is a mess that will have to be cleaned up later.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::from):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::remove):
(WebKit::NetworkCache::Cache::traverse):
(WebKit::NetworkCache::Cache::clear):
(WebKit::NetworkCache::Cache::retrieveData):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::store):
2019-01-08 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 6.
Add some additional temporary logging info to determine if data is actually sent.
Once the bug is determined and fixed, we should remove all logging added in this patch.
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
2019-01-08 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support U2F HID Authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=191535
<rdar://problem/47102027>
Reviewed by Brent Fulgham.
This patch implements the support for U2F authenticators, and enables it for hid devices.
It follows the CTAP spec to map WebAuthN requests to U2F commands and return the responses:
https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
Most of the parts are done before this patch, this patch focues on: 7.2.2 and 7.3.2.
Besides implementing the U2fHidAuthenticator, this patch also adds support in the mocking
environment for U2F authenticators. It is done by extending the stages in MockHidConnection
from 4 to indefinite as multi-round communications are expected to map WebAuthN requests
to U2F requests.
* Sources.txt:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::continueAddDeviceAfterGetInfo):
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
* UIProcess/WebAuthentication/fido/CtapHidDriver.h:
(WebKit::CtapHidDriver::setProtocol):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp: Added.
(WebKit::U2fHidAuthenticator::U2fHidAuthenticator):
(WebKit::U2fHidAuthenticator::makeCredential):
(WebKit::U2fHidAuthenticator::checkExcludeList):
(WebKit::U2fHidAuthenticator::issueRegisterCommand):
(WebKit::U2fHidAuthenticator::getAssertion):
(WebKit::U2fHidAuthenticator::issueSignCommand):
(WebKit::U2fHidAuthenticator::issueNewCommand):
(WebKit::U2fHidAuthenticator::issueCommand):
(WebKit::U2fHidAuthenticator::responseReceived):
(WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):
(WebKit::U2fHidAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
(WebKit::U2fHidAuthenticator::continueBogusCommandAfterResponseReceived):
(WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h: Added.
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
* UIProcess/WebAuthentication/Mock/MockHidConnection.h:
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* WebKit.xcodeproj/project.pbxproj:
2019-01-08 Youenn Fablet <youenn@apple.com>
service worker fetch handler results in bad referrer
https://bugs.webkit.org/show_bug.cgi?id=188248
<rdar://problem/47050478>
Reviewed by Alex Christensen.
NetworkDataTaskCocoa is sometimes updating the referrer on its own.
Instead of updating the referrer when sending the request to WebProcess for evaluation,
Update the referrer once the web process decides to follow the redirection.
This ensures that any referrer that the WebProcess will set will be updated by NetworkDataTaskCocoa.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Fix more assertions after r239710
https://bugs.webkit.org/show_bug.cgi?id=193237
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::store):
Make default parameter an empty lambda instead of a null CompletionHandler.
This way it can be called once instead of thinking it has already been called.
2019-01-08 Brent Fulgham <bfulgham@apple.com>
Move ResourceLoadStatistics files from UIProcess to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193252
<rdar://problem/47125401>
Reviewed by Alex Christensen.
This patch is the first part of a refactoring to move the ResourceLoadStatistics logic from the UIProcess to the NetworkProcess.
This patch moves code into different folders and adjusts necessary build files, but does not change where the code executes. These
changes have no impact on behavior or test results.
I also modified a few files to add missing include files uncovered by the unified build system.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h.
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp.
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.h.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h.
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.cpp.
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.h.
* NetworkProcess/Downloads/PendingDownload.cpp:
* NetworkProcess/Downloads/PendingDownload.h:
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:
* Shared/PersistencyUtils.cpp: Renamed from Source/WebKit/UIProcess/PersistencyUtils.cpp.
* Shared/PersistencyUtils.h: Renamed from Source/WebKit/UIProcess/PersistencyUtils.h.
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Add missing WebKit:: scope.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Add missing include.
* UIProcess/WebDataListSuggestionsDropdown.cpp: Ditto.
* UIProcess/mac/DisplayLink.cpp:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
2019-01-08 Chris Dumez <cdumez@apple.com>
Mark SuspendedPageProxy as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=193248
Reviewed by Alex Christensen.
* UIProcess/SuspendedPageProxy.h:
2019-01-08 Chris Dumez <cdumez@apple.com>
Prevent cross-site top-level navigations from third-party iframes
https://bugs.webkit.org/show_bug.cgi?id=193076
<rdar://problem/36074736>
Reviewed by Alex Christensen.
Add experimental feature flag, on by default.
* Shared/WebPreferences.yaml:
2019-01-08 Alex Christensen <achristensen@webkit.org>
Remove more use of NetworkProcess::singleton
https://bugs.webkit.org/show_bug.cgi?id=193244
Reviewed by Brent Fulgham.
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing):
* NetworkProcess/NetworkContentRuleListManager.cpp:
(WebKit::NetworkContentRuleListManager::NetworkContentRuleListManager):
(WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
* NetworkProcess/NetworkContentRuleListManager.h:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkContentRuleListManager):
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* NetworkProcess/PingLoad.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2019-01-08 Alex Christensen <achristensen@webkit.org>
Stop using NetworkProcess::singleton in NetworkCache code
https://bugs.webkit.org/show_bug.cgi?id=193243
Reviewed by Brent Fulgham.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::open):
(WebKit::NetworkCache::Cache::Cache):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::networkProcess):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
(WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve const):
(WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordRetrievalRequest):
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
(WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::retrieveFromMemory):
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Call CompletionHandler when destroying a NetworkCache::Storage::WriteOperation
https://bugs.webkit.org/show_bug.cgi?id=193251
Reviewed by Chris Dumez.
This fixes another assertion introduced in r239710.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193236
Reviewed by Don Olmstead.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
(WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSessionID):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::fetchWebsiteData):
(WebKit::WebProcess::addWebsiteDataStore): Deleted.
(WebKit::WebProcess::destroySession): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-01-08 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence -Wformat warnings
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
(WebKit::NetworkHTTPSUpgradeChecker::query):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r239727.
Broke API tests
Reverted changeset:
"Stop using NetworkStorageSession in WebProcess"
https://bugs.webkit.org/show_bug.cgi?id=193236
https://trac.webkit.org/changeset/239727
2019-01-08 Brian Burg <bburg@apple.com>
Remove WKPageRef-based SPI in _WKAutomationSessionDelegate
https://bugs.webkit.org/show_bug.cgi?id=193202
<rdar://problem/37408718>
Reviewed by Alex Christensen.
This code is no longer used, it should be deleted.
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
(WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
(WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
Clean up the delegate bridging methods now that only one delegate implementation is possible.
2019-01-08 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Remove DConf permissions from sandbox
https://bugs.webkit.org/show_bug.cgi?id=193021
Reviewed by Michael Catanzaro.
The latest development releases of xdg-desktop-portal and gtk3 use a
new portal for settings on Wayland org.freedesktop.portal.Settings.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193236
Reviewed by Don Olmstead.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
(WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSessionID):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::fetchWebsiteData):
(WebKit::WebProcess::addWebsiteDataStore): Deleted.
(WebKit::WebProcess::destroySession): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-01-08 Alex Christensen <achristensen@webkit.org>
Always call CompletionHandler in Cache::store
https://bugs.webkit.org/show_bug.cgi?id=193237
Reviewed by Chris Dumez.
No change in behavior. This just fixes an assertion introduced in r239710 when the speculative loader finishes.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2019-01-08 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.2 release
* gtk/NEWS: Add release notes for 2.23.2.
2019-01-07 Chris Dumez <cdumez@apple.com>
Cannot scoll for 5 seconds after swiping back on quoteunquoteapps.com
https://bugs.webkit.org/show_bug.cgi?id=193215
<rdar://problem/45108222>
Reviewed by Tim Horton.
When doing the history navigation, if the source and destination history
items are clones then we will not trigger a main frame load. We may
however trigger loads in subframes if needed. This was an issue for the
ViewGestureController because it was expecting a main frame load after
calling WebPageProxy::goToBackForwardItem() in order to determine when
taking down the view snapshot is appropriate.
To address the problem, the ViewGestureController now takes the snapshot
down as soon as the swipe gesture ends when the source and destination
items are clones.
* Shared/WebBackForwardListItem.cpp:
(WebKit::childItemWithTarget):
(WebKit::WebBackForwardListItem::itemIsInSameDocument const):
(WebKit::hasSameFrames):
(WebKit::WebBackForwardListItem::itemIsClone):
* Shared/WebBackForwardListItem.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):
2019-01-07 David Kilzer <ddkilzer@apple.com>
Leak of ScrollCompletionCallbackData (16 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193222>
<rdar://problem/46862309>
Reviewed by Joseph Pecoraro.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback): Change
to return true if callback will be called, else false.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
(WKBundlePageRegisterScrollOperationCompletionCallback): Change
to return `bool` value to denote whether callback will be called
(true) or not called (false).
2019-01-07 Alex Christensen <achristensen@webkit.org>
Remove use of NetworkProcess::singleton from CacheStorage::Engine::from
https://bugs.webkit.org/show_bug.cgi?id=193220
Reviewed by Andy Estes.
This required passing the NetworkProcess& in from all its callers.
While I was at it, I made them use CompletionHandlers where appropriate.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::findCacheEngine):
(WebKit::NetworkProcess::ensureCacheEngine):
(WebKit::NetworkProcess::removeCacheEngine):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::destroyEngine):
(WebKit::CacheStorage::Engine::fetchEntries):
(WebKit::CacheStorage::Engine::open):
(WebKit::CacheStorage::Engine::remove):
(WebKit::CacheStorage::Engine::retrieveCaches):
(WebKit::CacheStorage::Engine::retrieveRecords):
(WebKit::CacheStorage::Engine::putRecords):
(WebKit::CacheStorage::Engine::deleteMatchingRecords):
(WebKit::CacheStorage::Engine::lock):
(WebKit::CacheStorage::Engine::unlock):
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
(WebKit::CacheStorage::Engine::representation):
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
(WebKit::CacheStorage::globalEngineMap): Deleted.
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):
(WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
(WebKit::CacheStorageEngineConnection::engineRepresentation):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::remove):
(WebKit::NetworkCache::Cache::traverse):
(WebKit::NetworkCache::Cache::clear):
(WebKit::NetworkCache::Cache::retrieveData):
* NetworkProcess/cache/NetworkCache.h:
2019-01-07 David Kilzer <ddkilzer@apple.com>
Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
<https://webkit.org/b/193056>
Reviewed by Alex Christensen.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::clone const):
- Remove '*' from RetainPtr<> type.
2019-01-07 Dean Jackson <dino@apple.com>
Turn on Pointer Events by default for iOS
https://bugs.webkit.org/show_bug.cgi?id=193214
<rdar://problem/46974878>
Reviewed by Wenson Hsieh.
Turn on Pointer Events.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h: Make a new #define for iOS.
2019-01-07 Alex Christensen <achristensen@webkit.org>
Remove use of NetworkProcess::singleton in ServiceWorker code
https://bugs.webkit.org/show_bug.cgi?id=193209
Reviewed by Megan Gardner.
Use a member Ref<NetworkProcess> instead to avoid global singleton use.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::~WebSWServerConnection):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::scheduleJobInServer):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2019-01-07 Alex Christensen <achristensen@webkit.org>
Remove use of NetworkProcess::singleton in NetworkLoad/NetworkDataTask code
https://bugs.webkit.org/show_bug.cgi?id=193212
Reviewed by Andy Estes.
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::download):
(WebKit::NetworkDataTaskBlob::writeDownload):
(WebKit::NetworkDataTaskBlob::didFailDownload):
(WebKit::NetworkDataTaskBlob::didFinishDownload):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::convertTaskToDownload):
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::didReceiveResponse):
* NetworkProcess/NetworkLoad.h:
2019-01-07 Alex Christensen <achristensen@webkit.org>
Remove use of NetworkProcess::singleton for downloads
https://bugs.webkit.org/show_bug.cgi?id=193207
Reviewed by Brady Eidson.
No change in behavior. The DownloadManager is now a member of the NetworkProcess instead of a static singleton.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download):
(WebKit::Download::didReceiveChallenge):
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
(WebKit::DownloadManager::convertNetworkLoadToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
(WebKit::DownloadManager::client):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
(WebKit::PendingDownload::messageSenderConnection):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkLoadChecker.cpp:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::downloadManager):
* NetworkProcess/NetworkProcess.h:
2019-01-07 Devin Rousso <drousso@apple.com>
Web Inspector: Network: show secure connection details per-request
https://bugs.webkit.org/show_bug.cgi?id=191539
<rdar://problem/45979891>
Reviewed by Joseph Pecoraro.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(stringForSSLProtocol): Added.
(stringForSSLCipher): Added.
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2019-01-07 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remote inspector can crash if attempting to navigate inspector page
https://bugs.webkit.org/show_bug.cgi?id=193204
<rdar://problem/45550428>
Reviewed by Devin Rousso.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
2019-01-07 Eric Carlson <eric.carlson@apple.com>
Deactivate audio session whenever possible
https://bugs.webkit.org/show_bug.cgi?id=193188
<rdar://problem/42678977>
Reviewed by Jer Noble.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
2019-01-07 Joseph Pecoraro <pecoraro@apple.com>
[Cocoa] Add SPI to check if a WKWebView has an inspector frontend
https://bugs.webkit.org/show_bug.cgi?id=193162
<rdar://problem/24267143>
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hasInspectorFrontend]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::hasInspectorFrontend const):
2019-01-07 Antti Koivisto <antti@apple.com>
UI process side scrollbars for UI side compositing on Mac
https://bugs.webkit.org/show_bug.cgi?id=193106
Reviewed by Tim Horton.
This patch implements Mac scrollbars on UI process side using the low level NSScrollerImp/NSScrollerPairImp
SPIs. With this patch scrollbars mostly work for the main frame and also render (but can't be interacted with)
for the subframes.
This is based on the similar code for web process side scrollbars in ScrollAnimatorMac. There is quite a bit of
copy code as there is no way to share nicely. One of these will eventually go away anyway.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::RemoteScrollingCoordinatorProxy::handleMouseEvent):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
(WebKit::RemoteScrollingTree::handleMouseEvent):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/mac: Added.
* UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Added.
Wraps NSScrollerImp for vertical or horizontal scrollbar.
(WebKit::ScrollerMac::pair):
(WebKit::ScrollerMac::orientation const):
(WebKit::ScrollerMac::hostLayer const):
(WebKit::ScrollerMac::scrollerImp):
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Added.
(-[WKScrollbarPartAnimation initWithScroller:featureToAnimate:animateFrom:animateTo:duration:]):
(-[WKScrollbarPartAnimation startAnimation]):
(-[WKScrollbarPartAnimation setStartValue:]):
(-[WKScrollbarPartAnimation setEndValue:]):
(-[WKScrollbarPartAnimation setCurrentProgress:]):
(-[WKScrollbarPartAnimation invalidate]):
(-[WKScrollerImpDelegate initWithScroller:]):
(-[WKScrollerImpDelegate cancelAnimations]):
(-[WKScrollerImpDelegate scrollerPair]):
(-[WKScrollerImpDelegate convertRectToBacking:]):
(-[WKScrollerImpDelegate convertRectFromBacking:]):
(-[WKScrollerImpDelegate layer]):
(-[WKScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
(-[WKScrollerImpDelegate convertRectToLayer:]):
(-[WKScrollerImpDelegate shouldUseLayerPerPartForScrollerImp:]):
(-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
(-[WKScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
(-[WKScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[WKScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(-[WKScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
(-[WKScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
(-[WKScrollerImpDelegate scrollerImp:overlayScrollerStateChangedTo:]):
(-[WKScrollerImpDelegate invalidate]):
(WebKit::ScrollerMac::ScrollerMac):
(WebKit::ScrollerMac::~ScrollerMac):
(WebKit::ScrollerMac::attach):
(WebKit::ScrollerMac::setHostLayer):
(WebKit::ScrollerMac::updatePosition):
(WebKit::ScrollerMac::convertFromContent const):
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Added.
(WebKit::ScrollerPairMac::verticalScroller):
(WebKit::ScrollerPairMac::horizontalScroller):
(WebKit::ScrollerPairMac::scrollerImpPair):
(WebKit::ScrollerPairMac::lastKnownMousePosition const):
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Added.
Wraps NSScrollerPairImp and owns the vertical and horizontal scrollers.
(-[WKScrollerImpPairDelegate initWithScrollerPair:]):
(-[WKScrollerImpPairDelegate invalidate]):
(-[WKScrollerImpPairDelegate contentAreaRectForScrollerImpPair:]):
(-[WKScrollerImpPairDelegate inLiveResizeForScrollerImpPair:]):
(-[WKScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]):
(-[WKScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
(-[WKScrollerImpPairDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
(-[WKScrollerImpPairDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
(WebKit::ScrollerPairMac::ScrollerPairMac):
(WebKit::ScrollerPairMac::~ScrollerPairMac):
(WebKit::ScrollerPairMac::handleWheelEvent):
(WebKit::ScrollerPairMac::handleMouseEvent):
(WebKit::ScrollerPairMac::updatePositions):
(WebKit::ScrollerPairMac::contentsSize const):
(WebKit::ScrollerPairMac::visibleContentsRect const):
(WebKit::ScrollerPairMac::useDarkAppearance const):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Added.
Special node for UI side Mac scrolling. Owns ScrollerPairMac instance.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::~ScrollingTreeFrameScrollingNodeRemoteMac):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::create):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::scrollingTree const):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMouseEvent):
* WebKit.xcodeproj/project.pbxproj:
2019-01-07 Brian Burg <bburg@apple.com>
Unwanted page navigation after showing & dismissing contextual menu with control-click
https://bugs.webkit.org/show_bug.cgi?id=192912
<rdar://problem/46318508>
Reviewed by Timothy Hatcher.
After the conversion to use a mouse event queue, this behavior was observed rarely, especially
when CPU is under load and lots of things are going on in the page. In other words, it's racy.
Based on NSEvent logging, it seems that when the system is under load, we simply take too long
to enter the nested runloop that AppKit uses to handle events when the context menu is present.
AppKit doesn't care whether or not the MouseDown triggered a nested runloop; on my machine it delivers
the MouseUp event about 130ms after the MouseDown event. If we haven't show the context menu in
that time, then the MouseUp is enqueued as a normal mouse event. If the Ctrl-click is on a link,
then the MouseUp will be interpreted by EventHandler as a click event, which in the simplest case
will initiate a main frame navigation. When the context menu is dismissed and the nested runloop
is torn down, the navigation IPC message is handled in UIProcess and the page navigates away.
We can't do much to change AppKit's inherently racy behavior, but we can avoid processing
mouse events that are delivered whilst we are processing the context menu-initiating event.
From the WebProcess point of view, there is no race anymore because it does not receive the
MouseUp event.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu):
If new events come in, drop them on the floor. Based on testing, the nested runloop will discard
the unpaired MouseUp event anyway, so this does not cause a change in behavior.
2019-01-07 Wenson Hsieh <wenson_hsieh@apple.com>
Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
https://bugs.webkit.org/show_bug.cgi?id=193180
<rdar://problem/45971041>
Reviewed by Tim Horton.
JSFiddle uses CodeMirror; CodeMirror's editor works by capturing keystrokes and input in a hidden textarea
element, and then drawing its own selection caret using web content. This textarea is hidden by being placed
underneath an empty div with `overflow: hidden;`.
When requesting desktop site on iOS, both CodeMirror's caret and the native iOS caret are shown because iOS
selection UI consists of native views overlaid on the page, whereas on macOS, the entire textarea (along with
the caret) are occluded by the hidden overflow container. Additionally, various iOS behaviors related to
selection and editing, such as zooming to reveal the focused element and showing the platform callout bar, are
active when focusing this hidden editable area; these don't work as intended, and just interfere with the page's
custom editing UI.
To fix this, we augment the text interaction suppression mechanism added in r238146 to detect when the focused
element is in an empty `overflow: hidden` container, and bail out of native text editing behaviors.
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Rename elementIsTransparent to elementIsTransparentOrFullyClipped.
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
* UIProcess/ios/WKContentViewInteraction.h:
Rename FocusedElementIsTransparent to FocusedElementIsTransparentOrFullyClipped.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
Make an additional tweak here to only stop suppressing text interaction assistant in `-_elementDidBlur` if we're
not also in the middle of changing the focused element. Without this, focusing a hidden editable element while
another hidden editable element is currently focused causes us to zoom to reveal the newly focused hidden
editable element, when we should be avoiding this behavior.
(-[WKContentView _updateChangedSelection:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::getFocusedElementInformation):
2019-01-07 Alex Christensen <achristensen@webkit.org>
Move identifierBase from SessionTracker to NetworkProcess/WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193201
Reviewed by Tim Horton.
No change in behavior. This just reduces process-global state.
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::uiProcessBundleIdentifier const):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/SessionTracker.cpp:
(WebKit::identifierBase): Deleted.
(WebKit::SessionTracker::getIdentifierBase): Deleted.
(WebKit::SessionTracker::setIdentifierBase): Deleted.
* Shared/SessionTracker.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
(WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::uiProcessBundleIdentifier const):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2019-01-07 Alex Christensen <achristensen@webkit.org>
Reduce use of NetworkProcess::singleton
https://bugs.webkit.org/show_bug.cgi?id=193197
Reviewed by Brady Eidson.
Pass it around as a Ref<NetworkProcess> as a step towards reducing global state.
Soup's WebFrameNetworkingContext no longer makes a NetworkSession like all other ports
because networking is no longer done in the WebProcess.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
(WebKit::NetworkConnectionToWebProcess::prefetchDNS):
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::networkProcess):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::singleton):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::fetchDiskCacheEntries):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::clearDiskCacheEntries):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::getNetworkProcessStatistics):
(WebKit::NetworkProcess::idbServer):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::convertToDownload):
(WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create):
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::networkProcess):
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::clearDiskCache):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/curl/NetworkSessionCurl.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* NetworkProcess/soup/NetworkSessionSoup.h:
2019-01-07 Alex Christensen <achristensen@webkit.org>
Modernize CacheModel and disk cache fetching and clearing
https://bugs.webkit.org/show_bug.cgi?id=193164
Reviewed by Joseph Pecoraro.
fetchDiskCacheEntries and clearDiskCacheEntries now use an early-return model.
CacheModel is now an enum class.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::fetchDiskCacheEntries):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::clearDiskCacheEntries):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::clearDiskCache):
* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes):
(WebKit::calculateURLCacheSizes):
* Shared/CacheModel.h:
(): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toCacheModel):
(WebKit::toAPI):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setCacheModel):
(WebKit::WebProcess::clearResourceCaches):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-01-06 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import U2F command/response converters from Chromium
https://bugs.webkit.org/show_bug.cgi?id=193150
<rdar://problem/47054028>
Reviewed by Brent Fulgham.
Moves helper functions to WebAuthenticationUtils.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::produceHashSet):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(): Deleted.
(WebKit::LocalAuthenticatorInternal::buildAuthData): Deleted.
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::feedReports):
2019-01-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Use save sheet instead of dialog where possible
https://bugs.webkit.org/show_bug.cgi?id=193160
<rdar://problem/37399759>
Reviewed by Devin Rousso.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):
2019-01-04 Jer Noble <jer.noble@apple.com>
[WebKitLegacy] Media playback pauses on scroll
https://bugs.webkit.org/show_bug.cgi?id=192829
Reviewed by Eric Carlson.
Add a new WebPage, WebPageProxy, & WKWebView SPI to stop, suspend, and resume all
existing media playback in the page.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stopAllMediaPlayback]):
(-[WKWebView _suspendAllMediaPlayback]):
(-[WKWebView _resumeAllMediaPlayback]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::stopAllMediaPlayback):
(WebKit::WebPageProxy::suspendAllMediaPlayback):
(WebKit::WebPageProxy::resumeAllMediaPlayback):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopAllMediaPlayback):
(WebKit::WebPage::suspendAllMediaPlayback):
(WebKit::WebPage::resumeAllMediaPlayback):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-01-04 Chris Dumez <cdumez@apple.com>
Add support for toggling device orientation API support per site
https://bugs.webkit.org/show_bug.cgi?id=193143
<rdar://problem/46605724>
Reviewed by Alex Christensen.
Add support for toggling device orientation API support per site via _WKWebsitePolicies.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setDeviceOrientationEventEnabled:]):
(-[_WKWebsitePolicies deviceOrientationEventEnabled]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::simulateDeviceOrientationChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::simulateDeviceOrientationChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-01-04 Chris Dumez <cdumez@apple.com>
Crash under WebPageProxy::continueNavigationInNewProcess()
https://bugs.webkit.org/show_bug.cgi?id=193113
<rdar://problem/46938686>
Reviewed by Brady Eidson.
The crash was happening in continueNavigationInNewProcess() when dereferencing
the Optional<> value returned by API::Navigation::backForwardFrameLoadType(), after verifying
that API::Navigation::targetItem() is not null.
When constructing an API::Navigation object with a targetItem, you HAVE to pass
in a backForwardFrameLoadType as well so this normally is not possible. However,
it can happen because API::Navigation::setTargetItem() can get called later on and
set a target item on a Navigation object which potentially does not have a
backForwardFrameLoadType. This setter was only called in one place in
decidePolicyForNavigationAction() to update an existing Navigation object using
the targetItem provided by a NavigationAction. This logic was added with PSON
support.
Because I was unable to write a test case reproducing this and because I do not know
how it can happen in practice that we'd have a NavigationAction with a targetItem
even though the Navigation object itself is not for a back/forward navigation, I have
chosen to drop the unsafe API::Navigation::setTargetItem() setter and the call site.
When the call site was added, with ProcessSwap.NavigateToDataURLThenBack API test,
the intention was to create a back/forward navigation object instead of a standard load
navigation one if there is currently no existing Navigation object in the UIProcess.
This can happen when the back/forward navigation is triggered by the WebProcess via
JS (e.g. history.back()) and this is what the API test covers. The part of the logic
that updates an existing Navigation object with a targetItem coming from the
NavigationAction is untested and I have no evidence it does anything useful. However,
we DO have evidence that it can cause crashes.
* UIProcess/API/APINavigation.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2019-01-04 Tim Horton <timothy_horton@apple.com>
Remove some nonexistent files from the WebKit Xcode project
* WebKit.xcodeproj/project.pbxproj:
r238468 and r237205 forgot to remove some files from the project.
2019-01-04 Youenn Fablet <youenn@apple.com>
CSP violation reports should bypass CSP checks
https://bugs.webkit.org/show_bug.cgi?id=192857
<rdar://problem/46887236>
Reviewed by Chris Dumez.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::startPingLoad):
* WebProcess/Network/WebLoaderStrategy.h:
2019-01-04 Alex Christensen <achristensen@webkit.org>
Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
https://bugs.webkit.org/show_bug.cgi?id=193114
Reviewed by Brady Eidson.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-01-04 Alex Christensen <achristensen@webkit.org>
Deprecate WKContextCreate
https://bugs.webkit.org/show_bug.cgi?id=193118
Reviewed by Brady Eidson.
It has only one use that is being removed in rdar://problem/47030792
This is a step towards removing ProcessPoolConfiguration::createWithLegacyOptions.
Also make WKContextCreateWithConfiguration accept a null configuration to make it easier to use.
* UIProcess/API/C/WKContext.cpp:
(WKContextCreateWithConfiguration):
* UIProcess/API/C/WKContext.h:
2019-01-04 Tim Horton <timothy_horton@apple.com>
Fix the build
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
2019-01-04 Tim Horton <timothy_horton@apple.com>
Share ink choice and ruler between all editable images
https://bugs.webkit.org/show_bug.cgi?id=193130
<rdar://problem/46826491>
Reviewed by Wenson Hsieh.
* SourcesCocoa.txt:
Add WKDrawingCoordinator, which maintains WKWebView-wide drawing state,
and manages a single shared ink picker.
* UIProcess/PageClient.h:
(WebKit::PageClient::createDrawingView):
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::ensureEditableImage):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDrawingView):
Plumb WKDrawingView creation through PageClient, so that it can be instantiated
with knowledge of its owning WKContentView.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _drawingCoordinator]):
(-[WKContentView _installInkPickerForDrawingViewWithID:]): Deleted.
(-[WKContentView _uninstallInkPicker]): Deleted.
Move ink picker management into WKDrawingCoordinator.
* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:contentView:]):
(-[WKDrawingView _canvasViewWillBeginDrawing:]):
(-[WKDrawingView invalidateAttachment]):
(-[WKDrawingView didChangeRulerState:]):
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Deleted.
(-[WKDrawingView canvasView]): Deleted.
Use a shared ruler, owned by WKDrawingCoordinator.
Update the editable image's ink when drawing begins. This way, we don't have
to push ink changes to all drawings as they happen.
* UIProcess/ios/WKInkPickerView.h:
* UIProcess/ios/WKInkPickerView.mm:
(-[WKInkPickerView initWithContentView:]):
(-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
(-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
(-[WKInkPickerView setInk:]):
(-[WKInkPickerView ink]):
(-[WKInkPickerView initWithDrawingView:]): Deleted.
(-[WKInkPickerView didPickInk]): Deleted.
(-[WKInkPickerView inlineInkPicker:didSelectTool:]): Deleted.
(-[WKInkPickerView inlineInkPicker:didSelectColor:]): Deleted.
* WebKit.xcodeproj/project.pbxproj:
2019-01-04 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
https://bugs.webkit.org/show_bug.cgi?id=193129
Reviewed by Tim Horton.
Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
(WebKit::WebEditCommandProxy::~WebEditCommandProxy):
(WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
* UIProcess/WebEditCommandProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::addEditCommand):
(WebKit::WebPageProxy::removeEditCommand):
(WebKit::WebPageProxy::isValidEditCommand): Deleted.
Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
references instead of pointers, since these are assumed to be nonnull.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::registerEditCommand):
2019-01-03 Matt Rajca <mrajca@apple.com>
Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
https://bugs.webkit.org/show_bug.cgi?id=193128
rdar://34554231
Reviewed by Jer Noble.
Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
event along with a flag that indicates whether or not autoplay was actually prevented.
Tests: existing API tests were updated to reflect the new names. New API tests
were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
* Shared/WebCoreArgumentCoders.h: Take into account new flags.
* UIProcess/API/C/WKPage.cpp: Ditto.
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h: Ditto.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
* UIProcess/Cocoa/UIDelegate.mm: Ditto.
(WebKit::toWKAutoplayEventFlags):
(WebKit::toWKAutoplayEvent):
2019-01-04 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192970
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const): Removed code for cookiePersistentStorageFile.
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* NetworkProcess/NetworkProcessCreationParameters.h: Ditto.
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Ditto.
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters): Added code for cookiePersistentStorageFile.
(WebKit::NetworkSessionCreationParameters::encode const): Ditto.
(WebKit::NetworkSessionCreationParameters::decode): Ditto.
* NetworkProcess/NetworkSessionCreationParameters.h: Ditto.
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl): Ditto.
* NetworkProcess/Cookies/WebCookieManager.h: Removed setCookiePersistentStorage method of curl port extension.
* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage): Deleted.
2019-01-04 Chris Dumez <cdumez@apple.com>
[PSON] Calling history.back() from inside the load event handler prevents process-swapping
https://bugs.webkit.org/show_bug.cgi?id=193120
Reviewed by Alex Christensen.
A HistoryItem is created only *after* we've fired the load event. As a result, if you call
history.back() in JS from inside the load event handler, the current HistoryItem and and
the target HistoryItem will be the same. This is normally not an issue. However, there was
logic inside of WebProcessPool::processForNavigationInternal() which would compare the
processID of the source and destination BackForwardListItems and which would force a process
reuse if both BackForwardListItems came from the same WebContent process. So even though
we swapped when doing a standard load from site A to site B, we would fail to swap if site
B called history.back() from inside its load event handler.
To address the issue, stop relying on the source backforward item's processID. Instead, just
use the WebContent process matching the destination backforward item's processID if it still
exists.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2019-01-04 Keith Rollin <krollin@apple.com>
Bring back parent processID for logging
https://bugs.webkit.org/show_bug.cgi?id=193121
<rdar://problem/47031634>
Reviewed by Alex Christensen.
Bug 192961 removes presentingApplicationPID from
NetworkProcessCreationParameters because it was (a) stored in some
global state, the use of which is being minimized, and (b) it was
largely unused. However, it was actually still being used in some
useful logging in order to tie together child processes with their
parent process. Re-introduce this value in NetworkLoadParameters so
that we can log it.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::preconnectTo):
2019-01-04 Youenn Fablet <youenn@apple.com>
Make RestrictedHTTPResponseAccess an internal flag
https://bugs.webkit.org/show_bug.cgi?id=193145
Reviewed by Chris Dumez.
* Shared/WebPreferences.yaml: This will ease debugging.
2019-01-04 Per Arne Vollan <pvollan@apple.com>
[iOS] Enable logging for services in sandbox
https://bugs.webkit.org/show_bug.cgi?id=192705
Reviewed by Brent Fulgham.
When running layout tests, we didn’t see 107 services being looked up through launchd. We should
add logging to these services to determine which services we actually need in the sandbox.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239603.
https://bugs.webkit.org/show_bug.cgi?id=193146
Breaks shipping tests (Requested by bfulgha__ on #webkit).
Reverted changeset:
"[iOS] Update sandbox profile to use iconservices instead of
lsdiconservice"
https://bugs.webkit.org/show_bug.cgi?id=193115
https://trac.webkit.org/changeset/239603
2019-01-04 Chris Dumez <cdumez@apple.com>
Crash under WebProcessPool::addSuspendedPage()
https://bugs.webkit.org/show_bug.cgi?id=193110
Reviewed by Youenn Fablet.
When PageCache is disabled, WebProcessPool::m_maxSuspendedPageCount is 0 and WebProcessPool::addSuspendedPage()
would call m_suspendedPages.removeFirst() even though m_suspendedPages is empty, causing a crash.
Do an early return when m_maxSuspendedPageCount is 0 since we do not want to add any suspended page in this
case.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::addSuspendedPage):
2019-01-03 Brent Fulgham <bfulgham@apple.com>
[iOS] Silently deny access to mail settings triggered by MessageUI framework
https://bugs.webkit.org/show_bug.cgi?id=193123
<rdar://problem/42485581>
Reviewed by Alexey Proskuryakov.
Remove unhelpful logging generated when we block access to non-WebKit preferences. These
invalid checks are done by an system framework that we cannot modify.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-03 Brent Fulgham <bfulgham@apple.com>
[iOS] Update sandbox profile to use iconservices instead of lsdiconservice
https://bugs.webkit.org/show_bug.cgi?id=193115
<rdar://problem/44867379>
Reviewed by Eric Carlson.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-03 Brent Fulgham <bfulgham@apple.com>
Remove logic handling DNT header during redirects
https://bugs.webkit.org/show_bug.cgi?id=193082
<rdar://problem/45555965>
Reviewed by Chris Dumez.
Test: http/wpt/fetch/dnt-header-after-redirection.html.
Don't bother looking for (or passing along) DNT headers during redirects.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::prepareRedirectedRequest): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::restartNetworkLoad):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::willPerformHTTPRedirection):
2019-01-03 Chris Dumez <cdumez@apple.com>
Add release logging to help debug HTTPS upgrade issues
https://bugs.webkit.org/show_bug.cgi?id=193075
Reviewed by Alex Christensen.
Add release logging to help debug HTTPS upgrade issues like Bug 193026.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
(WebKit::NetworkHTTPSUpgradeChecker::query):
2019-01-03 Alex Christensen <achristensen@webkit.org>
NetworkProcess should initialize its default NetworkSession with parameters from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192967
Reviewed by Brent Fulgham.
I moved 3 of the NetworkProcessCreationParameters to use corresponding values of a WebsiteDataStoreParameters.
More will be moved in the near future, like indexedDatabaseDirectory.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view
https://bugs.webkit.org/show_bug.cgi?id=193084
<rdar://problem/47006882>
Reviewed by Simon Fraser.
In `WKWebView.mm`, `-_zoomToFocusRect:` will ignore the given selection rect if it is of size `{ 0, 0 }` and at
the origin. Prior to r239441, when using the tab key to move focus between non-editable form controls (or any
other method that doesn't involve tapping on the focused select element, with the exception of the next and
previous buttons in the input accessory view), we would compute a selection rect of `{{ 0, 0 }, { 0, 0 }}`, and
subsequently try to scroll the focused element to the center of the visible area, without taking the selection
rect into account.
However, after r239441, the web process sends the element interaction location to the UI process, which then
computes the selection rect by taking this location and adding a size of `{ 1, 1 }` (before r239441, this was
done in `WebPage::getAssistedNodeInformation`). However, our new implementation doesn't take into account the
case where the element interaction rect is null, which happens when the last interaction location is outside of
the bounding rect of the element. In this case, we set the element interaction location to { 0, 0 } and end up
computing a selection rect of `{{ 0, 0 }, { 1, 1 }}` instead of `{{ 0, 0 }, { 0, 0 }}` as we would have
previously done. This causes us to scroll up to the origin, instead of revealing the focused element.
To fix this, we restore the pre-r239441 behavior. See additional comments below for details.
Test: fast/forms/ios/scroll-to-reveal-focused-select.html
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
Rename `elementInteractionLocation` to `lastInteractionLocation`. This was previously
`elementInteractionLocation` due to existing logic that tries to move the interaction location into the bounding
rect of the element in the case where visual viewports are disabled; however, since this feature has long been
enabled by default for all modern WebKit clients (internal and external), it's simpler to just use always send
the last interaction location over to the UI process, and have the UI process use `{{ 0, 0 }, { 0, 0 }}` if
the interaction location is outside of the element rect.
In the very unlikely event that any modern WebKit client disables visual viewports, this will still behave
reasonably, since we'll just use `{{ 0, 0 }, { 0, 0 }}` as the target rect and scroll to reveal the entire
element rather than the top left corner of the element.
* UIProcess/ios/WKContentViewInteraction.mm:
(rectToRevealWhenZoomingToFocusedElement):
* WebProcess/WebPage/ios/WebPageIOS.mm:
Move the check for whether the interaction location is inside the element's bounding rect from the web process
to the UI process. This relocates the logic to determine whether the selection rect should be a 1 by 1 fallback
interaction rect or the zero rect (`{{ 0, 0 }, { 0, 0 }}`) closer to the code that actually uses this rect.
(WebKit::WebPage::getFocusedElementInformation):
2019-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t
https://bugs.webkit.org/show_bug.cgi?id=193100
Reviewed by Simon Fraser.
Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable
editing command, and use this type alias in lieu of `uint64_t`. No change in behavior.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:
(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::commandID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):
Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::webUndoStep):
(WebKit::WebPage::addWebUndoStep):
Make this take a `Ref<WebUndoStep>&&` instead of a `WebUndoStep*`, and use move semantics to transfer the
given `Ref` to the table.
(WebKit::WebPage::removeWebEditCommand):
(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):
Use `auto*` in a couple of places.
(WebKit::WebPage::didRemoveEditCommand):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebUndoStep.cpp:
(WebKit::generateUndoStep):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::stepID const):
(WebKit::WebUndoStep::WebUndoStep):
* WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp.
2019-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for using the current text selection as the find string on iOS
https://bugs.webkit.org/show_bug.cgi?id=193034
<rdar://problem/45138739>
Reviewed by Tim Horton.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeFindStringFromSelection:]):
Provides a way to set the find string on iOS and macOS (an aside: takeFindStringFromSelection: already exists on
macOS, but there is no equivalent protocol method on iOS, so this new SPI acts as a cross-platform way for
WebKit clients to take the find string from the selection across all Cocoa platforms).
(+[WKWebView _stringForFind]):
(+[WKWebView _setStringForFind:]):
Call into find-in-page helper functions.
(-[WKWebView _findString:options:maxCount:]):
On iOS, additionally update the find-in-page string when exercising the _findString:options:maxCount: SPI. This
mirrors macOS behavior of updating the find pasteboard every time the find string changes; however, on macOS,
this is implemented by the platform (in AppKit), whereas there's no platform find pasteboard on iOS, let alone
logic to update it in UIKit. As such, we directly drive updates to the find string within WebKit.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add some new cross-platform find-in-page SPI. See above for more details.
* UIProcess/Cocoa/GlobalFindInPageState.h: Added.
* UIProcess/Cocoa/GlobalFindInPageState.mm: Added.
(WebKit::findPasteboard):
(WebKit::globalStringForFind):
Fetch the string to use when finding text in the page. On macOS, this accesses the AppKit find pasteboard; on
iOS, this instead returns the current global find string.
(WebKit::updateStringForFind):
Sets the global find string. Uses the find pasteboard on macOS, and sets the global find string on iOS.
(WebKit::stringForFind):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Add plumbing to allow WebEditorClient to deliver the update the global find string in the UI process.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateStringForFind):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::updateStringForFind):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateStringForFind):
2019-01-02 Brent Fulgham <bfulgham@apple.com>
Allow WebContent process access to some drawing-related IOKit properties
https://bugs.webkit.org/show_bug.cgi?id=193086
<rdar://problem/46568088>
Reviewed by Eric Carlson.
Update the iOS WebContent process sandbox to allow access to some IOKit properties
that are needed for drawing and media playback operations.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebKit.WebContent.sb.in:
2019-01-02 Brent Fulgham <bfulgham@apple.com>
Remove unused logging service
https://bugs.webkit.org/show_bug.cgi?id=193081
<rdar://problem/40414815>
Reviewed by Alexey Proskuryakov.
We don't use this logging service, so don't open an exception for it.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-01-02 Brent Fulgham <bfulgham@apple.com>
Remove temporary workaround for CVMS code signing objects
https://bugs.webkit.org/show_bug.cgi?id=193079
<rdar://problem/40139202>
Reviewed by Alexey Proskuryakov.
* WebProcess/com.apple.WebProcess.sb.in:
2019-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping "select all" in the callout bar
https://bugs.webkit.org/show_bug.cgi?id=193070
<rdar://problem/46921508>
Reviewed by Tim Horton.
r239441 added logic to include an EditorState in the next layer tree commit when refocusing an element; this was
done to ensure that after tapping an element that has already been programmatically focused, we still send up-
to-date editor information to the UI process for the purposes of zooming to the selection rect, even if the
selection in the DOM is unchanged, since other aspects of the editor state may have changed since the element
was initially focused.
We currently try to flag the next layer tree commit by setting `m_hasPendingEditorStateUpdate` to `true`.
However, this is problematic since we aren't guaranteed in all cases that a compositing flush has been
scheduled. In the case where it hasn't, we'll end up in a state where the editor state update flag has been set,
yet the update will not make it over to the UI process until something happens that forces a layer tree commit
(e.g. scrolling, pinch zooming). Worse still, if the selection is then programmatically changed from the web
process, we will bail from sending a subsequent editor state update to the UI process because `WebPage` thinks
that a pending editor state has already been scheduled. This manifests in selection UI not updating after
tapping "Select All" in the callout bar, if the callout bar was brought up by tapping near the selection (since
this refocuses the element).
To fix this, we adjust this logic in `WebPage::elementDidRefocus` so that it sets the flag and then schedules a
compositing flush, but only if the user is actually interacting with the focused element (i.e., if the page
calls `focus` repeatedly, we won't continue to schedule compositing flushes).
Test: editing/selection/ios/change-selection-after-tapping-focused-element.html
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidRefocus):
(WebKit::WebPage::sendEditorStateUpdate):
(WebKit::WebPage::scheduleFullEditorStateUpdate):
Add a private helper method to schedule an editor state update by setting `m_hasPendingEditorStateUpdate` to
`true` and then scheduling a compositing layer flush. Also, add a FIXME aluding to the fact that scheduling an
entire compositing layer flush to send an editor state update is somewhat wasteful, and should be replaced by
just scheduling this work to be done before the next frame (see: <rdar://problem/36523583> for more detail).
We also use this helper method in a few places where we currently turn on the editor state flag and schedule a
subsequent compositing flush.
(WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
* WebProcess/WebPage/WebPage.h:
2019-01-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239524.
https://bugs.webkit.org/show_bug.cgi?id=193083
basic browsing seems not to work (Requested by thorton on
#webkit).
Reverted changeset:
"Expand use of sourceApplicationAuditData"
https://bugs.webkit.org/show_bug.cgi?id=192995
https://trac.webkit.org/changeset/239524
2019-01-01 Jeff Miller <jeffm@apple.com>
Update user-visible copyright strings to include 2019
https://bugs.webkit.org/show_bug.cgi?id=192811
Reviewed by Mark Lam.
* Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2018-12-28 Wenson Hsieh <wenson_hsieh@apple.com>
Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
https://bugs.webkit.org/show_bug.cgi?id=193049
Reviewed by Sam Weinig.
Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No
change in behavior.
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKEditCommand.h: Added.
* UIProcess/Cocoa/WKEditCommand.mm: Added.
Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in
the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK-
prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable.
(-[WKEditCommand initWithWebEditCommandProxy:]):
Make the return type instancetype instead of id, and also make this take a Ref<WebEditCommandProxy>&& instead
of a RefPtr.
(-[WKEditCommand command]):
Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy
should always be non-null.
(-[WKEditorUndoTarget undoEditing:]):
(-[WKEditorUndoTarget redoEditing:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::registerEditCommand):
Use WTFMove instead of copying the Ref when creating a WKEditCommand.
(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::registerEditCommand):
Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand.
(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* WebKit.xcodeproj/project.pbxproj:
2018-12-27 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=192658
Reviewed by Yusuke Suzuki.
* PlatformMac.cmake:
2018-12-26 Fujii Hironori <Hironori.Fujii@sony.com>
[MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker': redefinition; '__declspec(noreturn)' or '[[noreturn]]' differs
https://bugs.webkit.org/show_bug.cgi?id=193030
Reviewed by Ross Kirsling.
Windows Debug builds are failing to compile due to
NO_RETURN_DUE_TO_ASSERT inconsistency of
NetworkHTTPSUpgradeChecker destructor's definition and
declaration.
* NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added
NO_RETURN_DUE_TO_ASSERT to NetworkHTTPSUpgradeChecker destructor
declaration.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Removed
NO_RETURN_DUE_TO_ASSERT from the definition.
2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com>
[WebKit][Win] Remove using namespace in the global scope
https://bugs.webkit.org/show_bug.cgi?id=192968
Reviewed by Alex Christensen.
Moved using namespace statements in the global scope to inside
namespaces.
<https://webkit.org/code-style-guidelines/#using-position>
* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
* NetworkProcess/curl/NetworkProcessCurl.cpp:
* NetworkProcess/curl/NetworkSessionCurl.cpp:
* NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
* Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
* Shared/win/NativeWebKeyboardEventWin.cpp:
* Shared/win/WebEventFactory.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com>
Remove "using namespace std;"
https://bugs.webkit.org/show_bug.cgi?id=192973
Reviewed by Alex Christensen.
* Platform/IPC/win/ConnectionWin.cpp:
2018-12-24 Simon Fraser <simon.fraser@apple.com>
Change ScrollingNodeType to an enum class
https://bugs.webkit.org/show_bug.cgi?id=193009
Reviewed by Zalan Bujtas.
Change the ScrollingNodeType enum to an enum class.
No behavior change.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2018-12-23 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
https://bugs.webkit.org/show_bug.cgi?id=193019
Reviewed by Dan Bernstein.
Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
changes to WKWebViewPrivate.h.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]):
(-[WKWebView targetForAction:withSender:]):
(-[WKWebView _setFont:sender:]):
(-[WKWebView _setFontSize:sender:]):
(-[WKWebView _setTextColor:sender:]):
(-[WKWebView setFont:sender:]): Deleted.
(-[WKWebView setTextColor:sender:]): Deleted.
(-[WKWebView setFontSize:sender:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView setFontForWebView:sender:]): Deleted.
(-[WKContentView setFontSizeForWebView:sender:]): Deleted.
(-[WKContentView setTextColorForWebView:sender:]): Deleted.
2018-12-23 Wenson Hsieh <wenson_hsieh@apple.com>
Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
https://bugs.webkit.org/show_bug.cgi?id=193015
<rdar://problem/46583527>
Reviewed by Tim Horton.
Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _updateChangedSelection:]):
2018-12-22 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Suppress native selection behaviors when focusing a very small editable element
https://bugs.webkit.org/show_bug.cgi?id=193005
<rdar://problem/46583527>
Reviewed by Tim Horton.
In r238146, I added a mechanism to detect when the selection is hidden within transparent editable elements, and
used this to suppress native selection on iOS (such as selection handles, highlight, callout bar, etc.) to avoid
conflicts between the page's editing UI and the platform.
However, one additional technique observed on some websites involves hiding the selection by moving it into a
tiny (1x1) editable element. Here, we currently still present a callout bar with editing actions, as well as
show a selection caret or handles on iOS. To fix this, we extend the mechanism added in r238146 by also
suppressing the selection assistant in the case where the editable element's area is beneath a tiny minimum
threshold.
Test: editing/selection/ios/hide-selection-in-tiny-contenteditable.html
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
(WebKit::operator<<):
* Shared/EditorState.h:
Rename selectionClipRect to focusedElementRect. We currently propagate the bounds of the focused element to the
UI process through EditorState updates, but only for the purpose of returning it in the computed selection clip
rect; instead, rename this member to something more general-purpose, so we can also use it when determining
whether to suppress the selection assistant.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _candidateRect]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::handleRequestedCandidates):
* UIProcess/ios/WKContentViewInteraction.h:
Add a new SuppressSelectionAssistantReason that corresponds to focusing tiny editable elements.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _updateChangedSelection:]):
Check the size of the focused element, and begin or stop suppressing the selection assistant accordingly.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformEditorState const):
2018-12-20 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use Ref<> as much as possible
https://bugs.webkit.org/show_bug.cgi?id=192808
Reviewed by Alex Christensen.
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::create):
* PluginProcess/WebProcessConnection.h:
* UIProcess/API/Cocoa/WKConnection.mm:
(-[WKConnection sendMessageWithName:body:]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
* UIProcess/API/glib/WebKitGeolocationProvider.cpp:
(WebKit::WebKitGeolocationProvider::notifyPositionChanged):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_allow_tls_certificate_for_host):
* UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
* UIProcess/BackingStore.cpp:
(WebKit::BackingStore::incorporateUpdate):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::createErrorWithRecoveryAttempter):
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::create):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::create):
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeViewSnapshot):
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCreateSubframe):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getStatistics):
(WebKit::WebProcessPool::requestWebContentStatistics):
(WebKit::WebProcessPool::requestNetworkingStatistics):
* UIProcess/WebProcessPool.h:
* UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
(WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setPromisedDataForImage):
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange initWithDocument:]):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::addArchiveResource):
(WebKit::PDFPlugin::snapshot):
(WebKit::PDFPlugin::writeItemsToPasteboard):
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::snapshot):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performURLRequest):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getPathnamesForType):
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::webArchiveData):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::replaceDictatedText):
(WebKit::WebPage::getPositionInformation):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
(WebKit::StorageNamespaceImpl::copy):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::getOrCreate):
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
* WebProcess/WebStorage/WebStorageNamespaceProvider.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionManager::createModelAndInterface):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::createModelAndInterface):
2018-12-21 Chris Dumez <cdumez@apple.com>
navigator.userAgent in service workers does not reflect customUserAgent set by client
https://bugs.webkit.org/show_bug.cgi?id=192951
Reviewed by Youenn Fablet.
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2018-12-21 Alex Christensen <achristensen@webkit.org>
Expand use of sourceApplicationAuditData
https://bugs.webkit.org/show_bug.cgi?id=192995
<rdar://problem/46627875>
Reviewed by Brady Eidson.
sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::sourceApplicationAuditData const):
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::getAuditToken):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::sourceApplicationAuditData const):
2018-12-21 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 5.
Add some additional temporary logging info to determine if the time out value passed to the timer is respected.
Once the bug is determined and fixed, we should remove all logging added in this patch.
Reviewed by Dewei Zhu.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
2018-12-21 Keith Rollin <krollin@apple.com>
Crash in com.apple.WebKit: WebKit::WebResourceLoader::willSendRequest + 223
https://bugs.webkit.org/show_bug.cgi?id=192989
Reviewed by Chris Dumez.
willSendRequest is calling maybeLoadFallbackForRedirect, which can
delete “this”. After that, some new logging code tries to access
“this” and causes the crash. Fix this by adjusting the scope of a
"protectedThis".
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
2018-12-21 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
https://bugs.webkit.org/show_bug.cgi?id=190466
Reviewed by Youenn Fablet.
Added persistency to the DeviceIdHashSaltStorage. Implemented a
decoder and an encoder for the HashSaltForOrigin struct to store
it in a file, this allows us to save the lastTimeUsed, the origin
and the hash salt. It uses a new directory where it creates a file
per hash salt, the name of the file is the hash salt to avoid
leaking information in the system. The last time used and the
origin are stored inside the file, it also adds a version
directory used to change the structure of the file in the future,
if we need to do it. In the DeviceIdHashSaltStorage class the disk
operations happen in a WorkQueue, but all interactions go in the
main thread. We added code to handle the operations when the load
still did not finish.
* Platform/Logging.h:
Added channel DiskPersistency..
* Sources.txt: Added new files.
* UIProcess/API/APIProcessPoolConfiguration.cpp: Added code to set
the directory for the deviceIdHashSalts. That way we can use the
configuration when creating the DeviceIdHashSaltStorage.
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
Added code to set the directory in the disk used to store the
information.
* UIProcess/API/APIWebsiteDataStore.h: Ditto.
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Added dummy
implementation to get the directory in cocoa.
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Defined the
default directories used to store the information in the disk.
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetDataStore): Added the directory used
to store the information.
(webkit_website_data_manager_remove): Modified the way we use to
make sure when we remove the cookies we also remove the hash salts.
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added dummy
implementations to get the directory in windows platform.
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory):
* UIProcess/API/C/WKBackForwardListItemRef.cpp: Add namespace, it
seems some unified build compilation issue.
* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::create): Added a create method
used to pass the directory and the persistency status of the websitedatastore.
(WebKit::DeviceIdHashSaltStorage::completeHandler): Added to share
the code copying the origins to complete the get handler.
(WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
Added to share the code when completing the task of getting a new
hash salt.
(WebKit::DeviceIdHashSaltStorage::DeviceIdHashSaltStorage): Added
a new constructor for the create method.
(WebKit::getSecurityOriginData): Added to get the
SecurityOriginData from a field in the decoder and do all the
checks.
(WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): Open the
directory and restore all the hash salts from disk to the memory
structure.
(WebKit::DeviceIdHashSaltStorage::createEncoderFromData const):
Creates the decoder to store the HashSaltForOrigin structure.
(WebKit::DeviceIdHashSaltStorage::storeHashSaltToDisk): Write to
disk a decoder object created from a HashSaltForOrigin
structure. It uses the writeEncoderToDisk function.
(WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Make
sure we store in disk a new hash salt when it is generated and the
WebsiteDataStore is persistent. Add a completionHandler to return
the value found or generated, this way we can control if the
HashMap is already loaded from disk.
(WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
Make sure we run the get in a queue now that we store information
in disk.
(WebKit::DeviceIdHashSaltStorage::deleteHashSaltFromDiskIfNeeded):
Added code to make sure we remove the files in disk.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk.
* UIProcess/DeviceIdHashSaltStorage.h: Ditto.
* UIProcess/PersistencyUtils.cpp: Added file to share the
persistency code with the ResourceLoadStatisticsPersistentStorage class.
(WebKit::createDecoderForFile): Ditto.
(WebKit::writeEncoderToDisk): Ditto.
* UIProcess/PersistencyUtils.h: Ditto.
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Use the
new PersistencyUtils functions shared with the
DeviceIdHashSaltStorage class.
(WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp: After
changing the API of the deviceIdHashSaltForOrigin we now use a
completionHandler because it could happen the HashMap is not still
loaded and we would have to wait for it. We refactored the calls
to the method to use this new completionHandler.
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore): Create the
DeviceIdHashSaltStorage class with the persistency information.
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Make
sure we have the directory to store the information.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Add get
and set functions for the deviceHashSaltStorageDirectory.
* WebKit.xcodeproj/project.pbxproj: Added PersistencyUtils file to
the xcode compilation.
2018-12-20 Alex Christensen <achristensen@webkit.org>
Remove unused NetworkProcessCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192961
Reviewed by Andy Estes.
loadThrottleLatency isn't used since I replaced it with NetworkSessionCreationParameters.loadThrottleLatency in r238654
presentingApplicationPID has no effect because that value is only used in the WebProcess in NetworkExtensionContentFilter::initialize
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::hasValue() instead of Optional::has_value()
https://bugs.webkit.org/show_bug.cgi?id=192948
Reviewed by Tim Horton.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::AutomationCommandError::toProtocolString):
(WebKit::WebAutomationSession::willClosePage):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
2018-12-20 Jeremy Jones <jeremyj@apple.com>
Flicker when exiting element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=192774
rdar://problem/33088878
Reviewed by Jer Noble.
Fixes an issue where the web page would flicker upon exiting element fullscreen.
Replace WebView with a snapshot while the WebView is restyled and resized for inline.
* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:webView:page:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
2018-12-20 Chris Dumez <cdumez@apple.com>
Move HTTPS_UPGRADE code behind a runtime flag, off by default
https://bugs.webkit.org/show_bug.cgi?id=192937
Reviewed by Youenn Fablet.
Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
* NetworkProcess/NetworkHTTPSUpgradeChecker.h:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* Shared/WebPreferences.yaml:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* config.h:
2018-12-20 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Add a runtime flag for local authenticator
https://bugs.webkit.org/show_bug.cgi?id=192792
<rdar://problem/46798738>
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebAuthenticationLocalAuthenticatorEnabled):
(WKPreferencesGetWebAuthenticationLocalAuthenticatorEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/WebAuthentication/Cocoa/LocalService.mm:
(WebKit::LocalService::isAvailable):
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::valueOr() instead of Optional::value_or()
https://bugs.webkit.org/show_bug.cgi?id=192933
Reviewed by Geoffrey Garen.
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetPort):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin port]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _cpuLimit]):
* UIProcess/API/glib/WebKitSecurityOrigin.cpp:
(webkit_security_origin_get_port):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseHandleWheelEvent):
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputKeyFrame::maximumDuration const):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Automation/WebAutomationSessionMacros.h:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::initTimeOutTimer):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::deviceScaleFactor const):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::activateItem):
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFormDataElement):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::convertFromPDFViewToRootView const):
(WebKit::PDFPlugin::boundsOnScreen const):
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/wpe/CompositingManager.cpp:
(WebKit::CompositingManager::releaseConnectionFd):
2018-12-20 Keith Rollin <krollin@apple.com>
Improve release-level page-load logging
https://bugs.webkit.org/show_bug.cgi?id=192872
<rdar://problem/46850309>
Reviewed by Chris Dumez.
There are a number of reported bugs that are difficult or impossible
to track down with our current level of logging. Additionally, some
software groups lower in the page-loading stack have requested logging
sufficient for tracking a user-visible error message down to the
requested resource that caused the message. Add more-comprehensive
logging to address these issues/requests.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_editableImageController):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::tryClose):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPageProxy::stopLoading):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::tryRestoreScrollPosition):
(WebKit::WebPageProxy::updateThrottleState):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::processDidBecomeUnresponsive):
(WebKit::WebPageProxy::processDidBecomeResponsive):
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::dispatchProcessDidTerminate):
(WebKit::WebPageProxy::tryReloadAfterProcessTermination):
(WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
(WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
(WebKit::WebResourceLoader::didReceiveResponse):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
2018-12-20 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Replace "node assistance" terminology in WebKit with "focused element"
https://bugs.webkit.org/show_bug.cgi?id=192936
Reviewed by Tim Horton.
Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
see below for more details. No new tests, because there should be no change in behavior.
* Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
(WebKit::OptionItem::encode const):
(WebKit::OptionItem::decode):
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.
Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
focusedElementIdentifier (which is currently just a `uint64_t`).
(WebKit::OptionItem::OptionItem):
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _shouldUpdateKeyboardWithInfo:]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
eventually).
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
* UIProcess/WebPageProxy.messages.in:
Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::elementDidFocus):
(WebKit::PageClientImpl::isFocusingElement):
(WebKit::PageClientImpl::elementDidBlur):
(WebKit::PageClientImpl::startAssistingNode): Deleted.
(WebKit::PageClientImpl::isAssistingNode): Deleted.
(WebKit::PageClientImpl::stopAssistingNode): Deleted.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView isFocusingElement]):
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView isAssistingNode]): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
(hasFocusedElement):
(-[WKContentView cleanupInteraction]):
(-[WKContentView shouldHideSelectionWhenScrolling]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView inputView]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView clearSelection]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _isInteractingWithFocusedElement]):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView selectPositionAtPoint:completionHandler:]):
(-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
(-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
(-[WKContentView accessoryTab:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView accessoryClear]):
(-[WKContentView _updateAccessory]):
(-[WKContentView insertTextSuggestion:]):
(-[WKContentView setSelectedTextRange:]):
(-[WKContentView textInputTraits]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView focusedElementInformation]):
(-[WKContentView focusedSelectElementOptions]):
(rectToRevealWhenZoomingToFocusedElement):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
(-[WKContentView updateCurrentFocusedElementInformation:]):
(-[WKContentView presentViewControllerForCurrentFocusedElement]):
(-[WKContentView focusedFormControlViewDidSubmit:]):
(-[WKContentView focusedFormControlViewDidCancel:]):
(-[WKContentView focusedFormControlViewDidBeginEditing:]):
(-[WKContentView rectForFocusedFormControlView:]):
(-[WKContentView nextRectForFocusedFormControlView:]):
(-[WKContentView previousRectForFocusedFormControlView:]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView focusedFormControlViewDidRequestNextNode:]):
(-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
(-[WKContentView hasNextNodeForFocusedFormControlView:]):
(-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
(-[WKContentView selectMenu:didSelectItemAtIndex:]):
(-[WKContentView numberOfItemsInSelectMenu:]):
(-[WKContentView selectMenu:displayTextForItemAtIndex:]):
(-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
(-[WKContentView selectMenuUsesMultipleSelection:]):
(-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _autofillContext]):
(-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView inputLabelTextForViewController:]):
(-[WKContentView initialValueForViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
(hasAssistedNode): Deleted.
Replaced with hasFocusedElement.
(-[WKContentView _isInteractingWithAssistedNode]): Deleted.
(-[WKContentView assistedNodeInformation]): Deleted.
(-[WKContentView assistedNodeSelectOptions]): Deleted.
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
(-[WKContentView _stopAssistingNode]): Deleted.
(-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
(-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsControl textAlignment]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::focusedElementInformationCallback):
(WebKit::WebPageProxy::requestFocusedElementInformation):
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::blurFocusedElement):
(WebKit::WebPageProxy::elementDidFocus):
(WebKit::WebPageProxy::elementDidBlur):
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::setFocusedElementValue):
(WebKit::WebPageProxy::setFocusedElementValueAsNumber):
(WebKit::WebPageProxy::setFocusedElementSelectedIndex):
(WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
(WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
(WebKit::WebPageProxy::blurAssistedNode): Deleted.
(WebKit::WebPageProxy::startAssistingNode): Deleted.
(WebKit::WebPageProxy::stopAssistingNode): Deleted.
(WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
(WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
(WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
(WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
* UIProcess/ios/forms/WKFormColorPicker.mm:
(-[WKColorPicker initWithView:]):
(-[WKColorPicker setControlValueFromUIColor:]):
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePicker initWithView:datePickerMode:]):
(-[WKDateTimePicker shouldPresentGregorianCalendar:]):
(-[WKDateTimePicker _dateChangedSetAsNumber]):
(-[WKDateTimePicker _dateChangedSetAsString]):
(-[WKDateTimePicker controlBeginEditing]):
(-[WKFormInputControl initWithView:]):
(-[WKDateTimePopover clear:]):
(-[WKDateTimePopover initWithView:datePickerMode:]):
* UIProcess/ios/forms/WKFormPopover.mm:
(-[WKRotatingPopover presentPopoverAnimated:]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl initWithView:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker initWithView:]):
(-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
(-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
(-[WKMultipleSelectPicker findItemIndexAt:]):
(-[WKMultipleSelectPicker pickerView:row:column:checked:]):
(-[WKSelectSinglePicker initWithView:]):
(-[WKSelectSinglePicker controlEndEditing]):
(-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
(-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
(-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController initWithView:hasGroups:]):
(-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
(-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
(-[WKSelectTableViewController findItemIndexAt:]):
(-[WKSelectTableViewController findItemAt:]):
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::elementDidFocus):
(WebKit::WebChromeClient::elementDidRefocus):
(WebKit::WebChromeClient::elementDidBlur):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::setTextAsync):
(WebKit::WebPage::resetFocusedElementForFrame):
(WebKit::WebPage::elementDidRefocus):
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::elementDidBlur):
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
* WebProcess/WebPage/WebPage.h:
Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::requestFocusedElementInformation):
(WebKit::WebPage::blurFocusedElement):
(WebKit::WebPage::setFocusedElementValue):
(WebKit::WebPage::setFocusedElementValueAsNumber):
(WebKit::WebPage::setFocusedElementSelectedIndex):
(WebKit::innerFrameQuad):
(WebKit::constrainPoint):
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::startAutoscrollAtPosition):
(WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::rangeForGranularityAtPoint):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::focusNextFocusedElement):
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::WebPage::autofillLoginCredentials):
(WebKit::WebPage::requestAssistedNodeInformation): Deleted.
(WebKit::WebPage::blurAssistedNode): Deleted.
(WebKit::WebPage::setAssistedNodeValue): Deleted.
(WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
(WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
(WebKit::WebPage::focusNextAssistedNode): Deleted.
(WebKit::WebPage::getAssistedNodeInformation): Deleted.
2018-12-20 Brent Fulgham <bfulgham@apple.com>
WKWebView default UA doesn't freeze the build number
https://bugs.webkit.org/show_bug.cgi?id=192809
<rdar://problem/44687185>
Reviewed by Andy Estes.
Always reports the frozen build number.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(defaultApplicationNameForUserAgent): Do not expose the actual build number through this API.
2018-12-20 Jer Noble <jer.noble@apple.com>
Enable MediaCapabilities by default.
https://bugs.webkit.org/show_bug.cgi?id=192340
<rdar://problem/46435149>
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2018-12-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebDriver: tests in imported/w3c/webdriver/tests/element_clear/user_prompts.py are failing
https://bugs.webkit.org/show_bug.cgi?id=192927
Reviewed by Michael Catanzaro.
Give the focus back to the web view when a dialog is dismissed.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseContainerRemove):
2018-12-20 Tim Horton <timothy_horton@apple.com>
Unparented WKWebView can't retrieve main resource data for a main frame plugin
https://bugs.webkit.org/show_bug.cgi?id=192923
<rdar://problem/46859068>
Reviewed by Wenson Hsieh.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::liveResourceData const):
If the WKWebView is unparented, we may not immediately initialize the plugin.
In that case, PluginView holds on to the backing data until the plugin
is initialized. If a WKWebView API client asks for the backing data
for the plugin during this time, we should return it, instead of bailing.
2018-12-20 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Focusing an editable element should scroll to reveal the selection
https://bugs.webkit.org/show_bug.cgi?id=192802
<rdar://problem/46781759>
Reviewed by Tim Horton.
Currently, when tapping on an editable element, logic in -[WKWebView _zoomToFocusRect:…:] attempts to adjust the
visible viewport such that the rect containing the selection is visible. However, AssistedNodeInformation's
selectionRect is used here, which (as the FIXME in WebPage::getAssistedNodeInformation notes) is either the last
touch location, or the top left of the element if the touch location is outside of the element's bounding rect.
This leads to confusing and undesirable behavior when tapping near the bottom of a large contenteditable element
to focus it, since the actual selection will end up near the top of the element, yet we'll try to scroll to
reveal the bottom of the element, which causes the visible selection to scroll offscreen. Notably, this affects
scenarios involving editable web views embedded in apps, such as Mail compose.
Right now, we use the last touch location as an approximation for the selection rect because the selection may
have not yet been updated at the moment when focus moves into an editable element. To fix this, we defer the
process of zooming to the focused element rect until after the selection changes and the UI process is updated
with information about the new selection rects.
Test: editing/selection/ios/selection-is-visible-after-focusing-editable-area.html
* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
Rename selectionRect to elementInteractionLocation, to more accurately reflect its value and purpose. This isn't
strictly always the last touch location, since we may default to the focused element location instead if the
last touch location is outside of the element rect.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
Tweak a constant that determines the minimum amount of margin to leave between the selection rect and the edge
of the window when scrolling to reveal the focused element. Previously, this was larger than necessary to
accomodate for the fact that the "selection rect" used when zooming to the focused element did not take the
actual selection into account at all, and was simply a 1 by 1 rect; this meant that the margin needed to be
large enough to exceed the usual height of a text caret in editable content. Since we now use the real selection
rect, we can be much less generous with this margin.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
Don't additionally update the selection in the middle of triggering zooming to the focused element; on
particular versions of iOS, this now attempts to scroll the selection rect on-screen, which then conflicts with
zooming to reveal the focused element.
(-[WKContentView _zoomToRevealFocusedElement]):
Renamed from _displayFormNodeInputView to _zoomToRevealFocusedElement, to make the purpose of this function more
clear. Additionally, pull logic to update the accessory view out of this method, so that it's strictly concerned
with zooming to the focused element.
(-[WKContentView inputView]):
Add a FIXME describing the implications of zooming to the focused element in the implementation of -inputView.
See also: <https://bugs.webkit.org/show_bug.cgi?id=192878>.
(-[WKContentView accessoryTab:]):
Fix a subtle issue when keeping track of _didAccessoryTabInitiateFocus. Currently, this is set to YES in
-accessoryTab: and unset in _displayFormNodeInputView, but since _displayFormNodeInputView may be invoked
multiple times for the same focused element (see: -inputView), we might end up zooming to the focused element
with _didAccessoryTabInitiateFocus set to NO, even though we initiated focus with the previous/next buttons.
Instead, temporarily set a different ivar, _isChangingFocusUsingAccessoryTab, to YES in -accessoryTab:, and
unset it in the completion handler after the focused element has changed. Then, when we _startAssistingNode:,
set _didAccessoryTabInitiateFocus to _isChangingFocusUsingAccessoryTab. This ensures that the correctness of
_didAccessoryTabInitiateFocus isn't tied to the number of times -[WKContentView inputView] is invoked when
focusing an element.
(shouldZoomToRevealSelectionRect):
(rectToRevealWhenZoomingToFocusedElement):
Add a helper method to determine the selection rect to use when zooming to reveal the focused element. ASSERTs
that we have post-layout data in the EditorState.
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
When "assisting" a focused element, immediately zoom to it if we don't need selection information to compute the
rect to zoom to; otherwise, defer zooming until we receive the first editor state update in the UI process that
contains information about our selection rects.
(-[WKContentView _stopAssistingNode]):
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
If necessary, reveal the focused element by zooming.
(-[WKContentView _updateInitialWritingDirectionIfNecessary]):
Pull this initial writing direction update logic out into a separate helper method.
(-[WKContentView _displayFormNodeInputView]): Deleted.
Replaced by _zoomToRevealFocusedElement.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::elementDidRefocus):
This currently calls WebChromeClient::elementDidFocus; instead, call the new WebPage::elementDidRefocus;
additionally, make this available on all PLATFORM(COCOA), rather than just IOS_FAMILY.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::elementDidRefocus): Deleted.
Replaced by the PLATFORM(COCOA) version.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidRefocus):
When refocusing an element, ensure that post-layout editor state data is sent to the UI process by including a
full EditorState in the next layer tree transaction.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
Call elementDidRefocus instead of elementDidFocus, in the case where the existing focused element is clicked.
(WebKit::WebPage::getAssistedNodeInformation):
Adjust for the change from selectionRect to elementInteractionLocation.
2018-12-20 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Grant the sandbox read access to XDG_DATA_HOME/prgname
https://bugs.webkit.org/show_bug.cgi?id=192929
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitWebContext.cpp:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
2018-12-20 Chris Dumez <cdumez@apple.com>
[PSON] SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache
https://bugs.webkit.org/show_bug.cgi?id=192873
Reviewed by Antti Koivisto.
SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache, preventing
the process from suspending on iOS.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
(WebKit::SuspendedPageProxy::didReceiveMessage):
(WebKit::SuspendedPageProxy::didSuspend): Deleted.
(WebKit::SuspendedPageProxy::didFailToSuspend): Deleted.
* UIProcess/SuspendedPageProxy.h:
2018-12-19 Chris Dumez <cdumez@apple.com>
wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
https://bugs.webkit.org/show_bug.cgi?id=192728
<rdar://problem/46746779>
Reviewed by Geoff Garen.
* NetworkProcess/*:
* Platform/*:
* Scripts/*:
* Shared/*:
* UIProcess/*:
* WebProcess/*:
2018-12-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence -Wpragmas warning
* WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2018-12-19 Vivek Seth <v_seth@apple.com>
HTTPS Upgrade: Use full sqlite upgrade list
https://bugs.webkit.org/show_bug.cgi?id=192736
<rdar://problem/45851427>
Reviewed by Chris Dumez.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added.
(WebKit::NetworkHTTPSUpgradeCheckerDatabasePath):
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
(WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
(WebKit::NetworkHTTPSUpgradeChecker::query):
(WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const):
* NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added.
(WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const):
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
2018-12-19 Tim Horton <timothy_horton@apple.com>
Use delegate instead of drawingDelegate in WKDrawingView
https://bugs.webkit.org/show_bug.cgi?id=192899
<rdar://problem/46733339>
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Do the dance.
2018-12-19 Alex Christensen <achristensen@webkit.org>
Navigations away from the SafeBrowsing interstitial show a flash of old content
https://bugs.webkit.org/show_bug.cgi?id=192676
Reviewed by Chris Dumez.
When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination.
Otherwise, the user will confusingly see the page before the warning while the navigation happens.
We can only do this for warnings caused by main frame navigations, though. Other warnings (such as those caused by iframes)
need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back.
This change is reflected in an updated API test.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning forMainFrameNavigation]):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
(WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
* UIProcess/PageClient.h:
(WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::forMainFrameNavigation const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReachLayoutMilestone):
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation):
2018-12-19 Tim Horton <timothy_horton@apple.com>
UI process crash when focusing an editable image
https://bugs.webkit.org/show_bug.cgi?id=192839
<rdar://problem/46786670>
Reviewed by Wenson Hsieh.
* SourcesCocoa.txt:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView inputView]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView _installInkPickerForDrawingViewWithID:]):
(-[WKContentView _uninstallInkPicker]):
* UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h.
* UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm.
(-[WKInkPickerView initWithDrawingView:]):
(-[WKInkPickerView didPickInk]):
(-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
(-[WKInkPickerView inlineInkPicker:didSelectTool:]):
(-[WKInkPickerView inlineInkPicker:didSelectColor:]):
(-[WKInkPickerView inkPickerSize]):
(-[WKInkPickerView layoutSubviews]):
(-[WKInkPickerView sizeThatFits:]):
(-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
* WebKit.xcodeproj/project.pbxproj:
Make WKInkPickerView a WKWebView subview instead of an inputView.
Also, don't force the keyboard to be visible when an editable image is focused.
2018-12-19 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Force system camera/microphone TCC prompt if necessary
https://bugs.webkit.org/show_bug.cgi?id=192820
<rdar://problem/42680098>
Reviewed by Jer Noble.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check
and prompt on Mojave.
2018-12-19 Megan Gardner <megan_gardner@apple.com>
Allow clients to set the navigator platform
https://bugs.webkit.org/show_bug.cgi?id=192735
Reviewed by Tim Horton.
Add private API to allow clients to override the default navigator
platform. Some websites check for the platform, which
interfears with our request desktop site feature. This should
help more sites function as expected.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
(-[_WKWebsitePolicies customNavigatorPlatform]):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2018-12-19 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r239358.
Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
crash on Debug bots
Reverted changeset:
"Clean up IndexedDB files between tests"
https://bugs.webkit.org/show_bug.cgi?id=192796
https://trac.webkit.org/changeset/239358
2018-12-18 Alex Christensen <achristensen@webkit.org>
REGRESSION(r239134) iOS safe browsing warning unable to show details
https://bugs.webkit.org/show_bug.cgi?id=192837
Reviewed by Tim Horton.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning addContent]):
I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
differently in TestWebKitAPI, but I verified manually that this fixes the issue.
2018-12-18 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix compilation warnings under Source/WebKit directory
https://bugs.webkit.org/show_bug.cgi?id=192695
Reviewed by Alex Christensen.
* NetworkProcess/cache/NetworkCacheData.cpp:
(makeSalt): Enclosed by #if !OS(WINDOWS).
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::directoryEntryType): Ditto.
* Platform/win/ModuleWin.cpp:
(WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
* UIProcess/DrawingAreaProxyImpl.h: Ditto.
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::processName): Removed the duplicated 'const' type qualifier.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
(WebKit::WebInspectorProxy::platformDetach): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint): Ditto.
(WebKit::WebPopupMenu::setUpPlatformData): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
* WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.
2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
https://bugs.webkit.org/show_bug.cgi?id=192836
<rdar://problem/45321184>
Reviewed by Tim Horton.
r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`,
wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently
happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally
reload the table view; however, in the case where the number of suggestions decreased and the frame changed
(which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in
the `_suggestions` vector.
To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s
frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`.
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionsView updateWithInformation:]):
2018-12-18 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 4.
Add some additional temporary logging info to determine if the time out value passed to the timer is right.
Once the bug is determined and fixed, we should remove all logging added in this patch.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::initTimeOutTimer):
2018-12-18 Sihui Liu <sihui_liu@apple.com>
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
Reviewed by Geoffrey Garen.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllIndexedDatabasesSync):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
2018-12-18 Vivek Seth <v_seth@apple.com>
HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
https://bugs.webkit.org/show_bug.cgi?id=192612
<rdar://problem/46651207>
Reviewed by Andy Estes.
* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* Scripts/generate-https-upgrade-database.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the 32-bit watchOS build after r239314
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2018-12-18 Alex Christensen <achristensen@webkit.org>
WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
https://bugs.webkit.org/show_bug.cgi?id=192675
Reviewed by Geoffrey Garen.
When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::url const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2018-12-18 Chris Dumez <cdumez@apple.com>
Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
https://bugs.webkit.org/show_bug.cgi?id=192772
Reviewed by Antti Koivisto.
With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
regress performance when trying to navigate back in history to that page. This would also regress
performance when link-navigating to the same domain as we would have previously reused the suspended
page's process for such navigation.
Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
not the suspended page itself.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didFailToSuspend):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-12-17 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 3.
Add some additional temporary logging info to determine if the timer is working as expected.
Once the bug is determined and fixed, we should remove all logging added in this patch.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
2018-12-17 Saam barati <sbarati@apple.com>
Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
https://bugs.webkit.org/show_bug.cgi?id=192374
<rdar://problem/46506286>
Reviewed by Alex Christensen.
This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
To enable on iOS, you can do something like:
$ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
$ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
This patch also changes the Proxy to be enabled on a per NSURLSession
basis instead of a per process basis.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::overrideSystemProxies): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration httpProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
(-[_WKWebsiteDataStoreConfiguration httpsProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::httpProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
(WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
2018-12-17 Wenson Hsieh <wenson_hsieh@apple.com>
Tap highlights should not be shown on iOSMac
https://bugs.webkit.org/show_bug.cgi?id=192797
<rdar://problem/46793995>
Reviewed by Tim Horton.
WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):
2018-12-17 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOSMac engineering build again
After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
`WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
`ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
`ENABLE(FULL_KEYBOARD_ACCESS)`.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
2018-12-17 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOSMac engineering build
`generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
an unused function warning.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2018-12-17 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
<https://webkit.org/b/192707>
<rdar://problem/46734926>
Reviewed by Daniel Bates.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateCPUMonitorState):
- Pass m_cpuLimit directly since getting its value causes an
identical std::optional<double> to be created unnecessarily.
2018-12-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Focusing a large editable element always scrolls to the top of the element
https://bugs.webkit.org/show_bug.cgi?id=192745
<rdar://problem/46758445>
Reviewed by Tim Horton.
Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect
is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the
width or height of the visible area, we instead scroll such that the top left point of the element is at the top
left corner of the visible area.
However, this results in unnecessary scrolling if the top of the element is already near the top of the visible
area. For WebKit2-based rich text editors that have an editable body element with a top content inset that
contains additional content, this means we will always scroll the additional content away when focusing the
editable body.
To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be
centered in the visible area, such that we only scroll the top left position of the focused element to the top
half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large
editable elements, while still making it clear which element is being focused.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping
values by comparing and setting values.
Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are
currently offset by half the difference between the bottom inset amount and the top inset amount, in the case
where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari).
* UIProcess/API/Cocoa/WKWebViewInternal.h:
Make a couple of arguments `const FloatRect&` instead of just `FloatRect`.
2018-12-17 Ryosuke Niwa <rniwa@webkit.org>
offsetLeft and offsetParent should adjust across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=157437
<rdar://problem/26154021>
Reviewed by Simon Fraser.
Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
(webkit_dom_element_get_offset_left):
(webkit_dom_element_get_offset_top):
(webkit_dom_element_get_offset_parent):
2018-12-17 Chris Fleizach <cfleizach@apple.com>
Some builds are broken after r239262
https://bugs.webkit.org/show_bug.cgi?id=192777
Reviewed by Simon Fraser.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher init]):
Fix the build by being more clear about when it's OK to use AccessibilitySupport.
2018-12-17 Chris Dumez <cdumez@apple.com>
Allow passing nil as session state to [WKWebView _restoreSessionState:]
https://bugs.webkit.org/show_bug.cgi?id=192789
<rdar://problem/46755277>
Reviewed by Alex Christensen.
Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restoreSessionState:andNavigate:]):
2018-12-17 Alex Christensen <achristensen@webkit.org>
Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame
https://bugs.webkit.org/show_bug.cgi?id=192744
<rdar://problem/45842668>
Reviewed by Chris Dumez.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
Things happen. Navigations can be null. If they are, we shouldn't dereference pointers to them.
2018-12-17 Chris Dumez <cdumez@apple.com>
Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-17 Suresh Koppisetty <skoppisettyt@apple.com>
Rollout r235411
https://bugs.webkit.org/show_bug.cgi?id=192778
<rdar://46789485>
Disabling access to CoreServices is causing a performance
regression in process launch time. See <rdar://46141878>
Reviewed by Alex Christensen.
* WebProcess/com.apple.WebProcess.sb.in:
2018-12-17 Zan Dobersek <zdobersek@igalia.com>
Unreviewed WPE build fix after r239277.
* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting):
Use the WebKit:: namespace specifier as it is used across this file.
2018-12-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765
unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).
Reverted changesets:
"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265
"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274
2018-12-17 Daniel Bates <dabates@apple.com>
Implement UIScriptController::toggleCapsLock() for iOS
https://bugs.webkit.org/show_bug.cgi?id=191815
Reviewed by Andy Estes.
Add test infrastructure to clear the current modifier state. We will use this to ensure that
the caps lock state does not persist between tests.
* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2018-12-17 David Kilzer <ddkilzer@apple.com>
REGRESSION (r239262): Fix broken builds prior to Mojave
<https://bugs.webkit.org/show_bug.cgi?id=192373>
<rdar://problem/46462670>
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.
2018-12-17 Daniel Bates <dabates@apple.com>
[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
https://bugs.webkit.org/show_bug.cgi?id=192633
Reviewed by Wenson Hsieh.
Update code to use the modern initializer.
* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]):
2018-12-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r239254.
This broke the Windows 10 Debug build
Reverted changeset:
"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254
2018-12-17 David Kilzer <ddkilzer@apple.com>
clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
<https://webkit.org/b/192751>
<rdar://problem/46771623>
Reviewed by Daniel Bates.
Change loop variables to const references to avoid unnecessary
copies.
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::~WebSWServerConnection):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSErrors):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcess):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
2018-12-17 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Add webkit_uri_for_display for GTK and WPE.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:
2018-12-17 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224
Reviewed by Michael Catanzaro.
Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.
* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
2018-12-16 Chris Fleizach <cfleizach@apple.com>
AX: Support keyboard access preference for iOS in WebKit
https://bugs.webkit.org/show_bug.cgi?id=192373
<rdar://problem/46462670>
Reviewed by Tim Horton.
* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
(-[WKFullKeyboardAccessWatcher init]):
(+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
* UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
* UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:
2018-12-16 Adrian Perez de Castro <aperez@igalia.com>
Unreviewed follow up after r239260
https://bugs.webkit.org/show_bug.cgi?id=192714
<rdar://problem/46762407>
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
of going through the protectAttribute() function, which is removed
because it is now unused.
2018-12-16 Adrian Perez de Castro <aperez@igalia.com>
Unify SharedMemory factory functions
https://bugs.webkit.org/show_bug.cgi?id=192714
Reviewed by Darin Adler.
This unifies SharedMemory so in the following way, across platforms:
- SharedMemory::create() is removed, to avoid ambiguity.
- SharedMemory::allocate() always allocates a new block of shared memory.
- SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
existing region of memory resulting from memory-mapping a file.
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
* Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
SharedMemory::wrapMap() available on OS(DARWIN) as well.
* Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::SharedMemory::wrapMap): Renamed from ::create().
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create().
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create()
* UIProcess/API/APIContentRuleListStore.cpp:
(API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
SharedMemory::create().
2018-12-15 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 7: Files in UIProcess/API
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetTypeID):
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
(WKAuthenticationDecisionListenerGetTypeID):
(WKAuthenticationDecisionListenerUseCredential):
(WKAuthenticationDecisionListenerCancel):
(WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
* UIProcess/API/C/WKBackForwardListItemRef.cpp:
(WKBackForwardListItemGetTypeID):
(WKBackForwardListItemCopyURL):
(WKBackForwardListItemCopyTitle):
(WKBackForwardListItemCopyOriginalURL):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetTypeID):
(WKContextCreate):
(WKContextCreateWithInjectedBundlePath):
(WKContextCreateWithConfiguration):
(WKContextSetClient):
(WKContextSetInjectedBundleClient):
(WKContextSetHistoryClient):
(WKContextSetDownloadClient):
(WKContextSetConnectionClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
(WKContextSetInitializationUserDataForInjectedBundle):
(WKContextPostMessageToInjectedBundle):
(WKContextGetGlobalStatistics):
(WKContextAddVisitedLink):
(WKContextClearVisitedLinks):
(WKContextSetCacheModel):
(WKContextGetCacheModel):
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
(WKContextSetAlwaysUsesComplexTextCodePath):
(WKContextSetShouldUseFontSmoothing):
(WKContextSetAdditionalPluginsDirectory):
(WKContextRefreshPlugIns):
(WKContextRegisterURLSchemeAsEmptyDocument):
(WKContextRegisterURLSchemeAsSecure):
(WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
(WKContextRegisterURLSchemeAsCachePartitioned):
(WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
(WKContextSetDomainRelaxationForbiddenForURLScheme):
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
(WKContextSetPrewarmsProcessesAutomatically):
(WKContextSetCustomWebContentServiceBundleIdentifier):
(WKContextSetDiskCacheSpeculativeValidationEnabled):
(WKContextPreconnectToServer):
(WKContextGetCookieManager):
(WKContextGetWebsiteDataStore):
(WKContextGetGeolocationManager):
(WKContextGetMediaSessionFocusManager):
(WKContextGetNotificationManager):
(WKContextStartMemorySampler):
(WKContextStopMemorySampler):
(WKContextAllowSpecificHTTPSCertificateForHost):
(WKContextDisableProcessTermination):
(WKContextEnableProcessTermination):
(WKContextSetHTTPPipeliningEnabled):
(WKContextWarmInitialProcess):
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
(WKContextJavaScriptConfigurationFileEnabled):
(WKContextSetJavaScriptConfigurationFileEnabled):
(WKContextGarbageCollectJavaScriptObjects):
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
(WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
(WKContextClearCachedCredentials):
(WKContextCopyPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
(WKContextSetPlugInAutoStartOrigins):
(WKContextSetInvalidMessageFunction):
(WKContextSetMemoryCacheDisabled):
(WKContextSetFontWhitelist):
(WKContextTerminateNetworkProcess):
(WKContextTerminateServiceWorkerProcess):
(WKContextGetNetworkProcessIdentifier):
(WKContextAddSupportedPlugin):
(WKContextClearSupportedPlugins):
(WKContextSetIDBPerOriginQuota):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
2018-12-15 Darin Adler <darin@apple.com>
Use warning-ignoring macros more consistently and simply
https://bugs.webkit.org/show_bug.cgi?id=192743
Reviewed by Mark Lam.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]): Ditto.
* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
because there is no need to accomodate non-clang compilers here.
Also use #pragma once, add a missing "explicit", and fix conditionals.
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.
2018-12-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, fix the build with recent SDKs.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
2018-12-14 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 2.
Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to
rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all
logging added in this patch.
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::deviceAdded):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::Worker::write):
(WebKit::CtapHidDriver::Worker::read):
(WebKit::CtapHidDriver::Worker::returnMessage):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::continueAfterResponseReceived):
2018-12-14 Adrian Perez de Castro <aperez@igalia.com>
[GTK] Unreviewed build fix.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include.
2018-12-14 Chris Dumez <cdumez@apple.com>
Unreviewed, fix assertion failure in API test after r239210.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createDocumentLoader):
2018-12-14 Adrian Perez de Castro <aperez@igalia.com>
[SOUP] Unreviewed build fix after r239219
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove
handling of PolicyAction::Suspend, which is no longer available.
2018-12-14 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed, apply post-landing review comments after r239221.
* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
Switch to WTF::blankURL() instead of using "about:blank" directly.
2018-12-14 Chris Dumez <cdumez@apple.com>
[PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls
https://bugs.webkit.org/show_bug.cgi?id=192704
Reviewed by Geoffrey Garen.
Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This
is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when
doing a LoadData.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
* WebProcess/WebPage/WebPage.h:
2018-12-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
https://bugs.webkit.org/show_bug.cgi?id=192691
<rdar://problem/46719798>
Reviewed by Darin Adler.
* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
Instead of an empty string, return "about:blank" in bail cases.
When inspecting the page that matches the contents.
2018-12-14 Chris Dumez <cdumez@apple.com>
[PSON] Stop exposing PolicyAction::Suspend to WebCore
https://bugs.webkit.org/show_bug.cgi?id=192701
Reviewed by Brady Eidson.
Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments
WebCore::PolicyAction with a "Suspend" value.
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionResponseDisposition):
* Shared/WebPolicyAction.h: Added.
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-12-14 David Quesada <david_quesada@apple.com>
Remove a global 'using namespace WebKit' in WebViewImpl.mm
https://bugs.webkit.org/show_bug.cgi?id=192690
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKTextListTouchBarViewController initWithWebViewImpl:]):
(-[WKTextListTouchBarViewController _selectList:]):
(-[WKTextListTouchBarViewController setCurrentListType:]):
(-[WKTextTouchBarItemController initWithWebViewImpl:]):
2018-12-14 Chris Dumez <cdumez@apple.com>
[PSON] WebsitePolicies are lost on process-swap
https://bugs.webkit.org/show_bug.cgi?id=192694
<rdar://problem/46715748>
Reviewed by Brady Eidson.
In case of process-swap on navigation, instead of sending the websitePolicies to the old
process, send them to the new process as we trigger the navigation. We tell the new process
that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
(WebKit::WebPage::goToBackForwardItem):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-12-14 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
https://bugs.webkit.org/show_bug.cgi?id=192622
Reviewed by Michael Catanzaro.
This fixes running with the sandbox enabled in Flatpak.
* UIProcess/Launcher/glib/FlatpakLauncher.cpp:
(WebKit::flatpakSpawn):
* UIProcess/Launcher/glib/FlatpakLauncher.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
2018-12-14 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Use new view state API from libwpe
https://bugs.webkit.org/show_bug.cgi?id=191906
Reviewed by Žan Doberšek.
Remove WKViewSetViewState from the C API.
* UIProcess/API/C/wpe/WKAPICastWPE.h:
* UIProcess/API/C/wpe/WKView.cpp:
* UIProcess/API/C/wpe/WKView.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
(WKWPE::View::setViewState): Remove the default flags.
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::setViewState const): Make it private.
2018-12-13 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>
Reviewed by Simon Fraser.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.
2018-12-13 Chris Dumez <cdumez@apple.com>
Unreviewed build fix for tvOS.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-13 Chris Dumez <cdumez@apple.com>
Unreviewed build fix for tvOS.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-13 Chris Dumez <cdumez@apple.com>
[PSON] We should not need to navigate to 'about:blank' to suspend pages
https://bugs.webkit.org/show_bug.cgi?id=192668
<rdar://problem/46701466>
Reviewed by Alex Christensen.
To support PageCache when process-swap on cross-site navigation is enabled,
we've been navigating the previous process to 'about:blank' when swapping.
This would trigger PageCaching of the page in the old process. While
convenient, this design has led to a lot of bugs because we did not really
want a navigation to happen in the old process.
To address the issue, when a WebPage is asked to suspend (for process-swap),
we now attempt to add it to PageCache and save it on the current HistoryItem,
*without* triggering any navigation. Any pending navigation gets cancelled
and we just suspend in place.
Later on, when we want to go back to this HistoryItem, we simply leverage the
existing WebPage::goToBackForwardItem() code path. The only subtlety is that
we're actually asking the WebPage to load a HistoryItem that is the current
one in the History. I had to tweak a some logic / assertions to support this
as this is not something we usually do. However, it actually works with very
little changes and successfully restores the PageCache entry on the current
HistoryItem.
There is no expected overall behavior change and ProcessSwap API tests (which
cover PageCache) still pass. This is merely a simpler design because it avoids
navigating to about:blank.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didReceiveMessage):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):
2018-12-13 Per Arne Vollan <pvollan@apple.com>
[macOS] Remove with-report from 3 services that are currently needed on macOS
https://bugs.webkit.org/show_bug.cgi?id=192593
<rdar://problem/46604752>
Reviewed by Brent Fulgham.
* WebProcess/com.apple.WebProcess.sb.in:
2018-12-13 Youenn Fablet <youenn@apple.com>
On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
https://bugs.webkit.org/show_bug.cgi?id=192657
Reviewed by Eric Carlson.
Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page.
This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager):
(WebKit::UserMediaPermissionRequestManager::clear):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):
2018-12-13 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 6: Files in plugin process and UI process.
* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/mac/WebPageProxyMac.mm:
2018-12-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Calculate width or height when constraints contain only the other
https://bugs.webkit.org/show_bug.cgi?id=192632
<rdar://problem/46665734>
Reviewed by Youenn Fablet.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted,
replaced with videoSampleAvailable.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame
size if necessary when calculating new frame size.
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 5: Files in WebProcess folder.
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2018-12-12 Ross Kirsling <ross.kirsling@sony.com>
[MSVC] Unreviewed build fix for r239080.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 4: Handling NetworkProcess folder.
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Tim Horton.
Fix iosmac build.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _hoverGestureRecognizerChanged:]):
2018-12-12 Alex Christensen <achristensen@webkit.org>
Implement safe browsing in WebKit on WatchOS
https://bugs.webkit.org/show_bug.cgi?id=192641
<rdar://problem/46376188>
Reviewed by Geoff Garen.
WatchOS has a few special requirements:
1. The margin size needs to be smaller and the title font smaller to fit on the screen.
2. The exclamation point cannot be beside the title or it won't fit on the screen. I put it above the title.
3. The application must be told when the safe browsing warning has been shown. I added a new delegate callback.
4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons.
This was already an issue on small WKWebViews on iOS, so this fixes both operating systems.
* Configurations/WebKit.xcconfig:
* UIProcess/API/APIUIClient.h:
(API::UIClient::didShowSafeBrowsingWarning):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning):
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
(buttonSize):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingWarning updateContentSize]):
(buttonWidth): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2018-12-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239129 and r239131.
https://bugs.webkit.org/show_bug.cgi?id=192646
Casued macOS and iOS Debug testing to fail early (Requested by
Truitt on #webkit).
Reverted changesets:
"Unreviewed build fix for WinCairo Debug after r239080(?)."
https://trac.webkit.org/changeset/239129
"Unreviewed fix for Cocoa Debug test instability following
r239129."
https://trac.webkit.org/changeset/239131
2018-12-12 Vivek Seth <v_seth@apple.com>
HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
https://bugs.webkit.org/show_bug.cgi?id=192375
<rdar://problem/45851159>
Reviewed by Chris Dumez.
Use simulated redirect to tell clients that HTTPS Upgrade happened.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* NetworkProcess/PingLoad.cpp:
2018-12-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed fix for Cocoa Debug test instability following r239129.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
Move the whole assertion to the declaration site.
2018-12-12 Chris Dumez <cdumez@apple.com>
Add a preference to enable / disable devicemotion and deviceorientation events
https://bugs.webkit.org/show_bug.cgi?id=192631
<rdar://problem/46646244>
Reviewed by Geoffrey Garen.
Add setting to toggle support for the deviceorientation / devicemotion events:
- https://w3c.github.io/deviceorientation/
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setDeviceOrientationEventEnabled:]):
(-[WKPreferences _deviceOrientationEventEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2018-12-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed build fix for WinCairo Debug after r239080(?).
MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
Move NO_RETURN_DUE_TO_ASSERT to the declaration site.
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 2: UIProcess/Cocoa and UIProcess/ios folders.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 1: Files in Shared folder.
* Shared/API/c/WKRenderLayer.cpp:
(WKRenderLayerGetFrameContentsLayer):
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/API/c/mac/WKWebArchive.cpp:
(WKWebArchiveGetTypeID):
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
(WKWebArchiveCopyData):
* Shared/API/c/mac/WKWebArchiveResource.cpp:
(WKWebArchiveResourceGetTypeID):
(WKWebArchiveResourceCreate):
(WKWebArchiveResourceCopyData):
(WKWebArchiveResourceCopyURL):
(WKWebArchiveResourceCopyMIMEType):
(WKWebArchiveResourceCopyTextEncoding):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:
2018-12-12 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>
Reviewed by Darin Adler.
Part 1: Files in NetworkProcess.
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
2018-12-12 Chris Dumez <cdumez@apple.com>
Unreviewed build with with recent macOS SDKs.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-12 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix GTK build after r239104.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction):
2018-12-12 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix build with older SDKs after r239110.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-12 Chris Dumez <cdumez@apple.com>
Unreviewed, fix build with recent SDKs.
* Platform/cocoa/WKCrashReporter.mm:
2018-12-09 Darin Adler <darin@apple.com>
[iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
https://bugs.webkit.org/show_bug.cgi?id=192536
rdar://problem/41174451
Reviewed by Tim Horton.
* UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
this class is not compiled on that platform at this time. Can always
add it back later.
(-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
(-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
Initialize _passwordForPrinting; use a CString instead of retaining
an NSString since we can zero that out easily.
(-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.
2018-12-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239103.
https://bugs.webkit.org/show_bug.cgi?id=192627
It broke the built because it depends on another patch that
didn't land yet (Requested by KaL on #webkit).
Reverted changeset:
"[WPE] Add API to notify about frame displayed view backend
callback"
https://bugs.webkit.org/show_bug.cgi?id=192224
https://trac.webkit.org/changeset/239103
2018-12-12 Chris Dumez <cdumez@apple.com>
Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
https://bugs.webkit.org/show_bug.cgi?id=191982
<rdar://problem/46258054>
Reviewed by Alex Christensen.
Have the WebPageProxy remember the local paths it previously visited so that the
MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.
Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
(WebKit::WebPageProxy::addPreviouslyVisitedPath):
(WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
2018-11-30 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224
Reviewed by Michael Catanzaro.
Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.
* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:
2018-12-11 Justin Michaud <justin_michaud@apple.com>
Implement feature flag for CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=192610
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-12-11 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix warning -Wmissing-field-initializers
https://bugs.webkit.org/show_bug.cgi?id=192584
Reviewed by Yusuke Suzuki.
Initialize a struct with '{ }' instead of '= {0}'.
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::showPopupMenu):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::initializeToolTipWindow):
(WebKit::WebView::setToolTip):
2018-12-11 Chris Dumez <cdumez@apple.com>
PSON logic gets confused by concurrent decidePolicyForNavigationAction requests
https://bugs.webkit.org/show_bug.cgi?id=192482
<rdar://problem/46470145>
Reviewed by Antti Koivisto.
It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the
WebProcess when a new load is started before responding to the existing policy
decision. This would lead to several issues with regards to PSON:
- We would decide to swap for the first policy decision and tell the WebProcess to
suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction
since for the same frame, the previous one is invalidated and the WebProcess would
ignore our request to suspend.
- We would hit assertions later on because the navigation has been destroyed and yet
we're getting a didStartProvisionalLoad for it.
- swapToWebProcess() was asynchronous so that it would wait for the destination
SuspendedPage to finish suspending before asking it to unsuspend. This led to various
problems because anything can happen in the UIProcess while we're waiting for the
suspension (e.g. another load). Also, we may create the SuspendedPageProxy for
the current page too late and start getting IPC from the previous process about
the suspension load to about:blank.
To address these issues, the following design is now implemented:
- swapToWebProcess() is no longer asynchronous
- instead, WebProcessPool::processForNavigation() is now asynchronous. This is better
because at this point we have not yet told the WebProcess about the policy decision.
We already properly deal with the policy decision being made asynchronously. This
also allows us to choose another process if the SuspendedPage we'd like to use
failed to suspend.
- If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an
IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy
the SuspendedPageProxy and make sure it is not used.
- After the asynchronous process selection, if the navigation has been destroy, abort
the process-swap to avoid hitting assertions later on due to doing a load for a
destroyed navigation.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
Make sure m_whenReadyToConsume completion handler gets called if necessary if the
SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not
used.
(WebKit::SuspendedPageProxy::whenReadyToConsume):
Add whenReadyToConsume() utility method to get a completion handler called when
the SuspendedPageProxy is ready to be used. This basically means we have to wait
for the page to finish its about:blank suspension load. If the suspension fails
then we call the completion handler with null to indicate that the suspended
page is not usable.
(WebKit::SuspendedPageProxy::unsuspendAndConsume):
Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets
called after whenReadyToConsume()'s completion handler has been called and if we
do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and
removes the SuspendedPageProxy from the WebProcessPool.
(WebKit::SuspendedPageProxy::didFinishLoad):
rename m_finishedSuspendingHandler to m_whenReadyToConsume.
(WebKit::SuspendedPageProxy::didFailToSuspend):
Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling
us it ignored our request to suspend. We then call m_whenReadyToConsume completion
handler with null and destroy the SuspendedPageProxy.
(WebKit::SuspendedPageProxy::didReceiveMessage):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebNavigationState.h:
(WebKit::WebNavigationState::hasNavigation const):
Add utility function to query if a navigation is still valid.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
Update method so that it is no longer asynchronous. Some of its code was also moved to
continueNavigationInNewProcess() for clarity.
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
Deal with WebProcessPool::processForNavigation() now being asynchronous.
(WebKit::WebPageProxy::continueNavigationInNewProcess):
Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess()
code was also moved here for clarity.
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Add new DidFailToSuspendAfterProcessSwap IPC message.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call
whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy
fails to suspend use a new process instead.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap
IPC to the UIProcess so that the SuspendedPageProxy knows about it.
2018-12-11 Andy Estes <aestes@apple.com>
Introduce makeBlockPtr for lambdas
https://bugs.webkit.org/show_bug.cgi?id=192594
Reviewed by Alex Christensen.
Adopted makeBlockPtr.
* NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
(-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::write):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::clearDiskCache):
(WebKit::saveCookies):
* NetworkProcess/watchos/NetworkProximityAssertion.mm:
(WebKit::BluetoothProximityAssertion::suspend):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView maybeInstallIconLoadingClient]):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
(WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::runJavaScriptAlert):
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
(WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
(WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
(WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
(WebKit::UIDelegate::UIClient::windowFrame):
(WebKit::UIDelegate::UIClient::toolbarsAreVisible):
(WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
(WebKit::UIDelegate::UIClient::runOpenPanel):
(WebKit::requestUserMediaAuthorizationForDevices):
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
(WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
(WebKit::UIDelegate::UIClient::requestPointerLock):
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning clickedOnLink:]):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
* UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
(WebKit::HidConnection::send):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
* UIProcess/mac/ServicesController.mm:
(WebKit::hasCompatibleServicesForItems):
(WebKit::ServicesController::refreshExistingServices):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(PageLoaderClient::didStartProvisionalLoadForFrame):
2018-12-11 Alex Christensen <achristensen@webkit.org>
Fix an internal build failure after r239014
https://bugs.webkit.org/show_bug.cgi?id=192205
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle.
2018-12-11 Brian Burg <bburg@apple.com>
SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler
https://bugs.webkit.org/show_bug.cgi?id=191155
<rdar://problem/45745569>
Reviewed by Joseph Pecoraro.
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state.
webkitdriver needs to be updated to not produce such states in this scenario, but this will
avoid a runtime crash caused by trying to call a moved-out completion handler a second time.
2018-12-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239071.
https://bugs.webkit.org/show_bug.cgi?id=192588
Broke WPE build due to undefined references to toAPI() and
toImpl() inside the C API (Requested by magomez on #webkit).
Reverted changeset:
"[meta][WebKit] Remove using namespace WebCore and WebKit in
the global scope for unified source builds"
https://bugs.webkit.org/show_bug.cgi?id=192449
https://trac.webkit.org/changeset/239071
2018-12-10 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
Reviewed by Darin Adler.
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2018-12-10 Don Olmstead <don.olmstead@sony.com>
Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=192573
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2018-12-10 Youenn Fablet <youenn@apple.com>
Remove derived classes of RealtimeMediaSourceCenter
https://bugs.webkit.org/show_bug.cgi?id=192546
Reviewed by Eric Carlson.
pdate code according WebCore changes.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::initialize):
2018-12-10 Tim Horton <timothy_horton@apple.com>
Animated scrolling on Google Maps scrolls the page in addition to moving the map
https://bugs.webkit.org/show_bug.cgi?id=192521
<rdar://problem/46382007>
Reviewed by Sam Weinig.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
Only do keyboard-based rubber-banding in directions that we can actually
scroll, not directions we can only finger-rubber-band in. This effectively
means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}".
2018-12-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239023.
https://bugs.webkit.org/show_bug.cgi?id=192571
Speculative rollout due to broken perf test (Requested by
deanj on #webkit).
Reverted changeset:
"Enable HTTP and HTTPS proxies on iOS and make it a property
of the NSURLSession"
https://bugs.webkit.org/show_bug.cgi?id=192374
https://trac.webkit.org/changeset/239023
2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOS build after r239039.
https://bugs.webkit.org/show_bug.cgi?id=192568
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:sessionDidUpdate:]):
2018-12-10 Alex Christensen <achristensen@webkit.org>
Fix WatchOS build.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionNameForFocusedFormControlView:]):
2018-12-10 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r239029.
This patch caused internal build failures.
Reverted changeset:
"[meta][WebKit] Remove using namespace WebCore and WebKit in
the global scope for unified source builds"
https://bugs.webkit.org/show_bug.cgi?id=192449
https://trac.webkit.org/changeset/239029
2018-12-10 Chris Dumez <cdumez@apple.com>
Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192509
<rdar://problem/46500832>
Reviewed by Alex Christensen.
Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
it at resource-level from the injected bundle.
The custom user-agent string can now be set on _WKWebsitePolicies during the
decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
future subresource loads.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomUserAgent:]):
(-[_WKWebsitePolicies customUserAgent]):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2018-12-10 Alex Christensen <achristensen@webkit.org>
Safe browsing warning should layout buttons vertically in narrow WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=192535
<rdar://problem/46308364>
Reviewed by Tim Horton.
They're usually next to each other, but in narrow WKWebViews they currently get clipped.
In order to make it more likely that both buttons are completely visible, put one above
the other if the WKWebView is too narrow to completely show both. This also helps with
languages where the translations of "Go Back" or "Show Details" are rendered wider than English.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(buttonWidth):
(-[WKSafeBrowsingWarning addContent]):
2018-12-10 Simon Fraser <simon.fraser@apple.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>
Re-land r239010 after over-zealous rollout.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Caret is obscured by finger when dragging over an editable element
https://bugs.webkit.org/show_bug.cgi?id=192499
<rdar://problem/46570101>
Reviewed by Tim Horton.
Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
are covered by adding to existing API tests.
* Scripts/webkit/messages.py:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
be easily removed once Safari adopts this new version.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.
(WebKit::WebPageProxy::resetCurrentDragInformation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragHandlingMethod const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:sessionDidUpdate:]):
Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
`precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
"editing plain text".
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:
2018-12-10 Youenn Fablet <youenn@apple.com>
Make mock capture happen in the process used for real capture
https://bugs.webkit.org/show_bug.cgi?id=192544
Reviewed by Eric Carlson.
Make mock capture happen in the right process by only overriding
factories by mock factories for source types that UserMediaCaptureManager will not override.
That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::initialize):
2018-12-10 Alexey Proskuryakov <ap@apple.com>
Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192428
Reviewed by Tim Horton.
* config.h:
2018-12-10 Alexey Proskuryakov <ap@apple.com>
Move more macros out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192430
Reviewed by Tim Horton.
* config.h:
2018-12-10 Chris Fleizach <cfleizach@apple.com>
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
Reviewed by Darin Adler.
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2018-12-10 Tim Horton <timothy_horton@apple.com>
WKWebView should support custom tintColor
https://bugs.webkit.org/show_bug.cgi?id=192518
<rdar://problem/37243261>
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertionPointColor]):
(-[WKContentView selectionBarColor]):
(-[WKContentView selectionHighlightColor]):
Grab insertion point and selection colors from UITextInputTraits.
(-[WKContentView _updateInteractionTintColor]):
Determine our effective tint color:
- transparent if interaction is disabled
- a CSS-derived color if caret-color style is applied
- the _inheritedInteractionTintColor, which climbs up to the tintColor API
Apply it to our UITextInputTraits.
(-[WKContentView tintColorDidChange]):
(-[WKContentView textInputTraits]):
Call _updateInteractionTintColor whenever we create a new UITextInputTraits
or when the tint color changes.
2018-12-09 Youenn Fablet <youenn@apple.com>
Move capture manager from RealtimeMediaSourceCenter to capture factory
https://bugs.webkit.org/show_bug.cgi?id=192542
Reviewed by Eric Carlson.
Make sure to unregister for video capture as done for other capture types.
Implement manager which should be doing nothing as the manager is used for enumeration of devices
which should only happen in UIProcess.
Given that mock capture is interfering with UserMediaCaptureManager,
switching on/off mock capture will require creating a new process.
This shortcoming should be fixed once mock capture will be fully happening in
the same process as regular capture.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2018-12-09 Saam barati <sbarati@apple.com>
Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
https://bugs.webkit.org/show_bug.cgi?id=192374
<rdar://problem/46506286>
Reviewed by Alex Christensen.
This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
To enable on iOS, you can do something like:
$ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
$ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
This patch also changes the Proxy to be enabled on a per NSURLSession
basis instead of a per process basis.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::overrideSystemProxies): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration httpProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
(-[_WKWebsiteDataStoreConfiguration httpsProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::httpProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
(WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
2018-12-09 Adrian Perez de Castro <aperez@igalia.com>
Build failure due to missing include of APIWebsiteDataStore.h
https://bugs.webkit.org/show_bug.cgi?id=192541
Reviewed by Youenn Fablet.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
include of APIWebsiteDataStore.h
2018-12-09 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
https://bugs.webkit.org/show_bug.cgi?id=192538
Reviewed by Tim Horton.
Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
`RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
iOS simulator; instead, I manually verified using MobileAttachments.app.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):
2018-12-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239010.
https://bugs.webkit.org/show_bug.cgi?id=192537
Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
scrolling-layers-state.html again (Requested by ap on
#webkit).
Reverted changeset:
"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/239010
2018-12-08 Alex Christensen <achristensen@webkit.org>
Don't programmatically capitalize safe browsing warning buttons
https://bugs.webkit.org/show_bug.cgi?id=192531
<rdar://problem/46417791>
Reviewed by Darin Adler.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(makeButton):
2018-12-08 Alex Christensen <achristensen@webkit.org>
Safe browsing warning should respect text size from settings
https://bugs.webkit.org/show_bug.cgi?id=192205
Reviewed by Tim Horton.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontWithSize):
(makeButton):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
2018-12-08 Frederic Wang <fwang@igalia.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>
Reviewed by Simon Fraser.
Based on an earlier patch by Simon Fraser.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
2018-12-07 Rob Buis <rbuis@igalia.com>
Remove unused API in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=192415
Reviewed by Alex Christensen.
This patch removed some unused API and headers in NetworkProcess.
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkContentRuleListManager.h:
* NetworkProcess/NetworkDataTask.cpp:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/NetworkLoad.cpp:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadChecker.cpp:
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveBuffer):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.cpp:
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSocketStream.cpp:
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* NetworkProcess/PingLoad.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::PreconnectTask):
(WebKit::PreconnectTask::frameID const): Deleted.
(WebKit::PreconnectTask::pageID const): Deleted.
* NetworkProcess/PreconnectTask.h:
2018-12-07 Eric Carlson <eric.carlson@apple.com>
[MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
https://bugs.webkit.org/show_bug.cgi?id=192511
<rdar://problem/46562063>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
* UIProcess/UserMediaPermissionCheckProxy.h:
(WebKit::UserMediaPermissionCheckProxy::create):
(WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::generateRequestID): New.
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
the page does not have a granted request and does not have persistent access.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
2018-12-07 Saam Barati <sbarati@apple.com>
WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
https://bugs.webkit.org/show_bug.cgi?id=192473
Reviewed by Andy Estes.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(PageLoaderClient::layoutMilestones const):
2018-12-07 Youenn Fablet <youenn@apple.com>
Update libwebrtc up to 0d007d7c4f
https://bugs.webkit.org/show_bug.cgi?id=192316
Reviewed by Eric Carlson.
Update code base according new libwebrtc backend
In particular, use directly int64_t for packet time.
* Configurations/WebKit.xcconfig:
* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::signalReadPacket):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
* NetworkProcess/webrtc/NetworkRTCSocket.h:
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::signalReadPacket):
2018-12-07 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238947.
Revision caused fast/visual-viewport/tiled-drawing/zoomed-
fixed-scrolling-layers-state.html to constantly fail
Reverted changeset:
"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/238947
2018-12-06 David Kilzer <ddkilzer@apple.com>
Injected bundle for WebKitTestRunner leaks WKTypeRef objects
<https://webkit.org/b/192481>
<rdar://problem/46539059>
Reviewed by Simon Fraser.
Change function parameter name from `returnData[Ref]` to
`returnRetainedData[Ref]` to document that the value returned is
a +1 retained WKTypeRef object.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundlePostSynchronousMessage):
* WebProcess/InjectedBundle/API/c/WKBundle.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostSynchronousMessageForTesting):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2018-12-06 Frederic Wang <fwang@igalia.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
Reviewed by Simon Fraser.
Based on an earlier patch by Simon Fraser.
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
the new node at the end of child list.
2018-12-06 Yongjun Zhang <yongjun_zhang@apple.com>
We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
https://bugs.webkit.org/show_bug.cgi?id=192377
<rdar://problem/46364206>
Reviewed by Tim Horton.
Since we are using page's viewport arguments to decide the default viewport parameters and
whether we can use mininum effective device width, we should always call setViewportArguments()
regardless of shouldIgnoreMetaViewport settings.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
(WebKit::WebPage::didCommitLoad): Ditto.
2018-12-06 Tim Horton <timothy_horton@apple.com>
Web Share API: share overlay does not stick to the Safari window
https://bugs.webkit.org/show_bug.cgi?id=192469
<rdar://problem/46074833>
Reviewed by Wenson Hsieh.
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
(-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
(-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
(-[WKShareSheet sharingService:didFailToShareItems:error:]):
(-[WKShareSheet sharingService:didShareItems:]):
Implement another NSSharingServicePickerDelegate method to return
an *NSSharingService* delegate when needed.
Implement an NSSharingServiceDelegate method to return the window that
the service's UI should attach to.
Also, instead of notifying the Web Content process when a service is picked
(or not) in the NSSharingServicePicker, wait until the share has completed
(or failed) to send didComplete. This both makes the return completion
value more accurate (matching iOS, if you cancel the share during the
recipient choice step, it will now fail), and avoids explicitly tearing
down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
2018-12-06 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
https://bugs.webkit.org/show_bug.cgi?id=187554
<rdar://problem/42075638>
Reviewed by Tim Horton.
Add support for automatically switching the base writing direction to the default writing direction with respect
to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
direction, although in some other versions of iOS, this only happens when first focusing an editable area.
Test: editing/input/ios/rtl-keyboard-input-on-focus.html
* Platform/spi/ios/UIKitSPI.h:
Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
`-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
focusing an editable element).
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::increaseListLevel):
(WebKit::WebPageProxy::decreaseListLevel):
(WebKit::WebPageProxy::changeListType):
(WebKit::WebPageProxy::setBaseWritingDirection):
Drive-by style fixes: make these bail and return early if `!isValid()`.
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Reset assisted node state in the UI process upon web process termination.
* UIProcess/WebPageProxy.h:
Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView baseWritingDirectionForPosition:inDirection:]):
(coreWritingDirection):
(-[WKContentView setBaseWritingDirection:forRange:]):
Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
though we could potentially add full support for this in the future by mapping the given text range to a DOM
range and moving the selection prior to setting the base writing direction.
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
to change the initial writing direction if necessary.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAssistingNode):
(WebKit::WebPageProxy::stopAssistingNode):
(WebKit::WebPageProxy::editorStateChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setBaseWritingDirection):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-12-06 David Quesada <david_quesada@apple.com>
-[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
https://bugs.webkit.org/show_bug.cgi?id=192411
rdar://problem/46492487
Reviewed by Alex Christensen.
* UIProcess/API/C/WKContext.cpp:
(WKContextResumeDownload):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resumeDownload):
- Set the originating page of the DownloadProxy.
- If the originating page is non-null, use its session ID for the download.
- Remove a FIXME. It's possible to do this now by providing the web view whose session
should be used for the download.
* UIProcess/WebProcessPool.h:
2018-12-06 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a quick fix after r238919
Add an early return such that the error message is actually meaningful.
* UIProcess/WebAuthentication/Mock/MockHidService.cpp:
(WebKit::MockHidService::platformStartDiscovery):
2018-12-06 Alex Christensen <achristensen@webkit.org>
Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
https://bugs.webkit.org/show_bug.cgi?id=192452
Reviewed by Anders Carlsson.
This was introduced in r210835 but never used.
It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueDidReceiveResponse):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
* WebProcess/Network/WebResourceLoader.messages.in:
2018-12-06 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
https://bugs.webkit.org/show_bug.cgi?id=191997
Reviewed by Philippe Normand.
Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
2018-12-05 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
https://bugs.webkit.org/show_bug.cgi?id=192290
Reviewed by Simon Fraser.
Fixed the bug by updating the DisplayID upon attaching to a WebContent process
after a process swap as well as after the previous WebContent process had crashed.
Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
as they have an off-screen NSWindow. The issue that this results in no fallback for
the animation timer is tracked by webkit.org/b/192448.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::didRelaunchProcess):
2018-12-05 Youenn Fablet <youenn@apple.com>
Remove a document entry from NetworkMDNSRegister::m_services when document goes away
https://bugs.webkit.org/show_bug.cgi?id=192429
Reviewed by Eric Carlson.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::unregisterMDNSNames):
We should remove the entry to limit the size of the map.
2018-12-05 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061
Reviewed by Dewei Zhu.
Part 1.
Add some loggings to determine possible causes for the flakiness.
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::continueAddDeviceAfterGetInfo):
* UIProcess/WebAuthentication/Mock/MockHidService.cpp:
(WebKit::MockHidService::platformStartDiscovery):
2018-12-05 Chris Dumez <cdumez@apple.com>
Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
https://bugs.webkit.org/show_bug.cgi?id=192404
Reviewed by Alex Christensen.
Simplify get the item state from the current back/forward list item, instead of
relying on WebBackForwardList::filteredItemStates().
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
2018-12-05 Youenn Fablet <youenn@apple.com>
Enable the possibility to do video capture in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192394
Reviewed by Eric Carlson.
Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
Add mechanism for video capture that was not implemented yet.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCaptureAudioInUIProcessEnabled):
(WKPreferencesGetCaptureAudioInUIProcessEnabled):
(WKPreferencesSetCaptureVideoInUIProcessEnabled):
(WKPreferencesGetCaptureVideoInUIProcessEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::createWebPage):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::initialize):
2018-12-05 Alex Christensen <achristensen@webkit.org>
Make WebsiteDataStoreConfiguration a proper API object
https://bugs.webkit.org/show_bug.cgi?id=192380
Reviewed by Youenn Fablet.
In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
like all our other ObjC API objects are.
* Shared/API/APIObject.h:
(API::Object::wrapper const):
(API::Object::wrapper): Deleted.
* Shared/Cocoa/APIObject.mm:
(API::Object::ref const):
(API::Object::deref const):
(API::Object::newObject):
(API::Object::ref): Deleted.
(API::Object::deref): Deleted.
* Sources.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::createLegacy):
(API::WebsiteDataStore::WebsiteDataStore):
(API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
(-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
(-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
(-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration _apiObject]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::create):
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStore::cacheStorageDirectory const):
(WebKit::WebsiteDataStore::setCacheStorageDirectory):
(WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
(WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
(WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
(WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
(WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
(WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
(WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
(WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
(WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
(WebKit::WebsiteDataStoreConfiguration::create):
(WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
(WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
(WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
(WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
(WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
(WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
(WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
(WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
* WebKit.xcodeproj/project.pbxproj:
2018-12-05 Wenson Hsieh <wenson_hsieh@apple.com>
Turn WritingDirection into an enum class
https://bugs.webkit.org/show_bug.cgi?id=192401
Work towards <rdar://problem/42075638>
Reviewed by Dan Bernstein.
Change WritingDirection from an enum to an enum class. No change in behavior.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setTextDirection):
2018-12-05 Rob Buis <rbuis@igalia.com>
[Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
https://bugs.webkit.org/show_bug.cgi?id=114965
Reviewed by Frédéric Wang.
HEAD requests should not be changed to GET after 303 redirects, see [1].
This was fixed earlier for GTK [2].
Behavior matches Firefox and Chrome.
[1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
[2] https://bugs.webkit.org/show_bug.cgi?id=110127
Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
web-platform-tests/fetch/api/redirect/redirect-method-worker.html
http/tests/xmlhttprequest/head-redirection.html
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2018-12-04 Fujii Hironori <Hironori.Fujii@sony.com>
Remove using namespace WebCore and WebKit under WebKit/Shared/API
https://bugs.webkit.org/show_bug.cgi?id=192352
Reviewed by Alex Christensen.
Removed using namespace statements, and use namespace prefix
instead.
* Shared/API/APIURLRequest.cpp:
* Shared/API/APIURLResponse.cpp:
* Shared/API/c/WKArray.cpp:
* Shared/API/c/WKCertificateInfo.cpp:
* Shared/API/c/WKConnectionRef.cpp:
* Shared/API/c/WKContextMenuItem.cpp:
* Shared/API/c/WKData.cpp:
* Shared/API/c/WKDictionary.cpp:
* Shared/API/c/WKErrorRef.cpp:
* Shared/API/c/WKGeometry.cpp:
* Shared/API/c/WKImage.cpp:
* Shared/API/c/WKMutableArray.cpp:
* Shared/API/c/WKMutableDictionary.cpp:
* Shared/API/c/WKNumber.cpp:
* Shared/API/c/WKPluginInformation.cpp:
* Shared/API/c/WKRenderLayer.cpp:
* Shared/API/c/WKRenderObject.cpp:
* Shared/API/c/WKSecurityOriginRef.cpp:
* Shared/API/c/WKSerializedScriptValue.cpp:
* Shared/API/c/WKString.cpp:
* Shared/API/c/WKType.cpp:
* Shared/API/c/WKURL.cpp:
* Shared/API/c/WKURLRequest.cpp:
* Shared/API/c/WKURLResponse.cpp:
* Shared/API/c/WKUserContentURLPattern.cpp:
* Shared/API/c/cairo/WKImageCairo.cpp:
* Shared/API/c/curl/WKCertificateInfoCurl.cpp:
2018-12-04 Alex Christensen <achristensen@webkit.org>
Remove source application identifiers from NetworkProcessCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192372
Reviewed by Brady Eidson.
The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127
The replacement was adopted in <rdar://problem/46359330>
The transition process is done! Time to remove the old code.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::globalSourceApplicationAuditTokenData): Deleted.
(WebKit::globalSourceApplicationBundleIdentifier): Deleted.
(WebKit::globalSourceApplicationSecondaryIdentifier): Deleted.
(WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted.
(WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted.
(WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::toPKPaymentRequest):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::configuration):
2018-12-04 Youenn Fablet <youenn@apple.com>
Calling getUserMedia in a link that was opened with target="_blank" does not work the second time
https://bugs.webkit.org/show_bug.cgi?id=188088
<rdar://problem/42681448>
Reviewed by Eric Carlson.
On closing a page, we need to make sure to consider that the capture is ended,
as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver.
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
2018-12-04 Chris Dumez <cdumez@apple.com>
Regression(r238817) PSON Page Cache API tests are failing
https://bugs.webkit.org/show_bug.cgi?id=192348
Reviewed by Alex Christensen.
Before suspending a WebProcess on iOS, we normally fake a memory pressure signal
so that the suspended process uses as little memory as possible while suspended.
Among other things, this will clear the page cache. This is an issue in the case
of process-swap on navigation because we keep suspended web processes around to
keep Page Cache functional.
To address the issue, when a WebProcess is about to get suspended, we check if
the process has any suspended WebPage (WebPage used for PSON PageCache support)
and we bypass the PageCache clearing if it does.
Our API tests did not catch this before r238817 because the NavigationState's
assertion was preventing the old WebProcesses from suspending for 3 seconds,
which was enough for those tests to complete.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::didFinishLoad):
* UIProcess/SuspendedPageProxy.h:
Take a background assertion until the suspension load is complete, to make sure
the suspension load has a chance to complete before the process gets suspended.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const):
(WebKit::WebProcess::actualPrepareToSuspend):
* WebProcess/WebProcess.h:
2018-12-04 Youenn Fablet <youenn@apple.com>
Device orientation may be wrong on page reload after crash
https://bugs.webkit.org/show_bug.cgi?id=192349
<rdar://problem/46359466>
Reviewed by Eric Carlson.
On page crash, the process is relaunched and the page is reloaded.
At that point, the orientation information of the page is not reset until the next device orientation change.
To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page.
Covered by manual testing.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
2018-12-04 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[WPE] Add gtk-doc
https://bugs.webkit.org/show_bug.cgi?id=178900
Reviewed by Michael Catanzaro.
Add gtk-doc to WPE port. This patch tries to reuse as much code from
WebKitGTK+ as possible.
* PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
* UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
* UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
in the same position as in the WebKitGTK+ for consistency.
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
2018-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move URLSoup back to WebCore after r238771
https://bugs.webkit.org/show_bug.cgi?id=192306
Reviewed by Michael Catanzaro.
Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup
includes from URL header.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate):
* PluginProcess/PluginProcess.cpp:
* Shared/API/glib/WebKitURIRequest.cpp:
* Shared/API/glib/WebKitURIResponse.cpp:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkit_uri_scheme_request_finish_error): Use soupURIToURL().
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_load_uri): Use soupURIToURL().
* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
* UIProcess/Launcher/glib/BubblewrapLauncher.h:
* UIProcess/Launcher/glib/FlatpakLauncher.cpp:
* UIProcess/Launcher/glib/FlatpakLauncher.h:
2018-12-04 Tim Horton <timothy_horton@apple.com>
Fix the watchOS build; stop unnecessarily linking CorePDF
https://bugs.webkit.org/show_bug.cgi?id=192356
<rdar://problem/46427844>
Reviewed by Wenson Hsieh.
* Configurations/WebKit.xcconfig:
* Platform/spi/ios/CorePDFSPI.h:
2018-12-03 Tim Horton <timothy_horton@apple.com>
Make it possible to disable animated keyboard scrolling behavior
https://bugs.webkit.org/show_bug.cgi?id=192331
<rdar://problem/45586859>
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator invalidate]):
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
(-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
(-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
(-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]):
(-[WKKeyboardScrollingAnimator stopRepeatTimer]):
(-[WKKeyboardScrollingAnimator performDiscreteScroll]):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
(-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
* WebKit.xcodeproj/project.pbxproj:
2018-12-03 Fujii Hironori <Hironori.Fujii@sony.com>
Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
https://bugs.webkit.org/show_bug.cgi?id=192301
Reviewed by Alex Christensen.
Removed "using namespace WebKit" statement, and use "WebKit::"
namespace prefix instead.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
2018-12-03 Chris Dumez <cdumez@apple.com>
Regression(PSON) Google OAuth is broken in private sessions
https://bugs.webkit.org/show_bug.cgi?id=192337
<rdar://problem/46353558>
Reviewed by Alex Christensen.
In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then
addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap.
The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore()
which would cause the session to get destroyed assuming this was the last page using it. We would
therefore lose session cookies after a process-swap in private session.
To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and
WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool
about the page beginning / ending its use of the session. In the case of a process-swap, we make
sure the process pool is not notified.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::close):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::removeWebPage):
* UIProcess/WebProcessProxy.h:
2018-12-03 Chris Dumez <cdumez@apple.com>
[PSON] Request by the client to process-swap is ignored if the window has an opener
https://bugs.webkit.org/show_bug.cgi?id=192267
<rdar://problem/46386886>
Reviewed by Brady Eidson.
If the client forces a process-swap, we should process-swap, even if the browsing
context has an opener (or openees). Previously, we would only bypass the cross-site
check, not the openee / openees checks.
The issue when doing so is that the openee still has a opener link to the window
in the old process. They would see that the window is still there and navigated
to 'about:blank' due to our page suspension logic. To address the issue, we no
longer suspend the old WebPage if the process swap was forced by the client and
we make sure that the old WebPage gets closed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-12-03 Keith Rollin <krollin@apple.com>
Add .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192082
<rdar://problem/46312533>
Reviewed by Brent Fulgham.
Add .xcfilelist files for Generate Derived Sources and Generate
Unified Sources build phases in Xcode. These are just being staged for
now; they'll be added to the Xcode projects later.
* DerivedSources-input.xcfilelist: Added.
* DerivedSources-output.xcfilelist: Added.
* UnifiedSources-input.xcfilelist: Added.
* UnifiedSources-output.xcfilelist: Added.
2018-12-03 Zalan Bujtas <zalan@apple.com>
[iOS] Unreviewed build fix.
* Platform/Logging.h:
2018-12-03 Alex Christensen <achristensen@webkit.org>
Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride
https://bugs.webkit.org/show_bug.cgi?id=192246
Reviewed by Chris Dumez.
The last use of this functionality was removed in rdar://problem/46344871
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationDiskCacheSizeOverride):
(WKContextConfigurationSetDiskCacheSizeOverride):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
(-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2018-12-03 Alex Christensen <achristensen@webkit.org>
Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
https://bugs.webkit.org/show_bug.cgi?id=192272
Reviewed by Brady Eidson.
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(ResourceLoadClient::ResourceLoadClient):
(ResourceLoadClient::loadDelegate const):
(ResourceLoadClient::pluginContextController const):
(PageLoaderClient::PageLoaderClient):
(PageLoaderClient::loadDelegate const):
(PageLoaderClient::pluginContextController const):
(PageLoaderClient::didStartProvisionalLoadForFrame):
(PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
(PageLoaderClient::didFinishLoadForFrame):
(PageLoaderClient::globalObjectIsAvailableForFrame):
(PageLoaderClient::didRemoveFrameFromHierarchy):
(PageLoaderClient::didCommitLoadForFrame):
(PageLoaderClient::didFinishDocumentLoadForFrame):
(PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
(PageLoaderClient::didFailLoadWithErrorForFrame):
(PageLoaderClient::didSameDocumentNavigationForFrame):
(PageLoaderClient::didLayoutForFrame):
(PageLoaderClient::didReachLayoutMilestone):
(PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
(PageLoaderClient::didHandleOnloadEventsForFrame):
(PageLoaderClient::userAgentForURL const):
(ResourceLoadClient::willSendRequestForFrame):
(ResourceLoadClient::didInitiateLoadForResource):
(ResourceLoadClient::didFinishLoadForResource):
(ResourceLoadClient::didFailLoadForResource):
(-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
(didStartProvisionalLoadForFrame): Deleted.
(didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
(didFinishLoadForFrame): Deleted.
(globalObjectIsAvailableForFrame): Deleted.
(didRemoveFrameFromHierarchy): Deleted.
(didCommitLoadForFrame): Deleted.
(didFinishDocumentLoadForFrame): Deleted.
(didFailProvisionalLoadWithErrorForFrame): Deleted.
(didFailLoadWithErrorForFrame): Deleted.
(didSameDocumentNavigationForFrame): Deleted.
(didLayoutForFrame): Deleted.
(didReachLayoutMilestone): Deleted.
(didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
(didHandleOnloadEventsForFrame): Deleted.
(userAgentForURL): Deleted.
(setUpPageLoaderClient): Deleted.
(willSendRequestForFrame): Deleted.
(didInitiateLoadForResource): Deleted.
(didFinishLoadForResource): Deleted.
(didFailLoadForResource): Deleted.
(setUpResourceLoadClient): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2018-12-03 Tim Horton <timothy_horton@apple.com>
Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
https://bugs.webkit.org/show_bug.cgi?id=192319
<rdar://problem/45928708>
Reviewed by Simon Fraser.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
In r236966, I reverted slightly too much of r232416.
We still need to defer requesting a presentation update callback until
after the provisional load starts. Otherwise, we could get the callback
while we're in the 'paused' state, and drop it on the floor. That would
then mean that we time out instead of promptly removing the snapshot.
2018-12-03 Alex Christensen <achristensen@webkit.org>
Update process assertions after swapping processes
https://bugs.webkit.org/show_bug.cgi?id=192318
<rdar://problem/46377552>
Reviewed by Chris Dumez.
If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
after navigation and process swapping we need the new WebProcess to update its process assertions.
* UIProcess/API/Cocoa/PageLoadStateObserver.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::didSwapWebProcesses):
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didSwapWebProcesses):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
2018-12-03 Daniel Bates <dabates@apple.com>
[iOS] Do not handle key events that are key commands
https://bugs.webkit.org/show_bug.cgi?id=191608
<rdar://problem/46046013>
Reviewed by Ryosuke Niwa.
A key down event may be associated with a key command. If it is then we want to execute the
key command instead of inserting or deleting text. We need to ask UIKit to handle the current
event as a key command to find out.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event
as a key command. If it handles it then we're done. Otherwise, do what we do now.
2018-12-03 Zalan Bujtas <zalan@apple.com>
[iOS] Add logging channel for hover related content observation
https://bugs.webkit.org/show_bug.cgi?id=192312
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2018-12-03 Tim Horton <timothy_horton@apple.com>
Enable swipe snapshot removal logging in release builds
https://bugs.webkit.org/show_bug.cgi?id=192313
Reviewed by Dean Jackson.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
This is super-low-traffic and super-helpful logging.
Turn it on all the time.
2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use WallTime for file time
https://bugs.webkit.org/show_bug.cgi?id=192287
Reviewed by Darin Adler.
* Shared/SessionState.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DatabaseDetails>::decode):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/API/glib/WebKitWebViewSessionState.cpp:
(decodeHTTPBody):
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::getPluginInfo):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::hasFileChangedSince):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFormDataElement):
(WebKit::decodeFormDataElement):
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::removeAllMediaKeyStorageForOriginPath):
(WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin):
(WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates):
(WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries):
* WebProcess/MediaCache/WebMediaKeyStorageManager.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toHTTPBody):
(WebKit::toFormData):
2018-12-03 Darin Adler <darin@apple.com>
[Cocoa] Check message IDs when decoding Mach messages in IPC::Connection
https://bugs.webkit.org/show_bug.cgi?id=192300
rdar://problem/46215523
Reviewed by Chris Dumez.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for
the messages, as suggested by an expert at Apple.
(IPC::createMessageDecoder): Update for the new message IDs.
(IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected
message IDs.
2018-12-03 Darin Adler <darin@apple.com>
[Cocoa] Check descriptor types in createMessageDecoder
https://bugs.webkit.org/show_bug.cgi?id=192302
Reviewed by Chris Dumez.
Not sure how to construct a test case for Connection, so not adding any
tests at this time.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::createMessageDecoder): Check descriptor types and return nullptr if they
are incorrect. Retained the assertions to help with debugging.
(IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder
is created, which means the message is invalid.
2018-12-03 Darin Adler <darin@apple.com>
Alignment padding needs to be zeroed out in IPC::Encoder
https://bugs.webkit.org/show_bug.cgi?id=192304
Reviewed by Chris Dumez.
Might be useful to make a regression test for this, but I couldn't find any
other tests for this code.
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::grow): Use std::memset to zero-fill padding bytes.
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::HistoryEntryDataEncoder::grow): Ditto.
2018-12-03 Darin Adler <darin@apple.com>
[Cocoa] Streamline sandbox code a tiny bit
https://bugs.webkit.org/show_bug.cgi?id=192299
Reviewed by Anders Carlsson.
* Shared/mac/SandboxUtilities.mm:
(WebKit::processHasContainer): Removed separate function, just use the
pathForProcessContainer instead of repeating logic. This costs a tiny
bit of memory allocation overhead the first time this function is called,
but in return we can eliminate a second copy of the code to call
sandbox_container_path_for_pid.
2018-12-03 Eric Carlson <eric.carlson@apple.com>
[MediaStream] 'devicechange' event when more capture device information are revealed.
https://bugs.webkit.org/show_bug.cgi?id=192268
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged
if a filtered device list was returned previously.
(WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList.
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device
list and strip device IDs if gUM permission hasn't been given.
(WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
2018-12-03 Keith Rollin <krollin@apple.com>
Remove Network Capture
https://bugs.webkit.org/show_bug.cgi?id=192296
<rdar://problem/46408648>
Reviewed by Daniel Bates.
r209498 introduced an embedded record and replay facility for network
resource loading. This facility was added in order to support a new
implementation of the PLT and related performance tests. The PLT is
currenty taking a different direction, and so this record/replace
facility is no longer needed. Removing it as unused code.
* CMakeLists.txt:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::setDefersLoading):
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::willPerformHTTPRedirection):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::didReceiveData):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::initializeForRecord): Deleted.
(WebKit::NetworkLoad::initializeForReplay): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::terminate):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed.
* NetworkProcess/capture/NetworkCaptureEvent.h: Removed.
* NetworkProcess/capture/NetworkCaptureLogging.h: Removed.
* NetworkProcess/capture/NetworkCaptureManager.cpp: Removed.
* NetworkProcess/capture/NetworkCaptureManager.h: Removed.
* NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed.
* NetworkProcess/capture/NetworkCaptureRecorder.h: Removed.
* NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed.
* NetworkProcess/capture/NetworkCaptureReplayer.h: Removed.
* NetworkProcess/capture/NetworkCaptureResource.cpp: Removed.
* NetworkProcess/capture/NetworkCaptureResource.h: Removed.
* NetworkProcess/capture/NetworkDataTaskReplay.cpp: Removed.
* NetworkProcess/capture/NetworkDataTaskReplay.h: Removed.
* NetworkProcess/capture/json.hpp: Removed.
* Sources.txt:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebKit.xcodeproj/project.pbxproj:
* config.h:
2018-12-02 Zalan Bujtas <zalan@apple.com>
Add a runtime feature flag for LayoutFormattingContext.
https://bugs.webkit.org/show_bug.cgi?id=192280
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-12-01 Chris Dumez <cdumez@apple.com>
[PSON] process-swapping may occur even though opener has handle to openee
https://bugs.webkit.org/show_bug.cgi?id=192277
Reviewed by Antti Koivisto.
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::openedByDOMWithOpener const):
(API::Navigation::openedViaWindowOpenWithOpener const): Deleted.
(API::Navigation::opener const): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2018-12-01 Alexey Proskuryakov <ap@apple.com>
Modernize version check for _suppressedAutoAddedHTTPHeaders
https://bugs.webkit.org/show_bug.cgi?id=192175
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Also removed selector check - we only need to support running on 10.13.0 when building
with 10.13.0 SDK.
2018-11-30 Alex Christensen <achristensen@webkit.org>
Fix Windows build.
* UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
(WKWebsiteDataStoreEnableCustomNetworkProxySettings):
2018-11-30 Alex Christensen <achristensen@webkit.org>
Move URL from WebCore to WTF
https://bugs.webkit.org/show_bug.cgi?id=190234
Reviewed by Keith Miller.
* NetworkProcess/Cookies/WebCookieManager.cpp:
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::publishDownloadProgress):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::publishProgress):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::publishProgress):
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::filesInBlob):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::setContentExtensionController):
(WebKit::NetworkLoadChecker::url const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::writeBlobToFilePath):
(WebKit::NetworkProcess::publishDownloadProgress):
(WebKit::NetworkProcess::preconnectTo):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::logBlockedCookieInformation):
(WebKit::logCookieInformationInternal):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::create):
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::retrieveRecords):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.h:
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::retrieveRecords):
* NetworkProcess/cache/CacheStorageEngineConnection.h:
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
(WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const):
* NetworkProcess/capture/NetworkCaptureEvent.cpp:
(WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const):
(WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const):
(WebKit::NetworkCapture::Error::operator WebCore::ResourceError const):
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
(WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureResource.cpp:
(WebKit::NetworkCapture::Resource::url):
(WebKit::NetworkCapture::Resource::queryParameters):
* NetworkProcess/capture/NetworkCaptureResource.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::openCFURLRef):
(WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
* Shared/API/APIURL.h:
(API::URL::create):
(API::URL::equals):
(API::URL::URL):
(API::URL::url const):
(API::URL::parseURLIfNecessary const):
* Shared/API/APIUserContentURLPattern.h:
(API::UserContentURLPattern::matchesURL const):
* Shared/API/c/WKURLRequest.cpp:
* Shared/API/c/WKURLResponse.cpp:
* Shared/API/c/cf/WKURLCF.mm:
(WKURLCreateWithCFURL):
(WKURLCopyCFURL):
* Shared/API/glib/WebKitURIRequest.cpp:
* Shared/API/glib/WebKitURIResponse.cpp:
* Shared/APIWebArchiveResource.mm:
(API::WebArchiveResource::WebArchiveResource):
* Shared/AssistedNodeInformation.h:
* Shared/Cocoa/WKNSURLExtras.mm:
(-[NSURL _web_originalDataAsWTFString]):
(): Deleted.
* Shared/SessionState.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::itemIsInSameDocument const):
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebErrors.h:
* Shared/WebHitTestResultData.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
* Shared/gtk/WebErrorsGtk.cpp:
* Shared/ios/InteractionInformationAtPosition.h:
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/APINavigation.cpp:
(API::Navigation::appendRedirectionURL):
* UIProcess/API/APINavigation.h:
(API::Navigation::takeRedirectChain):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::signedPublicKeyAndChallengeString):
(API::NavigationClient::contentRuleListNotification):
(API::NavigationClient::webGLLoadPolicy const):
(API::NavigationClient::resolveWebGLLoadPolicy const):
* UIProcess/API/APIUIClient.h:
(API::UIClient::saveDataToFileInDownloadsFolder):
* UIProcess/API/APIUserScript.cpp:
(API::UserScript::generateUniqueURL):
* UIProcess/API/APIUserScript.h:
* UIProcess/API/APIUserStyleSheet.cpp:
(API::UserStyleSheet::generateUniqueURL):
* UIProcess/API/APIUserStyleSheet.h:
* UIProcess/API/C/WKOpenPanelResultListener.cpp:
(filePathsFromFileURLs):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadPlainTextStringWithUserData):
(WKPageSetPageUIClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupAddUserStyleSheet):
(WKPageGroupAddUserScript):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
(-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/API/Cocoa/_WKApplicationManifest.mm:
(-[_WKApplicationManifest initWithCoder:]):
(+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
* UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
(-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
* UIProcess/API/glib/IconDatabase.cpp:
* UIProcess/API/glib/WebKitCookieManager.cpp:
(webkit_cookie_manager_get_cookies):
* UIProcess/API/glib/WebKitFileChooserRequest.cpp:
* UIProcess/API/glib/WebKitSecurityOrigin.cpp:
(webkit_security_origin_new_for_uri):
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_load_plain_text):
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::validateMerchant):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentRequest):
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::navigateBrowsingContext):
(WebKit::domainByAddingDotPrefixIfNeeded):
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didFinish):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::contentRuleListNotification):
(WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
(WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
(WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
* UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h.
(WebKit::SafeBrowsingResult::SafeBrowsingResult):
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::reportAnErrorURL):
(WebKit::malwareDetailsURL):
(WebKit::safeBrowsingDetailsText):
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource finish:]):
(WebKit::SystemPreviewController::finish):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
(WebKit::requestUserMediaAuthorizationForDevices):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
* UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
(-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
(WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::publishProgress):
* UIProcess/Downloads/DownloadProxy.h:
(WebKit::DownloadProxy::setRedirectChain):
(WebKit::DownloadProxy::redirectChain const):
* UIProcess/FrameLoadState.cpp:
(WebKit::FrameLoadState::didStartProvisionalLoad):
(WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
(WebKit::FrameLoadState::didSameDocumentNotification):
(WebKit::FrameLoadState::setUnreachableURL):
* UIProcess/FrameLoadState.h:
(WebKit::FrameLoadState::url const):
(WebKit::FrameLoadState::setURL):
(WebKit::FrameLoadState::provisionalURL const):
(WebKit::FrameLoadState::unreachableURL const):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::writeBlobToFilePath):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/PageClient.h:
(WebKit::PageClient::showSafeBrowsingWarning):
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::hasOnlySecureContent):
* UIProcess/Plugins/PluginInfoStore.cpp:
* UIProcess/Plugins/PluginInfoStore.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
* UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h.
(WebKit::SafeBrowsingResult::create):
(WebKit::SafeBrowsingResult::url const):
(WebKit::SafeBrowsingResult::provider const):
(WebKit::SafeBrowsingResult::isPhishing const):
(WebKit::SafeBrowsingResult::isMalware const):
(WebKit::SafeBrowsingResult::isUnwantedSoftware const):
(WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
* UIProcess/SuspendedPageProxy.cpp:
* UIProcess/SystemPreviewController.h:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::url const):
(WebKit::WebFrameProxy::provisionalURL const):
(WebKit::WebFrameProxy::unreachableURL const):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebOpenPanelResultListenerProxy.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::contentRuleListNotification):
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
(WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showSafeBrowsingWarning):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _updateLocationInfo]):
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::decodeLegacySessionState):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showSafeBrowsingWarning):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _defaultAnimationController]):
* UIProcess/win/WebInspectorProxyWin.cpp:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::showPaymentUI):
(WebKit::WebPaymentCoordinator::validateMerchant):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::doRetrieveRecords):
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
(API::InjectedBundle::PageLoaderClient::userAgentForURL const):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameAllowsFollowingLink):
(WKBundleFrameCopySuggestedFilenameForResourceWithURL):
(WKBundleFrameCopyMIMETypeForResourceWithURL):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageHasLocalDataForURL):
* WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp:
(convertToUTF8String):
* WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::preconnectTo):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::WebSocketStream):
* WebProcess/Network/WebSocketStream.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::clickedLink):
* WebProcess/Plugins/Plugin.h:
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performURLRequest):
(WebKit::PluginView::performJavaScriptURLRequest):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebContextMenuClient.h:
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::readURLFromPasteboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebPage/VisitedLinkTableController.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::allowsFollowingLink const):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURLInFrame):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
(WebKit::WebPage::dumpHistoryForTesting):
(WebKit::WebPage::sendCSPViolationReport):
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::frameURL const):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::sendPrewarmInformation):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::activePagesOrigins):
2018-11-30 Per Arne Vollan <pvollan@apple.com>
[macOS] Add more logging of sandbox call entries.
https://bugs.webkit.org/show_bug.cgi?id=192261
rdar://problem/45772445
Reviewed by Dean Jackson.
* WebProcess/com.apple.WebProcess.sb.in:
2018-11-30 Tim Horton <timothy_horton@apple.com>
Editable images should always return some data, even if the canvas doesn't have a size yet
https://bugs.webkit.org/show_bug.cgi?id=192265
<rdar://problem/46385911>
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView layoutSubviews]):
(emptyImage):
(-[WKDrawingView renderedDrawing]):
(-[WKDrawingView PNGRepresentation]):
Some clients strongly depend on there being some data in an image, even if
it's not of a usable size yet. We'll invalidate the attachment when the
canvas size changes, so it will eventually settle at a usable size (after
the first layer tree commit that includes the editable image).
2018-11-30 Don Olmstead <don.olmstead@sony.com>
Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
https://bugs.webkit.org/show_bug.cgi?id=192197
Reviewed by Jiewen Tan.
* Configurations/FeatureDefines.xcconfig:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
2018-11-30 Alexey Proskuryakov <ap@apple.com>
Move USE_CFNETWORK_IGNORE_HSTS to its proper place
https://bugs.webkit.org/show_bug.cgi?id=192173
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(updateIgnoreStrictTransportSecuritySettingIfNecessary):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2018-11-30 Alex Christensen <achristensen@webkit.org>
Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier
https://bugs.webkit.org/show_bug.cgi?id=192157
Reviewed by Chris Dumez.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
2018-11-30 Alex Christensen <achristensen@webkit.org>
Remove privateBrowsingEnabled from NetworkProcessCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192156
Reviewed by Chris Dumez.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2018-11-30 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API for ProtectionSpace.
https://bugs.webkit.org/show_bug.cgi?id=191648
Reviewed by Alex Christensen.
Added API to get certificate information from protection space.
* PlatformWin.cmake:
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
* UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added.
(WKProtectionSpaceCopyCertificateInfo):
* UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added.
2018-11-30 David Quesada <david_quesada@apple.com>
-[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view
https://bugs.webkit.org/show_bug.cgi?id=192212
rdar://problem/46363706
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _downloadURLRequest:originatingWebView:]):
(-[WKProcessPool _downloadURLRequest:]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2018-11-30 Per Arne Vollan <pvollan@apple.com>
Remove invalid character in sandbox introduced in r238703.
Unreviewed sandbox fix.
* WebProcess/com.apple.WebProcess.sb.in:
2018-11-30 Andy Estes <aestes@apple.com>
[Cocoa] Add some WKA extension points
https://bugs.webkit.org/show_bug.cgi?id=192131
<rdar://problem/46330293>
Reviewed by Tim Horton.
* DerivedSources.make: Added an extension point for WebPreferences.yaml.
* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
* Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
* SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
WebPaymentCoordinatorProxy.
* WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
* WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
WebPaymentCoordinator.
2018-11-30 Frederic Wang <fwang@igalia.com>
[WebAuthN] Support CTAP HID authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=188623
Unreviewed build fix.
* UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header.
2018-11-29 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state
https://bugs.webkit.org/show_bug.cgi?id=192165
<rdar://problem/46346682>
Reviewed by Daniel Bates.
Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario:
1. WKWebView is hosted within the view hierarchy
2. First responder is *not* WKContentView
3. The active focus retain count is nonzero
Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the
first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where
WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an
example of this is dragging a text selection between editable elements in the same web view).
To fix this, simply bail early and return true if focus is being retained.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isViewFocused):
2018-11-29 Tim Horton <timothy_horton@apple.com>
Inform clients when editable image attachment backing data changes
https://bugs.webkit.org/show_bug.cgi?id=192206
<rdar://problem/46350277>
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::invalidateGeneratedFileWrapper):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didInvalidateDataForAttachment:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
* UIProcess/PageClient.h:
(WebKit::PageClient::didInvalidateDataForAttachment):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didInvalidateDataForAttachment):
* UIProcess/WebPageProxy.h:
Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.
2018-11-29 Eric Carlson <eric.carlson@apple.com>
[MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents
https://bugs.webkit.org/show_bug.cgi?id=192182
Reviewed by Youenn Fablet.
* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top
level documents.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto.
* UIProcess/DeviceIdHashSaltStorage.h:
(WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2018-11-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238713.
Breaks internal builds.
Reverted changeset:
"[Cocoa] Add some WKA extension points"
https://bugs.webkit.org/show_bug.cgi?id=192131
https://trac.webkit.org/changeset/238713
2018-11-29 Simon Fraser <simon.fraser@apple.com>
Add an internal feature flag to enable async overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=192184
Reviewed by Tim Horton.
Add a new internal feature flag that will enable async overflow-scrolling for
most overflow:scroll elements. Defaults to off.
* Shared/WebPreferences.yaml:
2018-11-29 Andy Estes <aestes@apple.com>
[Cocoa] Add some WKA extension points
https://bugs.webkit.org/show_bug.cgi?id=192131
<rdar://problem/46330293>
Reviewed by Tim Horton.
* DerivedSources.make: Added an extension point for WebPreferences.yaml.
* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
* Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
* SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
WebPaymentCoordinatorProxy.
* WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
* WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
WebPaymentCoordinator.
2018-11-29 Tim Horton <timothy_horton@apple.com>
Try to fix the build.
* Platform/spi/ios/PencilKitSPI.h:
2018-11-29 David Quesada <david_quesada@apple.com>
Add SPI to publish NSProgress on active downloads
https://bugs.webkit.org/show_bug.cgi?id=192021
rdar://problem/44405661
Reviewed by Alex Christensen.
Make it possible for clients to allow other processes to monitor the state of active
downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing
it on an appropriate file URL (potentially a different file URL than where the download
data is being written), updating properties on it as the download makes progress, and
wiring up a cancellation handler that allows it to be remotely canceled. Interested
clients can then subscribe to progress on that URL and receive a proxy to the progress
that WebKit publishes.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::~Download):
(WebKit::Download::platformDestroyDownload):
Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm
will interact with its Objective-C NSProgress instance at this point.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
See comments for publishDownloadProgress().
(WebKit::DownloadManager::publishDownloadProgress):
If the provided downloadID corresponds to a non-Pending Download, hand the URL
and a matching sandbox extension to the Download so it can create its progress.
Otherwise, store the URL and sandbox extension on the PendingDownload to be used
later when the full Download is created. When this happens, dataTaskBecameDownloadTask()
will tell the PendingDownload about the Download it has become. The PendingDownload
will then relay the progress URL and sandbox extension to the Download.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::publishProgress):
Store the progress info for later use, when the proper Download is created.
(WebKit::PendingDownload::didBecomeDownload):
If there was a progress URL provided earlier, tell the Download corresponding to this
PendingDownload to publish its progress using that URL.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformDestroyDownload):
When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled),
unpublish the progress, since there is no longer any activity to report.
(WebKit::Download::publishProgress):
Resolve the sandbox extension, create a progress configured to reflect the progress of
this Download's NSURLSessionDownloadTask, and publish it at the given file URL.
* NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
* NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added.
(-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
Configure this progress, start observing properties on the download task that this
progress will reflect, and connect the cancellation handler of the progress to cancel
the corresponding Download.
(-[WKDownloadProgress publish]):
(-[WKDownloadProgress unpublish]):
Override these methods to consume and revoke the sandbox extension to make sure the
process has access to the progress file while the progress will be published.
(-[WKDownloadProgress dealloc]):
(-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]):
When either byte count (number received, or number expected to receive) of the download
task changes, update this progress to reflect that.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::publishDownloadProgress):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
Allow looking up the services that manages published NSProgresses.
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload publishProgressAtURL:]):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::publishProgress):
* UIProcess/Downloads/DownloadProxy.h:
* WebKit.xcodeproj/project.pbxproj:
2018-11-29 Tim Horton <timothy_horton@apple.com>
Make drawing tools available when an editable image is focused
https://bugs.webkit.org/show_bug.cgi?id=192172
<rdar://problem/30337960>
Reviewed by Dean Jackson.
* Platform/spi/ios/PencilKitSPI.h:
Add some more SPI.
* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleStylusSingleTapAtPoint):
(WebKit::isAssistableElement):
(WebKit::WebPage::getAssistedNodeInformation):
Plumb the assisted node's embedded view ID, if available.
Also add a new input type for drawings, and use it when appropriate.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
Add WKInputTypeDrawing.
* UIProcess/ios/PencilKitSoftLink.h: Added.
* UIProcess/ios/PencilKitSoftLink.mm: Added.
Pull soft-linking out into its own file, to fix unified sources.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView requiresAccessoryView]):
Install a keyboard when a drawing is focused.
Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through.
(-[WKContentView inputView]):
Make a WKInkPickerControl when a drawing is focused.
(-[WKContentView textInputTraits]):
(isAssistableInputType):
* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
(-[WKDrawingView PNGRepresentation]):
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):
Adopt PencilKitSoftLink.
(-[WKDrawingView canvasView]):
Expose the internal canvas view for use by WKInkPickerControl.
* UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h.
* UIProcess/ios/WKInkPickerControl.mm: Added.
(-[WKInkPickerView initWithFrame:drawingView:]):
(-[WKInkPickerView didPickInk]):
(-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
(-[WKInkPickerView inlineInkPicker:didSelectTool:]):
(-[WKInkPickerView inlineInkPicker:didSelectColor:]):
(-[WKInkPickerView inkPickerSize]):
(-[WKInkPickerView layoutSubviews]):
(-[WKInkPickerView sizeThatFits:]):
(-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
(-[WKInkPickerControl initWithDrawingView:]):
(-[WKInkPickerControl beginEditing]):
(-[WKInkPickerControl endEditing]):
(-[WKInkPickerControl assistantView]):
Install and hook up a PKInlineInkPicker.
Center it in the keyboard.
Plumb changes through to the canvas view.
* WebKit.xcodeproj/project.pbxproj:
2018-11-29 Per Arne Vollan <pvollan@apple.com>
[macOS] Add logging for some sandbox entries.
https://bugs.webkit.org/show_bug.cgi?id=192126
Reviewed by Brent Fulgham.
Add logging for sandbox entries which are possibly not needed.
* WebProcess/com.apple.WebProcess.sb.in:
2018-11-29 Alex Christensen <achristensen@webkit.org>
Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127
https://bugs.webkit.org/show_bug.cgi?id=192191
Reviewed by Andy Estes.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be.
2018-11-29 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2018-11-29 Zalan Bujtas <zalan@apple.com>
[ContentObservation] Decouple content change and DOM timer scheduling observation
https://bugs.webkit.org/show_bug.cgi?id=192170
Reviewed by Simon Fraser.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
2018-11-29 Eric Carlson <eric.carlson@apple.com>
[iOS] Tell AirPlay picker when a file has video
https://bugs.webkit.org/show_bug.cgi?id=192155
<rdar://problem/43843865>
Reviewed by Jer Noble.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
Add hasVideo parameter.
* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
hasVideo parameter, pass info to MPMediaControlsViewController.
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.
2018-11-29 Alexey Proskuryakov <ap@apple.com>
Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
https://bugs.webkit.org/show_bug.cgi?id=192041
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2018-11-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238678.
Breaks internal builds.
Reverted changeset:
"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238678
2018-11-29 Suresh Koppisetty <skoppisetty@apple.com>
Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
https://bugs.webkit.org/show_bug.cgi?id=192099
Reviewed by Geoffrey Garen.
[NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2018-11-29 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2018-11-29 Conrad Shultz <conrad_shultz@apple.com>
Factor out configuration of the file upload image picker
https://bugs.webkit.org/show_bug.cgi?id=192138
<rdar://problem/46334871>
Reviewed by Tim Horton.
By factoring configuration of the picker into its own method, it makes it easier
to apply custom configuration in subclasses in the future.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
(-[WKFileUploadPanel _configureImagePicker:]):
2018-11-29 Tomas Popela <tpopela@redhat.com>
[GTK][WPE] Fix BubblewrapLauncher clang warnings
https://bugs.webkit.org/show_bug.cgi?id=192086
Reviewed by Michael Catanzaro.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindPathVar): Initialize the i variable to 0.
(WebKit::setupSeccomp): Initialize the optional datum_b member.
2018-11-28 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
https://bugs.webkit.org/show_bug.cgi?id=192016
<rdar://problem/46284417>
Reviewed by Devin Rousso.
Previously calling the Page's inspectorController.show()
would create a frontend connection on the WebProcess side.
However now the frontend connection is handed to the WebProcess
once the UIProcess creates it. So queue actions that take place
immediately after showing the inspector until we have a frontend
to send the actions to.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
(WebKit::WebInspector::whenFrontendConnectionEstablished):
(WebKit::WebInspector::showConsole):
(WebKit::WebInspector::showResources):
(WebKit::WebInspector::showTimelines):
(WebKit::WebInspector::showMainResourceForFrame):
(WebKit::WebInspector::startPageProfiling):
(WebKit::WebInspector::stopPageProfiling):
(WebKit::WebInspector::startElementSelection):
(WebKit::WebInspector::stopElementSelection):
2018-11-28 Vivek Seth <v_seth@apple.com>
Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
https://bugs.webkit.org/show_bug.cgi?id=192094
<rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
Reviewed by Chris Dumez.
For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
2018-11-28 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
https://bugs.webkit.org/show_bug.cgi?id=192127
rdar://problem/44194179
Reviewed by Tim Horton.
_restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
web process, and unconditionally called .value() even though it may not be engaged.
No repro steps known, so no testcase.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2018-11-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r238653 and r238656.
https://bugs.webkit.org/show_bug.cgi?id=192130
Breaks iOS build (Requested by smfr on #webkit).
Reverted changesets:
"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238653
"Attempt to fix the iOS build by only including RevealSPI.h
when it's needed."
https://trac.webkit.org/changeset/238656
2018-11-28 Alex Christensen <achristensen@webkit.org>
Modernize BlobRegistry::writeBlobsToTemporaryFiles
https://bugs.webkit.org/show_bug.cgi?id=192117
Reviewed by Dean Jackson.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::writeBlobToFilePath):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::sendWithAsyncReply):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::writeBlobToFilePath):
(WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192122
Reviewed by Dean Jackson.
This is part of an effort to reduce global variables in the NetworkProcess.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::didReceiveResponse):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::loadThrottleLatency const):
* NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const): Deleted.
(WebKit::NetworkSessionCreationParameters::decode): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Sources.txt:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
2018-11-15 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2018-11-28 Keith Rollin <krollin@apple.com>
Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192031
<rdar://problem/46286816>
Reviewed by Alex Christensen.
The Generate Derived Sources and Generate Unified Sources build phases
in Xcode need to have their inputs and outputs specified. This
specification will come in the form of .xcfilelist files that will be
attached to these build phases. There is one .xcfilelist file that
lists the input file and one that lists the output files. As part of
this work, the various generate-{derived,unified}-sources scripts that
are executed in these Generate build phases are modified to help in
the creation of these .xcfilelist files. In particular, they can now
be invoked with command-line parameters. These parameters are then
used to alter the normal execution of these scripts, causing them to
produce the .xcfilelist files as opposed to actually generating the
files that are listed in those files.
* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:
2018-11-28 Keith Rollin <krollin@apple.com>
Revert print_all_generated_files work in r238008; tighten up target specifications
https://bugs.webkit.org/show_bug.cgi?id=192025
<rdar://problem/46284301>
Reviewed by Alex Christensen.
In r238008, I added a facility for DerivedSources.make makefiles to
print out the list of files that they generate. This output was used
in the generation of .xcfilelist files used to specify the output of
the associated Generate Derived Sources build phases in Xcode. This
approach worked, but it meant that people would need to follow a
specific convention to keep this mechanism working.
Instead of continuing this approach, I'm going to implement a new
facility based on the output of `make` when passed the -d flag (which
prints dependency information). This new mechanism is completely
automatic and doesn't need maintainers to follow a convention. To that
end, remove most of the work performed in r238008 that supports the
print_all_generated_files target.
At the same time, it's important for the sets of targets and their
dependencies to be complete and correct. Therefore, also include
changes to bring those up-to-date. As part of that, you'll see
prevalent use of a particular technique. Here's an example:
BYTECODE_FILES = \
Bytecodes.h \
BytecodeIndices.h \
BytecodeStructs.h \
InitBytecodes.asm \
#
BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
all : $(BYTECODE_FILES)
$(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
...
These lines indicate a set of generated files (those specified in
BYTECODE_FILES). These files are generated by the BytecodeList.rb
tool. But, as opposed to the normal rule where a single foo.output is
generated by foo.input plus some additional dependencies, this rule
produces multiple output files from a tool whose connection to the
output files is not immediately clear. A special approach is needed
where a single rule produces multiple output files. The normal way to
implement this is to use an .INTERMEDIATE target. However, we used
this approach in the past and ran into a problem with it, addressing
it with an alternate approach in r210507. The above example shows this
approach. The .'s in the list of target files are replaced with %'s,
and the result is used as the left side of the dependency rule.
* DerivedSources.make:
2018-11-28 Daniel Bates <dabates@apple.com>
[iOS] Page not defocused when Find-in-page becomes first responder
https://bugs.webkit.org/show_bug.cgi?id=192084
<rdar://problem/46146777>
Reviewed by Tim Horton.
When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
focus. This includes decisions about whether to allow an element to be focused. We need to
ensure that WebKit knows whether the web view is focused for it to make good decisions.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
input.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
becomes focused.
(-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
becomes defocused.
2018-11-28 Alex Christensen <achristensen@webkit.org>
Remove dead code from an earlier attempt at implementing safe browsing
https://bugs.webkit.org/show_bug.cgi?id=192067
Reviewed by Chris Dumez.
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Move logCookieInformation bool from NetworkProcess to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=192049
Reviewed by Chris Dumez.
Part of an effort to remove globals in the NetworkProcess.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
(WebKit::NetworkResourceLoader::shouldLogCookieInformation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(WebKit::logCookieInformationInternal):
(WebKit::NetworkResourceLoader::logCookieInformation):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::logCookieInformation const):
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
2018-11-28 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238620.
Broke internal builds again.
Reverted changeset:
"Remove @no-unify of InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp"
https://bugs.webkit.org/show_bug.cgi?id=191853
https://trac.webkit.org/changeset/238620
2018-11-28 Yongjun Zhang <yongjun_zhang@apple.com>
Allow WebKit clients to specify a minimum effective width for layout.
https://bugs.webkit.org/show_bug.cgi?id=191499
<rdar://problem/45362678>
Reviewed by Wenson Hsieh.
If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
width. For clients that wish to lay out the content with a different width value, we would need to add a way
to specify the effective width for layout.
* UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
(-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
(-[WKWebView _setViewScale:]): Ditto.
(-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
(-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
* UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
to ignore the minimum effective width value.
* WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.
2018-11-28 Fujii Hironori <Hironori.Fujii@sony.com>
Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
https://bugs.webkit.org/show_bug.cgi?id=191853
Reviewed by Michael Catanzaro.
In r235845, I excluded InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp from unify source builds in order to
work around a MSVC bug.
Then, I commited a different workaround for the MSVC bug in
r238386. Now, we can include InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp in unified source builds. Revert
r235845.
* Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
and InjectedBundleNodeHandle.cpp
* WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
not to be compiled by XCode.
2018-11-28 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
https://bugs.webkit.org/show_bug.cgi?id=191971
Reviewed by Matt Baker.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::reopen): Deleted.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
Move reopen out of the WebProcess...
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::reopen):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
And into the UIProcess where the order of messages won't
be as problematic.
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::reopen):
Send a message to the WebInspectorProxy instead.
2018-11-28 Alexey Proskuryakov <ap@apple.com>
Remove another OS version check from NetworkDataTaskCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=192046
Reviewed by Alex Christensen.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2018-11-28 Alexey Proskuryakov <ap@apple.com>
Modernize version checks for same site cookie support
https://bugs.webkit.org/show_bug.cgi?id=192054
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
Also removed runtime checks, which are no longer relevant.
2018-11-27 Mark Lam <mark.lam@apple.com>
ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
https://bugs.webkit.org/show_bug.cgi?id=192055
<rdar://problem/46288783>
Reviewed by Saam Barati.
* Configurations/FeatureDefines.xcconfig:
2018-11-27 Alex Christensen <achristensen@webkit.org>
Make synchronous IPC introduced in r237267 asynchronous
https://bugs.webkit.org/show_bug.cgi?id=190757
Reviewed by Chris Dumez.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]):
(-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::activePagesDomainsForTesting):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getActivePagesOriginsForTesting):
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::getActivePagesOriginsForTesting):
2018-11-27 Alex Christensen <achristensen@webkit.org>
Safe browsing warning text needs to be visible on High Sierra
https://bugs.webkit.org/show_bug.cgi?id=192022
Reviewed by Tim Horton.
Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay
out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible.
Covered by an API test.
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(makeLabel):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingWarning layoutText]):
(makeTitleLabel): Deleted.
2018-11-27 Tim Horton <timothy_horton@apple.com>
WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538
https://bugs.webkit.org/show_bug.cgi?id=192038
<rdar://problem/46288457>
Reviewed by Wenson Hsieh.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::resetState):
(WebKit::m_editableImageController): Deleted.
Properly invalidate m_editableImageController when resetting WebPageProxy.
Otherwise, the MessageReceiverMaps get invalidated, then later when
EditableImageController goes away we assert trying to remove the receiver.
2018-11-27 Jiewen Tan <jiewen_tan@apple.com>
(r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing
https://bugs.webkit.org/show_bug.cgi?id=191757
Reviewed by Chris Dumez.
Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected
behavior for mock testing. However, the main thread could time out when MockHidConnection::send
is excuting the block on another thread. The block will then return without invoking the callback,
which triggers this WTFCrash. The solution is always invoking the callback before return in the
block.
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
2018-11-27 Keith Rollin <krollin@apple.com>
Better parsing of comments in generate-message*.py
https://bugs.webkit.org/show_bug.cgi?id=191866
<rdar://problem/46189563>
Reviewed by Chris Dumez.
The script parsing the *.messages.in files would treat a line starting
with '#' as a comment, but not a line starting with '<whitespace>#'.
This means that jamming a '#' right in front of the first character of
a message definition (as opposed to the beginning of a line) will have
no effect and the line will get treated just the same as a
non-commented line. Fix this by trimming all white space from the
beginning and ending of the line before processing it.
* Scripts/webkit/parser.py:
(parse):
* Scripts/webkit/test-messages.in:
2018-11-27 Thibault Saunier <tsaunier@igalia.com>
[GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var
https://bugs.webkit.org/show_bug.cgi?id=192024
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
2018-11-27 Alexey Proskuryakov <ap@apple.com>
Modernize the check for async _saveCookies existence
https://bugs.webkit.org/show_bug.cgi?id=191987
Reviewed by Dean Jackson.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSyncAllCookies):
2018-11-27 Tim Horton <timothy_horton@apple.com>
Serialize and deserialize editable image strokes
https://bugs.webkit.org/show_bug.cgi?id=192002
<rdar://problem/30900149>
Reviewed by Dean Jackson.
* UIProcess/API/APIAttachment.cpp:
(API::Attachment::updateAttributes):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willUpdateAttachmentAttributes):
* UIProcess/WebPageProxy.h:
When an attachment would update its DOM attributes, plumb a notification
to EditableImageController, and allow it to block the update (because
we don't really want to set src for editable image attachments,
we just want the UI process to fully own the data).
* Platform/spi/ios/PencilKitSPI.h:
Add some SPI.
* UIProcess/ios/EditableImageController.h:
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::loadStrokesFromAttachment):
Add a helper to load strokes from an attachment.
(WebKit::EditableImageController::associateWithAttachment):
Try to load strokes from the attachment when initially associated.
Don't create a file wrapper around a null image, so it will be regenerated later.
(WebKit::EditableImageController::willUpdateAttachmentAttributes):
The aforementioned plumbing at update time.
* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView layoutSubviews]):
Invalidate the attachment (so it will be regenerated upon request) if the
canvas size changes.
(-[WKDrawingView PNGRepresentation]):
Serialize strokes into the EXIF User Comment field.
We will find a different field to use (ideally a custom vendor-specific
field that nobody else will use for anything), but this works for now.
Don't try to render an image if we don't have a size or scale;
PKImageRenderer will just fail anyway, so bail early.
In the iOS Simulator, PKImageRenderer currently returns an unusable image.
Instead, so that we have a image on which to serialize the strokes,
create a transparent 1x1 image. This makes it possible to serialize strokes
even though we don't have a usable rendered image, so that we can still test
this change (and future changes).
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):
If available, deserialize strokes from the EXIF User Comment field.
(-[WKDrawingView drawingDidChange:]):
(-[WKDrawingView invalidateAttachment]):
Factor invalidateAttachment out of drawingDidChange so we can call
it from layoutSubviews too!
2018-11-27 Chris Dumez <cdumez@apple.com>
Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame()
https://bugs.webkit.org/show_bug.cgi?id=191983
<rdar://problem/46246863>
Reviewed by Geoffrey Garen.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it
does not.
(WebKit::WebPageProxy::resetState):
Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state
after a crash. At this point, there is no chance the WebProcess will send us the IPC that will
cause these to get called and we do not want old state to remain for future navigations.
2018-11-16 Jiewen Tan <jiewen_tan@apple.com>
Disallow loading webarchives as iframes
https://bugs.webkit.org/show_bug.cgi?id=191728
<rdar://problem/45524528>
Reviewed by Youenn Fablet.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unableToImplementPolicy):
Add a check to prevent null pointer dereference.
2018-11-27 Wenson Hsieh <wenson_hsieh@apple.com>
WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
https://bugs.webkit.org/show_bug.cgi?id=191996
Reviewed by Tim Horton.
This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
object (of class `_NSArrayM`) to be equal to `NSArray.class`.
We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
kind of any of the allowed classes.
* Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::isObjectClassAllowed):
(IPC::decode):
2018-11-27 Tomas Popela <tpopela@redhat.com>
[GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
https://bugs.webkit.org/show_bug.cgi?id=192008
Reviewed by Michael Catanzaro.
Looks like it's not needed anymore as the code compiles fine without
it.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
2018-11-27 Antti Koivisto <antti@apple.com>
Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
https://bugs.webkit.org/show_bug.cgi?id=192001
Reviewed by Tim Horton.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::updateMask):
Shared function, with some special tricks for iOS backdrop layers.
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
2018-11-27 Antti Koivisto <antti@apple.com>
Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
https://bugs.webkit.org/show_bug.cgi?id=192003
Reviewed by Tim Horton.
We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
to add anything except an extra hash lookup.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
Pass m_nodes directly.
Some random cleanups.
2018-11-27 Antti Koivisto <antti@apple.com>
Remote tile layers shouldn't be UIViews
https://bugs.webkit.org/show_bug.cgi?id=191953
Reviewed by Tim Horton.
They don't need any UIView functionality, nor do they ever have UIView descendants.
We can use lighter weight objects.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::updateChildren):
Factor to a function shared between platforms.
Support having both views and plain layers in the same tree.
Assert that all siblings are of the same type and that we don't attempt to add views to layers.
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
Use new plain layer on Mac too.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(-[WKPlainRemoteLayer description]):
Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.
(WebKit::RemoteLayerTreeNode::createWithPlainLayer):
(WebKit::RemoteLayerTreeNode::detachFromParent):
Support having null view.
(WebKit::RemoteLayerTreeNode::appendLayerDescription):
Helper for layer descriptions.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
Construct plain layers for tiles.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKCompositingView description]):
(-[WKUIRemoteView description]):
(-[WKBackdropView description]):
2018-11-27 Fujii Hironori <Hironori.Fujii@sony.com>
Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
https://bugs.webkit.org/show_bug.cgi?id=191995
Reviewed by Alex Christensen.
The statement "using namespace WebCore" should be placed inside
namespace WebKit for unified source builds. But, source files
defining WebKit API can't be enclosed by namespace WebKit { }
becuase they are defined in the global scope.
"using namespace WebCore" in global scope and unified source
builds may cause build breaks (Bug 191853).
Remove "using namespace WebCore" in the global scope. Use
"WebCore::" prefix instead.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleClearAllDatabases):
(WKBundleSetDatabaseQuota):
(WKBundleClearResourceLoadStatistics):
(WKBundleResourceLoadStatisticsNotifyObserver):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetFrameLoadState):
(WKBundleFrameClearOpener):
(WKBundleFrameCallShouldCloseOnWebView):
(WKBundleFrameCopySecurityOrigin):
(WKBundleFrameFocus):
* WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2018-11-26 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
https://bugs.webkit.org/show_bug.cgi?id=169212
<rdar://problem/30899656>
Reviewed by Tim Horton.
Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
that may become first responder within the view hierarchy of the WKWebView.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentViewIsFirstResponder]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2018-11-26 Tim Horton <timothy_horton@apple.com>
Insert <attachment> elements under editable images to make their backing data accessible
https://bugs.webkit.org/show_bug.cgi?id=191844
<rdar://problem/30900149>
Reviewed by Simon Fraser.
* DerivedSources.make:
* SourcesCocoa.txt:
* UIProcess/API/APIAttachment.h:
fileWrapper() is no longer a trivial getter; it can now construct
the file wrapper from a file wrapper generator if necessary.
Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().
Make m_fileWrapper mutable so it can be adjusted inside its own getter.
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::fileWrapper const):
If we have a fileWrapperGenerator and don't have a cached file wrapper,
create one before returning it.
(API::Attachment::invalidateGeneratedFileWrapper):
Invalidate the currently-cached file wrapper. The next time a client
requests the file wrapper it will be regenerated.
(API::Attachment::fileName const):
(API::Attachment::fileSizeForDisplay const):
(API::Attachment::enclosingImageData const):
(API::Attachment::isEmpty const):
(API::Attachment::createSerializedRepresentation const):
Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
that it is created lazily if necessary.
(API::Attachment::setFileWrapperGenerator):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKEmbeddedView initWithEmbeddedViewID:]):
Defer to EditableImageController for creating WKDrawingViews for
editable images. This is done primarily so we don't have to pollute
Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_editableImageController):
(WebKit::m_resetRecentCrashCountTimer): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::editableImageController):
Keep an EditableImageController on the WebPageProxy.
* UIProcess/ios/EditableImageController.h: Added.
* UIProcess/ios/EditableImageController.messages.in: Added.
* UIProcess/ios/EditableImageController.mm: Added.
(WebKit::EditableImageController::EditableImageController):
(WebKit::EditableImageController::~EditableImageController):
(WebKit::EditableImageController::ensureEditableImage):
(WebKit::EditableImageController::editableImage):
(WebKit::EditableImageController::didCreateEditableImage):
(WebKit::EditableImageController::didDestroyEditableImage):
(WebKit::EditableImageController::associateWithAttachment):
(WebKit::EditableImageController::invalidateAttachmentForEditableImage):
Add EditableImageController, which keeps track of EditableImages.
It can be messaged directly to create or destroy the UI-side state
of an editable image, and also to associate a WKDrawingView with
a particular attachment.
* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Store the WebPageProxy (weakly) so that we can get to the EditableImageController.
(-[WKDrawingView layoutSubviews]):
(-[WKDrawingView PNGRepresentation]):
Synchronously render the PKCanvasView to PNG.
(-[WKDrawingView drawingDidChange:]):
If the drawing changes, inform the APIAttachment that it needs
to discard its NSFileWrapper; a new one will be generated lazily.
(-[WKDrawingView init]): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::associateEditableImageWithAttachment):
(WebKit::WebChromeClient::didCreateEditableImage):
(WebKit::WebChromeClient::didDestroyEditableImage):
2018-11-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Add an asyncronous reply request to VideoFullscreenManager.
* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
* WebProcess/cocoa/VideoFullscreenManager.h:
* WebProcess/cocoa/VideoFullscreenManager.messages.in:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
2018-11-26 Alex Christensen <achristensen@webkit.org>
Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
https://bugs.webkit.org/show_bug.cgi?id=191981
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _safeBrowsingWarning]):
(-[WKWebView _safeBrowsingWarningForTesting]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2018-11-26 Daniel Bates <dabates@apple.com>
REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
https://bugs.webkit.org/show_bug.cgi?id=191967
<rdar://problem/45976390>
Reviewed by Tim Horton.
Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.
Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
to match the values of the corresponding enumerations in GraphicsServices, which are the
enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
-_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
flags bitmask when instantiating a WebEvent.
* Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
This will be done by the WebProcess when it receives the keyboard event.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
to the scrolling animator as it does not know how to handle these kinds of events and triggers an
assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
they model on Mac.
* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
instead of the value of -_modifierFlags.
2018-11-26 Chris Dumez <cdumez@apple.com>
[PSON] process pre-warming should not be on for everyone
https://bugs.webkit.org/show_bug.cgi?id=191966
<rdar://problem/46138499>
Reviewed by Ryosuke Niwa.
If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
turn it on automatically after the first process swap. Previously, it was always enabled if
process-swap on cross-site navigation was enabled (which is the case by default for all apps).
This is important because some apps do not actually browse (only display static content) or never
browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.
* UIProcess/API/APIProcessPoolConfiguration.h:
Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationPrewarmsProcessesAutomatically):
(WKContextConfigurationSetPrewarmsProcessesAutomatically):
Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
by default for browsing. This way Safari does not have to wait for the first process swap to
start prewarming.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
This is needed for clients like Safari that explicitly enable automatic process prewarming but
only want to have it enabled if PSON is also enabled via experimental features.
(WebKit::WebProcessPool::processForNavigation):
On first process swap, if the client did not explicitly turn on or off automatic process prewarming
then we enable it then. This avoids paying the cost of process prewarming in apps that would not
benefit from it.
2018-11-26 Andy Estes <aestes@apple.com>
[Cocoa] Make it easier to encode NSObjects
https://bugs.webkit.org/show_bug.cgi?id=191948
Reviewed by Dean Jackson.
It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
now, several argument coders duplicate the logic for encoding and decoding objects using
NSKeyedArchiver and NSKeyedUnarchiver.
This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.
This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
explicitly for containers and classes that are loaded at runtime.
* Shared/Cocoa/ArgumentCodersCocoa.h: Added.
* Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling.
* Shared/WebCoreArgumentCoders.h: Modernized several decoders.
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
(WebKit::InteractionInformationAtPosition::decode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): Ditto.
(IPC::deviceContextKey): Deleted.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* SourcesCocoa.txt: Added ArgumentCodersCocoa.mm.
* WebKit.xcodeproj/project.pbxproj: Ditto.
2018-11-26 Wenson Hsieh <wenson_hsieh@apple.com>
CompletionHandler-based async IPC messages only work when the completion handler takes a single argument
https://bugs.webkit.org/show_bug.cgi?id=191965
Reviewed by Tim Horton.
Teach `messages.py` to handle the case where an async IPC completion handler takes no arguments, or takes more
than a single argument. Currently, the generated code attempts to wrap all arguments in a `WTFMove(*~)`, but
this either results in `WTFMove(*)` in the case where there are no arguments, or `WTFMove(*foo, *bar, *baz)` in
the case where there are several arguments. Both of these results fail to compile.
Instead, emit `completionHandler()` when there are no arguments, and
`completionHandler(WTFMove(*foo), WTFMove(*bar), WTFMove(*baz))` when there are multiple arguments.
Tests: TestAsyncMessageWithNoArguments
TestAsyncMessageWithMultipleArguments
* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
(Messages::WebPage::TestAsyncMessageWithNoArguments::send):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
(WebKit::WebPage::didReceiveMessage):
* Scripts/webkit/MessagesSuperclass-expected.h:
(Messages::WebPage::TestAsyncMessageWithNoArguments::receiverName):
(Messages::WebPage::TestAsyncMessageWithNoArguments::name):
(Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
(Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::receiverName):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
* Scripts/webkit/messages.py:
* Scripts/webkit/messages_unittest.py:
Add new `messages.py` unit tests to cover these cases.
* Scripts/webkit/test-superclass-messages.in:
2018-11-26 Jeremy Jones <jeremyj@apple.com>
Use Full Screen consistently in localizable strings.
https://bugs.webkit.org/show_bug.cgi?id=190363
rdar://problem/43882333
Reviewed by Jon Lee.
Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):
2018-11-26 Daniel Bates <dabates@apple.com>
Wire up ChromeClient::takeFocus() on iOS
https://bugs.webkit.org/show_bug.cgi?id=191763
<rdar://problem/18584508>
Reviewed by Dan Bernstein.
Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
the engine has cycled through all the tab focusable elements on the page.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
2018-11-26 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471
r238471 added an `#include WebPageMessages.h` in `WebPage.h`, which causes the 32-bit macOS build using an
internal macOS SDK ≤ 10.13 to fail. To address this, move the `#include` back under `PLATFORM(IOS_FAMILY)` by
changing the parameters of `WebPage::removeDataDetectedLinks` and `WebPage::detectDataInAllFrames` to completion
handlers rather than async IPC replies.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::removeDataDetectedLinks):
(WebKit::WebPage::detectDataInAllFrames):
* WebProcess/WebPage/WebPage.h:
2018-11-26 Antti Koivisto <antti@apple.com>
Clean up layer tree freezing logic in WebPage
https://bugs.webkit.org/show_bug.cgi?id=191826
Reviewed by Dean Jackson.
Use OptionSet<LayerTreeFreezeReason> to track various reasons that can cause layer tree to get frozen.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
Layer tree is unfrozen when there there are no reasons to freeze it.
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::endPrinting):
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationWillEnterForeground):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted.
* WebProcess/WebProcess.h:
2018-11-25 Antti Koivisto <antti@apple.com>
RemoteLayerTreeNode construction cleanups
https://bugs.webkit.org/show_bug.cgi?id=191951
Reviewed by Tim Horton.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
Drop unused LayerProperties argument.
(WebKit::RemoteLayerTreeHost::createLayer):
Split the actual construction out to makeNode.
Map updating is shared between platforms.
Move setting of layerID and clearing default actions to RemoteLayerTreeNode.
(WebKit::RemoteLayerTreeHost::makeNode):
Returns RemoteLayerTreeNode.
(WebKit::RemoteLayerTreeHost::setLayerID): Deleted.
(WebKit::RemoteLayerTreeHost::layerID): Deleted.
Move to RemoteLayerTreeNode.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::setLayerID):
(WebKit::RemoteLayerTreeNode::layerID):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
(WebKit::RemoteLayerTreeHost::createLayer): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKCompositingView description]):
(-[WKUIRemoteView description]):
(-[WKBackdropView description]):
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::addAnimationToLayer):
2018-11-25 Tim Horton <timothy_horton@apple.com>
Make it possible to insert editable images with a gesture
https://bugs.webkit.org/show_bug.cgi?id=191937
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stylusTapGestureShouldCreateEditableImage]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
Add a internal getter for a WKWebViewConfiguration property.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
Add a undo name.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
Add a single-stylus-tap gesture recognizer.
(-[WKContentView _stylusSingleTapRecognized:]):
If allowed, request to insert an editable image when a stylus tap occurs.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleStylusSingleTapAtPoint):
Do a hit test, select the hit position, insert an editable image, and
then de-assist any assisted node (to make the keyboard go away).
For now, we'll only insert if we hit non-replaced elements,
though this heuristic will need to be enhanced significantly once we
decide on a design.
2018-11-25 Tim Horton <timothy_horton@apple.com>
Scrolling and drawing compete for incoming gestures
https://bugs.webkit.org/show_bug.cgi?id=191940
Reviewed by Wenson Hsieh.
* Platform/spi/ios/PencilKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Make scrolling and drawing mutually exclusive if editable images
are enabled.
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
https://bugs.webkit.org/show_bug.cgi?id=191945
Reviewed by Anders Carlsson.
Replace some a couple of command undo action name descriptions with "Undo action name", to match all other
edit commands.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add WKWebView SPI to trigger and remove data detection
https://bugs.webkit.org/show_bug.cgi?id=191918
<rdar://problem/36185051>
Reviewed by Tim Horton.
Adds support for two new WKWebView SPI methods, `-_detectDataWithTypes:completionHandler:` and
`-_removeAllDataDetectedLinks:`, to allow internal WebKit clients to run data detection and add links to data
detected content, or remove all data detected links from the document.
Test: WebKit.AddAndRemoveDataDetectors
* Shared/Cocoa/DataDetectionResult.h:
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::decode):
Modernize DataDetectionResult's IPC decoding, so that it can be used with reply-based async IPC.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _removeDataDetectedLinks:]):
(-[WKWebView _detectDataWithTypes:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::detectDataInAllFrames):
(WebKit::WebPageProxy::removeDataDetectedLinks):
Add or remove data detected links from each frame in the page, and then propagate the new data detector
results of the main frame to the UI process (this matches current behavior, where the results of -[WKWebView
_dataDetectionResults] only reflects data detection results in the main frame of the page).
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::removeDataDetectedLinks):
(WebKit::WebPage::detectDataInAllFrames):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-11-24 Andy Estes <aestes@apple.com>
[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
https://bugs.webkit.org/show_bug.cgi?id=191899
Reviewed by Dean Jackson.
* Shared/cocoa/WebCoreArgumentCodersCocoa.mm:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2018-11-23 Antti Koivisto <antti@apple.com>
Replace LayerOrView typedef with a class
https://bugs.webkit.org/show_bug.cgi?id=191927
Reviewed by Tim Horton.
This typedef restricts remote layer representation to be either a CA layer or a view. We might want
have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier
to unify Mac and iOS code, and hopefully make it less confusing too.
This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef
(the rest are converted to pure CALayer). It also does a bunch of related cleanup.
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
(WebKit::applyPropertiesToLayer): Deleted.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _propertiesOfLayerWithID:]):
* UIProcess/Cocoa/LayerRepresentation.h: Removed.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
(WebKit::RemoteLayerTreeHost::rootNode const):
(WebKit::RemoteLayerTreeHost::rootLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::nodeForID const):
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
(WebKit::RemoteLayerTreeHost::animationDidStart):
(WebKit::RemoteLayerTreeHost::animationDidEnd):
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::layerWithIDForTesting const):
(WebKit::RemoteLayerTreeHost::layerForID const):
(WebKit::RemoteLayerTreeHost::rootLayer const):
(WebKit::RemoteLayerTreeHost::createLayer):
(WebKit::RemoteLayerTreeHost::detachRootLayer):
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
(WebKit::RemoteLayerTreeHost::getLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added.
(WebKit::RemoteLayerTreeNode::layer const):
(WebKit::RemoteLayerTreeNode::uiView const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added.
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::detachFromParent):
* UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
(WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::layerRepresentationFromLayerOrView): Deleted.
* UIProcess/WebAuthentication/Cocoa/HidService.h:
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/LayerRepresentation.mm: Removed.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::acceleratedCompositingRootLayer const):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2018-11-23 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Enable Web Authentication as an experimental feature for macOS
https://bugs.webkit.org/show_bug.cgi?id=191932
rdar://problem/46225210
Reviewed by Brent Fulgham.
* Shared/WebPreferences.yaml:
2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com>
Enable drag and drop support for iOSMac
https://bugs.webkit.org/show_bug.cgi?id=191818
<rdar://problem/43907454>
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled):
Enable custom pasteboard data by default on iOSMac. While writing and reading custom pasteboard data is
currently broken in iOSMac due to the lack of `teamData` and `preferredPresentationStyle`, opting into custom
pasteboard data at least allows us to avoid writing unsanitized data types to the pasteboard.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
Fix a regression from <https://trac.webkit.org/r236619> wherein the web process crashes when attempting to edit
a text field. This happens because the call to `-[UIKeyboard isInHardwareKeyboardMode]` on the iOSMac platform
attempts to initialize a `UHASWorkspace` from the web process, which then attempts to connect to the UIKit host
application. Instead, we can skip this call altogether on iOSMac, where the platform never considers a hardware
keyboard to be "connected", even when typing.
2018-11-23 Antti Koivisto <antti@apple.com>
UI side compositing doesn't paint on Mac
https://bugs.webkit.org/show_bug.cgi?id=191908
Reviewed by Tim Horton.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::bytesPerPixel const):
(WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):
These deep color formats are not supported on Mac.
2018-11-22 Chris Dumez <cdumez@apple.com>
Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
https://bugs.webkit.org/show_bug.cgi?id=191914
Reviewed by Ryosuke Niwa.
When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
the load proceed.
The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
to reuse a Suspended page which is hanging while trying to suspend.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] clang emits a warning when building WebKit after r238293
https://bugs.webkit.org/show_bug.cgi?id=191917
Reviewed by Dan Bernstein.
Move the implementations of -setSafeBrowsingEnabled: and -isSafeBrowsingEnabled to the main implementation of
WKPreferences to fix the warning.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]):
(-[WKPreferences isSafeBrowsingEnabled]):
2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com>
Address post-review feedback after r238438
https://bugs.webkit.org/show_bug.cgi?id=191913
Reviewed by Ryosuke Niwa.
Replace boolean arguments to setSelectedRange, replaceSelectionWithText and replaceSelectionWithFragment with
enum flags, and tweak a couple of functions to take `const Vector&` instead of `Vector&&`.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageReplaceStringMatches):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::replaceMatches):
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
(WebKit::WebPage::replaceMatches):
(WebKit::WebPage::replaceSelectionWithText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::selectWithTwoTouches):
(WebKit::WebPage::extendSelection):
(WebKit::WebPage::selectWordBackward):
(WebKit::WebPage::moveSelectionByOffset):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::replaceSelectedText):
(WebKit::WebPage::replaceDictatedText):
(WebKit::WebPage::syncApplyAutocorrection):
2018-11-22 Mark Lam <mark.lam@apple.com>
Rollout r238432: Breaks internal Mac builds.
https://bugs.webkit.org/show_bug.cgi?id=191909
<rdar://problem/46214163>
Unreviewed. Rolling out r238432: Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
2018-11-22 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.1 release.
* gtk/NEWS: Add release notes for 2.23.1.
2018-11-21 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WebKit2] Add support for replacing find-in-page text matches
https://bugs.webkit.org/show_bug.cgi?id=191786
<rdar://problem/45813871>
Reviewed by Ryosuke Niwa.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::replaceMatches):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WKTextFinderClient.mm:
(-[WKTextFinderClient replaceMatches:withString:inSelectionOnly:resultCollector:]):
Implement this method to opt in to "Replace…" UI on macOS in the find bar. In this API, we're given a list of
matches to replace. We propagate the indices of each match to the web process, where FindController maps them to
corresponding replacement ranges. Currently, the given list of matches is only ever a list containing the first
match, or a list containing all matches.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageFindStringMatches):
(WKBundlePageReplaceStringMatches):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::replaceMatches):
Map match indices to Ranges, and then call into WebCore::Page to do the heavy lifting (see WebCore ChangeLog for
more details). Additionally add a hard find-and-replace limit here to prevent the web process from spinning
indefinitely if there are an enormous number of find matches.
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::findStringMatchesFromInjectedBundle):
(WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
Add helpers to exercise find and replace in WebKit2.
(WebKit::WebPage::replaceMatches):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-11-21 Andy Estes <aestes@apple.com>
[Cocoa] Create a soft-linking file for PassKit
https://bugs.webkit.org/show_bug.cgi?id=191875
<rdar://problem/46203215>
Reviewed by Myles Maxfield.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
* SourcesCocoa.txt: Removed @no-unify from WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Ditto.
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Ditto.
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Included NSAttributedStringSPI.h.
* UIProcess/mac/WebProcessProxyMac.mm: Included ProcessPrivilege.h.
* WebKit.xcodeproj/project.pbxproj: Removed WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm from the WebKit target.
2018-11-21 Fujii Hironori <Hironori.Fujii@sony.com>
Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
https://bugs.webkit.org/show_bug.cgi?id=191853
Reviewed by Michael Catanzaro.
In r235845, I excluded InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp from unify source builds in order to
work around a MSVC bug.
Then, I commited a different workaround for the MSVC bug in
r238386. Now, we can include InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp in unified source builds. Revert
r235845.
* Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
and InjectedBundleNodeHandle.cpp
* WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
not to be compiled by XCode.
2018-11-20 Jeff Miller <jeffm@apple.com>
Return nullptr immediately if the key doesn't exist in the HashMap.
https://bugs.webkit.org/show_bug.cgi?id=191841
Reviewed by Chris Dumez.
* Shared/API/APIDictionary.h:
2018-11-20 Don Olmstead <don.olmstead@sony.com>
WebPasteboard should USE(LIBWPE)
https://bugs.webkit.org/show_bug.cgi?id=191846
Reviewed by Michael Catanzaro.
Add USE(LIBWPE) for Pasteboard related functionality within WebKit.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2018-11-20 Don Olmstead <don.olmstead@sony.com>
[WPE] Fix some feature guards in WebKit
https://bugs.webkit.org/show_bug.cgi?id=191847
Reviewed by Michael Catanzaro.
Some feature guards are not present in these files.
* UIProcess/API/wpe/PageClientImpl.cpp:
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):
2018-11-20 Antti Koivisto <antti@apple.com>
Avoid potential longer than expected layer flush delays
https://bugs.webkit.org/show_bug.cgi?id=191833
Reviewed by Dean Jackson.
Layer flush throttling also stops style recalcs and layouts. Layouts schedule layer flushes. Especially
on a slow network we can in principle end up in situation where layer flush timer fires but there is no
flush scheduled and so nothing happens. However there is a pending style recalc or layout that would
actually schedule a flush (in practice various things force style recalcs and this doesn't occur
commonly).
To avoid this we should flush unconditionally when the flush timer fires. This performs any pending
style recalc and layout too. If there is nothing to do the flush will be cheap.
PLT doesn't appear to hit cases affected by this patch and there shouldn't be any impact.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
Remove now unnecessary m_hasPendingFlush bit, simplifying the logic.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
Schedule unconditionally when unfreezing.
(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
Remove branch that starts the flush timer. It is not needed as either it was already running
or immediate flush is already scheduled and will start the timer anyway.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
(WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
Flush unconditionally.
2018-11-19 Don Olmstead <don.olmstead@sony.com>
Simplify platform check in WebEditorClient
https://bugs.webkit.org/show_bug.cgi?id=191848
Reviewed by Fujii Hironori.
!PLATFORM(GTK) && !PLATFORM(COCOA) && !PLATFORM(WPE) can be better
represented as PLATFORM(WIN).
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
2018-11-19 Alex Christensen <achristensen@webkit.org>
Add SPI to disable JIT in a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=191822
<rdar://problem/28119360>
Reviewed by Geoffrey Garen.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _canUseJIT:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration enableJIT]):
(-[_WKProcessPoolConfiguration setEnableJIT:]):
* UIProcess/Launcher/ProcessLauncher.h:
(WebKit::ProcessLauncher::Client::enableJIT const):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canUseJIT):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::enableJIT const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const):
(WebKit::WebProcessProxy::processPool): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::canUseJIT):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2018-11-19 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API for CertificateInfo.
https://bugs.webkit.org/show_bug.cgi?id=191647
Reviewed by Alex Christensen.
Added API for CertificateInfo to create, fetch contents.
Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
* PlatformWin.cmake:
* Shared/API/c/curl/WKCertificateInfoCurl.cpp: Added.
(WKCertificateInfoCreateWithCertficateChain):
(WKCertificateInfoGetVerificationError):
(WKCertificateInfoGetCertificateChainSize):
(WKCertificateInfoCopyCertificateAtIndex):
* Shared/API/c/curl/WKCertificateInfoCurl.h: Copied from Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp.
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<CertificateInfo>::encode):
(IPC::ArgumentCoder<CertificateInfo>::decode):
2018-11-19 Don Olmstead <don.olmstead@sony.com>
Add USE(LIBWPE) for WebKit events
https://bugs.webkit.org/show_bug.cgi?id=191842
Reviewed by Michael Catanzaro.
Moves all WPE events to USE(LIBWPE) instead of PLATFORM(WPE). Updates
filenames to LibWPE.
* PlatformWPE.cmake:
* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebTouchEvent.h:
* Shared/NativeWebWheelEvent.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebKeyboardEventWPE.cpp.
* Shared/libwpe/NativeWebMouseEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebMouseEventWPE.cpp.
* Shared/libwpe/NativeWebTouchEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebTouchEventWPE.cpp.
* Shared/libwpe/NativeWebWheelEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebWheelEventWPE.cpp.
* Shared/libwpe/WebEventFactory.cpp: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.cpp.
* Shared/libwpe/WebEventFactory.h: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.h.
* SourcesWPE.txt:
2018-11-19 David Quesada <david_quesada@apple.com>
EXC_BAD_ACCESS when invoking a DownloadProxy's destination decision handler after the download has been canceled
https://bugs.webkit.org/show_bug.cgi?id=191762
rdar://problem/46151509
Reviewed by Dean Jackson.
When the DownloadClient calls the decision handler with a destination path, check if
m_processPool is null before trying to access its network process. This can happen
if a download is canceled before the client decides its destination.
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2018-11-19 Tomoki Imai <Tomoki.Imai@sony.com>
[cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBackground=false in general Cairo ports
https://bugs.webkit.org/show_bug.cgi?id=191577
Reviewed by Carlos Garcia Campos.
We should use CompositeCopy operator to update bitmap to overwrite existing bitmap even if source contains
transparent parts. It enables ports which uses Cairo to set drawsBackground to false.
GTK ports has custom background extension, and in such case, we need to use CompositeSourceOver to retain
custom background.
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate): Use CompositeCopy operator to update bitmap.
2018-11-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: "Reload Web Inspector" button no longer partially works
https://bugs.webkit.org/show_bug.cgi?id=191773
<rdar://problem/46139932>
Reviewed by Devin Rousso.
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::reopen):
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.messages.in:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::reopen):
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::reopen):
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::reopen):
* WebProcess/WebPage/WebInspectorUI.h:
2018-11-19 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Solve some issues in the enumerateDevices code
https://bugs.webkit.org/show_bug.cgi?id=191832
Reviewed by Carlos Garcia Campos.
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
Increase the version to 2.24.
(webkitDeviceInfoPermissionRequestAllow):
(webkitDeviceInfoPermissionRequestDeny):
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
Replace the forward declaration with the include.
* UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
* UIProcess/API/gtk/WebKitWebsiteData.h:
Increase the version to 2.24.
* UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
* UIProcess/API/wpe/WebKitWebsiteData.h:
Increase the version to 2.24.
2018-11-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build after r238318.
Add new symbols to API documentation files. They should have been added in r237031, but r238318 revealed it.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2018-11-19 Joseph Pecoraro <pecoraro@apple.com>
Regression(r238330): A lot of WebInspector tests are crashing on the bots
https://bugs.webkit.org/show_bug.cgi?id=191814
Reviewed by Ryosuke Niwa.
Expose the expected connection type from the UIProcess into the WebProcess.
When there is a local inspector connection to the UIProcess expose it as
a local frontend channel to the inspector controllers in the Page.
* UIProcess/WebPageInspectorTargetAgent.h:
* UIProcess/WebPageInspectorTargetAgent.cpp:
(WebKit::WebPageInspectorTargetAgent::frontendChannel):
An additional FrontendChannel class is not needed, just use self.
(WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
(WebKit::WebPageInspectorTargetAgent::connectionType const):
(WebKit::WebPageInspectorTargetAgent::sendMessageToFrontend):
Expose the channel to targets as local if there is a local frontend
in the UIProcess.
2018-11-18 Joseph Pecoraro <pecoraro@apple.com>
Regression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug
https://bugs.webkit.org/show_bug.cgi?id=191812
Reviewed by Chris Dumez.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setFrontendConnection):
It can be possible to receive a frontend connection multiple times
if another WebProcess opened the inspector and this WebProcess got
swapped in before the InspectorProcess notified the WebProcess of
a connection to use. It is always best to use the latest connection
we have received, since any others would have been invalidated.
2018-11-18 Chris Dumez <cdumez@apple.com>
[PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process
https://bugs.webkit.org/show_bug.cgi?id=191828
Reviewed by Antti Koivisto.
WebPageProxy::didPerformClientRedirect() had a MESSAGE_CHECK_URL() for both the source
and the destination URL. The macro calls WebProcessProxy::checkURLReceivedFromWebProcess()
to make sure that both URLs were actually loaded by this WebContent process.
However, now that we're enabled process-swap on cross-site navigation, these checks are no
longer fully valid. If the client-side redirect is cross-site, then the source and destination
URLs get loaded by 2 different WebContent processes. Since didPerformClientRedirect() gets
called after the redirect and gets set by the new WebContent process, only the destination URL
is guaranteed to have been loaded by this process. The source URL may have been loaded in
another process so this patch drops the message check for the source URL.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformClientRedirect):
2018-11-18 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use Box<BinarySemaphore> instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=189691
Reviewed by Ryosuke Niwa.
Use Box<BinarySemaphore> instead, which utilizes our WTF::Lock mechanism.
* NetworkProcess/watchos/NetworkProximityManager.mm:
(WebKit::NetworkProximityManager::updateRecommendation):
2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
https://bugs.webkit.org/show_bug.cgi?id=191819
Reviewed by Dan Bernstein.
Replace UIItemProvider (and related classes) with NSItemProvider.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView dropInteraction:performDrop:]):
2018-11-17 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed WinCairo build fix for r238353.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
2018-11-17 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: m_messageReceivers.contains(...) under ViewGestureController removeMessageReceiver
https://bugs.webkit.org/show_bug.cgi?id=191734
<rdar://problem/46151497>
Reviewed by Ryosuke Niwa.
When a WebProcess crashes, we destroy the ViewGestureController and reconstruct it later
after we've relaunched a new WebProcess. The ViewGestureController controller takes care
of adding itself as an IPC message receiver to the WebProcessProxy, and the destructor
takes care of removing itself as an IPC message receiver.
However, when process-swapping on navigation, we do not destroy the ViewGestureController
because doing so would take down the swipe gesture snapshot on cross-site swipe navigation.
This led to hitting this assertion later on because the ViewGestureController is still
registered as an IPC message receiver with the old process after process swapping.
To address the issue, we now make sure the ViewGestureController unregisters itself from
the old process and registers itself with the new process on process-swap.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::processWillSwap):
(WebKit::WebViewImpl::didRelaunchProcess):
2018-11-17 Chris Dumez <cdumez@apple.com>
[PSON] ASSERTION FAILED: m_uncommittedState.state == State::Committed
https://bugs.webkit.org/show_bug.cgi?id=191781
Reviewed by Ryosuke Niwa.
The crash was happening when switching to a suspended page that is not yet done
suspending (e.g. in case of very fast back/forward navigation). The WebPageProxy
would reattach to the suspended process and get load notifications that it did
not expect since it did not schedule any load yet. Those notifications are for
the about:blank load we do for page suspension.
To address the issue, make swapToWebProcess() asynchronous and take a completion
handler. When we try to unsuspend a SuspendedPageProxy, we first make sure it
is actually done suspending. If it is not done suspending, we wait until it is
before telling in to unsuspend and proceeding with the new load.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didFinishLoad):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
2018-11-17 Chris Dumez <cdumez@apple.com>
Unreviewed follow-up to r238343 to address debug assertions in 2 API tests.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::networkProcessCrashed):
2018-11-17 Devin Rousso <drousso@apple.com>
Web Inspector: Network: add button to show system certificate dialog
https://bugs.webkit.org/show_bug.cgi?id=191458
<rdar://problem/45977019>
Reviewed by Joseph Pecoraro.
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::showCertificate): Added.
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::showCertificate): Added.
* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::showCertificate): Added.
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::showCertificate): Added.
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Removed.
Moved `WebCore::CertificateInfo` code for `WTF::Encoder` and `WTF::Decoder` into their
respective platform's CertificateInfo.h file.
* UIProcess/Authentication/mac/WebCredentialMac.mm:
* Configurations/WebKit.xcconfig:
* PlatformMac.cmake:
* PlatformWin.cmake:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebKit.xcodeproj/project.pbxproj:
2018-11-16 Chris Dumez <cdumez@apple.com>
Regression(ProcessPrewarming) Assertion hit in NetworkProcessProxy destructor
https://bugs.webkit.org/show_bug.cgi?id=191800
Reviewed by Ryosuke Niwa.
Make sure the NetworkProcessProxy destructor calls its remaining m_pendingConnectionReplies
completion handlers to avoid hitting an assertion in the CompletionHandler destructor.
Prewarmed WebProcess do not keep the ProcessPool alive and thus not the NetworkProcessProxy
either. As a result, it is possible for NetworkProcessProxy to have pending connection
requests from those prewarmed processes when it is destroyed. Similar story for the
suspended page processes when they are destroyed.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
2018-11-16 Alex Christensen <achristensen@webkit.org>
Tweak _showSafeBrowsingWarningWithTitle SPI
https://bugs.webkit.org/show_bug.cgi?id=191799
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(+[WKWebView _visitUnsafeWebsiteSentinel]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning clickedOnLink:]):
I need to localize "Continue" and "Cancel" so they aren't always in English.
2018-11-16 Chris Dumez <cdumez@apple.com>
WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=191797
Reviewed by Ryosuke Niwa.
We were hitting the assertion because the error handler was first getting called. It would
deallocate the send right, cancel/null out the XPC connection and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()).
Then the xpc_connection_send_message_with_reply() block would get called later and
would try to deallocate the send right again, and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()) again because the xpc
connection is null.
Handle this case by having the xpc_connection_send_message_with_reply() block check
that we're still launching (i.e. didFinishLaunchingProcess() has not been called
yet).
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
2018-11-16 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed follow-up to r238330.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Don't clear the pointer after invalidating since the pointer is
used later one. We don't mind it being used after invalidation
it will do the right thing, we'd rather have the WebInspectorProxy
lifetime match the WebPageProxy.
2018-11-16 Chris Dumez <cdumez@apple.com>
ProcessSwap.NavigationWithLockedHistoryWithoutPSON API test is a flaky crash in debug
https://bugs.webkit.org/show_bug.cgi?id=191795
Reviewed by Alex Christensen.
If the WebProcessPool is getting destroyed while there is a prewarmed WebContent process
that is awaiting its connnection to the network process, then we'll hit the
process->hasOneRef() assertion in the WebProcessPool destructor. This is because
NetworkProcessProxy::m_pendingConnectionReplies keeps a RefPtr to the WebProcessProxy
that is awaiting the connection. The NetworkProcessProxy does not really need to keep
the WebProcessProxy alive in this case so this patch switches to using a WeakPtr instead.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::networkProcessCrashed):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessProxy.h:
2018-11-16 Chris Dumez <cdumez@apple.com>
[macOS] Label "prewarmed" WebContent processes in Activity Monitor
https://bugs.webkit.org/show_bug.cgi?id=191765
<rdar://problem/45953463>
Reviewed by Geoffrey Garen.
Label "prewarmed" WebContent processes in Activity Monitor to facilitate debugging.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::markIsNoLongerPrewarmed):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::updateProcessName):
(WebKit::WebProcess::platformInitializeProcess):
2018-11-16 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
https://bugs.webkit.org/show_bug.cgi?id=191740
<rdar://problem/45470897>
Reviewed by Timothy Hatcher.
When a web page asks to open a local Web Inspector, that inspector
will now connect in the UIProcess (WebPageProxy / WebPageInspectorController)
instead of the WebContentProcess (WebKit::WebInspector / InspectorController).
Previously a WebInspectorProxy was re-created every time the WebPageProxy's
WebPage / WebProcess was changed, effectively closing the Web Inspector
frontend when the WebPage was swapped or crashed.
This change keeps the WebInspectorProxy alive as long as the WebPageProxy
is alive. During process swaps, or process crashes, the WebInspectorProxy
is reset when the page is reset and updated when the page's WebProcess
changes. Since WebInspectorProxy owns the Web Inspector view / window
the Web Inspector window can be kept alive across (and attached state)
across WebPage / WebProcess changes.
Previously the WebContentProcess's WebKit::WebInspector was the Local
FrontendChannel for the WebCore::InspectorController. This can't
outlive the single WebContentProcess.
This change makes the UIProcesses' WebInspectorProxy the Local FrontendChannel
for the WebKit::WebPageInspectorController. Given the WebInspectorProxy
now stays alive alongside the WebPageProxy this will live across process changes.
This means that the WebInspectorUI process must send its backend messages to
the WebInspectorProxy -> WebPageInspectorController now instead of the
old path WebInspector -> WebCore::InspectorController.
A direct IPC connection is still maintained between the WebContentProcess's
WebKit::WebInspector and the InspectorProcess's WebInspectorUI. Previously
this connection was established by WebKit::WebInspector vending an
IPC::Attachment to the WebInspectorUI process. This patch inverts that
relationship, because the WebInspectorUI process now lives across multiple
WebContentProcess changes. The WebInspectorUI now vends the IPC::Attachment
to the WebContentProcess each time the process changes. This way they can both
still communicate through normal Messages::WebInspector/WebInspectorUI
messages and everything behaves as previously expected.
* Scripts/webkit/messages.py:
Header for Inspector::FrontendChannel::ConnectionType.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::openLocalFrontend):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openLocalInspectorFrontend):
(WebKit::WebInspector::setFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
(WebKit::WebInspector::close):
(WebKit::WebInspector::openFrontendConnection): Deleted.
(WebKit::WebInspector::sendMessageToBackend): Deleted.
(WebKit::WebInspector::sendMessageToFrontend): Deleted.
On the WebProcess side we ask the UIProcess to open a local frontend and now
receive instead of vend an IPC connection to the WebInspectorUI process.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetState):
Keep the WebInspectorProxy alive alongside the WebPageProxy.
Update it as processes / states change.
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::createInspectorPage): Deleted.
(WebKit::WebInspectorProxy::sendMessageToFrontend):
(WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
Open and close a local frontend by being the FrontendChannel on the UIProcess side.
(WebKit::WebInspectorProxy::sendMessageToBackend):
Dispatch WebInspectorUI backend messages to the UIProcess's InspectorController
now that the InspectorController is here instead of in the WebProcess.
(WebKit::WebInspectorProxy::setFrontendConnection):
Transfer the WebProcess <-> InspectorProcess IPC connection through us
because we are the one link between them when processes change.
(WebKit::WebInspectorProxy::invalidate):
(WebKit::WebInspectorProxy::frontendLoaded):
Be safer and handle inspectedPage being potentially null.
* WebProcess/WebPage/WebPageInspectorTargetController.cpp:
(WebKit::WebPageInspectorTargetController::connectInspector):
* WebProcess/WebPage/WebPageInspectorTargetController.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
(WebKit::WebPageInspectorTargetFrontendChannel::create):
(WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::connect):
Proxy the ConnectionType received on the UIProcess side to the WebProcess side
when connecting to sub-targets.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::connectInspector):
(WebKit::WebPage::setHasLocalInspectorFrontend): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::hasLocalInspectorFrontend const): Deleted.
(WebKit::WebPageProxy::setHasLocalInspectorFrontend): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
Eliminate the hasLocalInspectorFrontend state that was only used
to disable PSON. PSON no longer needs to be disabled for this reason.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
(WebKit::WebInspectorUI::updateConnection):
(WebKit::WebInspectorUI::closeWindow):
(WebKit::WebInspectorUI::sendMessageToBackend):
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.messages.in:
Vend an IPC connection on demand to the WebProcess side.
2018-11-16 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
https://bugs.webkit.org/show_bug.cgi?id=191744
<rdar://problem/46125461>
Unreviewed, install the file.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
2018-11-16 Zalan Bujtas <zalan@apple.com>
Add DidFirstMeaningfulPaint milestone.
https://bugs.webkit.org/show_bug.cgi?id=191754
Reviewed by Simon Fraser.
* Shared/API/c/WKPageLoadTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toWKLayoutMilestones):
(WebKit::toLayoutMilestones):
* UIProcess/API/C/WKPageRenderingProgressEvents.h:
* UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
(pageRenderingProgressEvents):
2018-11-16 Chris Dumez <cdumez@apple.com>
Automatic process prewarming should be turned on if PSON is enabled via experimental features
https://bugs.webkit.org/show_bug.cgi?id=191761
Reviewed by Ryosuke Niwa.
m_isAutomaticProcessWarmingEnabledByClient is a std::optional and should not be initialized to
true / false until the client calls API to toggle the feature. When m_isAutomaticProcessWarmingEnabledByClient
is std::nullopt then m_processSwapsOnNavigationFromExperimentalFeatures controls automatic
process prewarming.
* UIProcess/API/APIProcessPoolConfiguration.h:
2018-11-16 Alex Christensen <achristensen@webkit.org>
Add API to disable safe browsing checks
https://bugs.webkit.org/show_bug.cgi?id=191610
Reviewed by Dean Jackson.
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]):
(-[WKPreferences isSafeBrowsingEnabled]):
(-[WKPreferences _setSafeBrowsingEnabled:]): Deleted.
(-[WKPreferences _safeBrowsingEnabled]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2018-11-16 Chris Dumez <cdumez@apple.com>
WebKit.UnavailablePlugIn API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=191753
Reviewed by Alex Christensen.
Add missing early returns. Those were mistakenly dropped in r235200.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
2018-11-16 Chris Dumez <cdumez@apple.com>
[Mac] Regression: WebContent process's display name is no longer set
https://bugs.webkit.org/show_bug.cgi?id=191722
<rdar://problem/45960550>
Reviewed by Per Arne Vollan.
Make sure The WebContent process calls _RegisterApplication() during initialization and
*before* trying to set its display name. Setting the display name fails otherwise.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):
2018-11-16 Ryosuke Niwa <rniwa@webkit.org>
Enable process swap on cross-site navigation by default on iOS
https://bugs.webkit.org/show_bug.cgi?id=191735
Reviewed by Chris Dumez.
Enabled the feature.
* Shared/WebPreferencesDefaultValues.h:
2018-11-16 Antti Koivisto <antti@apple.com>
REGRESSION(r237467) [PSON] iOS: Going back to a page sometimes doesn't restore the full page
https://bugs.webkit.org/show_bug.cgi?id=191737
Reviewed by Simon Fraser.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setLayerTreeStateIsFrozen):
Layer tree should stay frozen in m_shouldResetDrawingArea state. Otherwise spurious commit transactions may
mess up state on UI process side.
Specifically WKWebView._needsResetViewStateAfterCommitLoadForMainFrame would get stuck to TRUE and prevent
all viewport updates because WKWebView._firstPaintAfterCommitLoadTransactionID has value greater
than any current transaction IDs.
2018-11-16 Chris Dumez <cdumez@apple.com>
Unreviewed typo fix in comment added in r238250.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2018-11-16 Sihui Liu <sihui_liu@apple.com>
Storing blobs in IDB on iOS: "Error preparing blob/file"
https://bugs.webkit.org/show_bug.cgi?id=188438
<rdar://problem/43097279>
Reviewed by Alex Christensen.
Grant sandbox extension of temp folder to network process, and clean up some code that managed sandbox extension
of IDB temporary blob files in network process.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Deleted.
(WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didGetAllRecords):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
(WebKit::preregisterSandboxExtensionsIfNecessary): Deleted.
2018-11-16 Don Olmstead <don.olmstead@sony.com>
Add USE(LIBWPE) to WebCore
https://bugs.webkit.org/show_bug.cgi?id=191401
Reviewed by Michael Catanzaro.
Rename PlatformDisplayWPE to PlatformDisplayLibWPE.
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::initialize):
* WebProcess/wpe/WebProcessMainWPE.cpp:
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add API to enable/disable device mocks
https://bugs.webkit.org/show_bug.cgi?id=191699
This basically us to test MediaStream/WebRTC support without
requiring cameras or microphones and is quite useful.
Also fix the GStreamerAudioMock by:
- Stop setting `leaky-upstream` on the GStreamerCapturer queue,
this was usefull when we were trying to bring the MediaStream
sources inside the main pipeline, it is not the case anymore
(and not doable with latest version of LibWebRTC).
- Use a 'ticks' wave on the gstreamer audiotestsrc so the test
stream is similar to what Apple port does.
Reviewed by Xabier Rodriguez-Calvar.
The mocks are already tested and the API is really simple.
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_mock_capture_devices):
(webkit_settings_set_enable_mock_capture_devices):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
https://bugs.webkit.org/show_bug.cgi?id=191744
It should always have been there.
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/webkit2.h:
2018-11-16 Antoine Quint <graouts@apple.com>
PointerEvents should not require touch event listeners to be registered
https://bugs.webkit.org/show_bug.cgi?id=191333
<rdar://problem/45857523>
Reviewed by Dean Jackson.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):
(WebKit::WebPageProxy::touchEventTrackingType const):
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::handleTouchEventAsynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
2018-11-15 Myles C. Maxfield <mmaxfield@apple.com>
WKPreferencesSetFontSmoothingLevel doesn't actually do anything
https://bugs.webkit.org/show_bug.cgi?id=191708
Reviewed by Simon Fraser.
Delete the symbol because no one calls it and it doesn't do anything
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/FontSmoothingLevel.h: Removed.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toFontSmoothingLevel): Deleted.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFontSmoothingLevel): Deleted.
(WKPreferencesGetFontSmoothingLevel): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/WebPreferences.h:
* WebKit.xcodeproj/project.pbxproj:
* mac/WebKit2.order:
2018-11-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238244.
Caused High Sierra test runs to fail early with 50 crashes and
casued 25 API failures.
Reverted changeset:
"[css-logical] Implement flow-relative margin, padding and
border shorthands"
https://bugs.webkit.org/show_bug.cgi?id=188697
https://trac.webkit.org/changeset/238244
2018-11-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unused WebInspectorProxy code
https://bugs.webkit.org/show_bug.cgi?id=191674
Reviewed by Dean Jackson.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::setInspectorWindowFrame): Deleted.
(WebKit::WebInspectorProxy::inspectorWindowFrame): Deleted.
* WebProcess/WebPage/WebInspector.h:
2018-11-15 Ryosuke Niwa <rniwa@webkit.org>
Enable process swap on cross-site navigation by default on macOS
https://bugs.webkit.org/show_bug.cgi?id=191572
Reviewed by Chris Dumez.
Enabled the feature by default on macOS.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2018-11-15 Chris Dumez <cdumez@apple.com>
IndexedDB.IndexedDBTempFileSize API test times out with process prewarming enabled
https://bugs.webkit.org/show_bug.cgi?id=191671
<rdar://problem/46086062>
Reviewed by Alex Christensen.
Enabling process prewarming caused IndexedDB.IndexedDBTempFileSize API to time out and print
the following line:
"Attempted to create a NetworkLoad with a session (id=2) that does not exist."
This actually identified a pre-existing bug with our handling of non-default data store.
Whenever a page starts using a data store, we call WebProcessPool::pageBeginUsingWebsiteDataStore()
which will call NetworkProcessProxy::addSession() if the network process was already started
to let the network process know about this non-default session. There are several issues with the
current model:
1. If the network process was not created yet when pageBeginUsingWebsiteDataStore() is called,
then the network process will not know about the non-default session when it actually gets
started later on. This is unlikely to happen in practice, except in case of network process
crash because we create the network process as soon as we initialize the first WebProcessProxy.
2. Even if we successfuly managed to register the session with the network process proxy, we get
in trouble if the network process crashes or is terminated later on as we do not re-register
those sessions with the new network process.
To address these 2 issues, WebProcessPool::ensureNetworkProcess() now takes care of registering
all the non-default sessions (that are associated with this process pool) with the new network
process. The WebProcessPool knows about these sessions because it adds them to m_sessionToPagesMap
whenever WebProcessPool::pageBeginUsingWebsiteDataStore() is called, even if the network process
proxy was not created yet.
The reason the IndexedDB.IndexedDBTempFileSize API test was failing was because it did:
1. A load in a WebView V1 with a non-default session
2. Process prewarming kicked in after this load and would create a new WebProcessProxy.
3. Terminate the network process
4. Another load in a WebView V2 with the same non-defaut session, which would reuse the
prewarmed process. Because the network process was terminated, constructing the new
page would not register the session ID with the new network process when
pageBeginUsingWebsiteDataStore() is called.
-> The load would hang because the new network process would not know about the
non-default session when started later on.
The bug was previously hidden without process prewarming because step 4 would create a *new*
WebProcessProxy and WebProcessPool::initializeNewWebProcess() would call ensureNetworkProcess()
so that pageBeginUsingWebsiteDataStore() would successfuly register the session with the
network process later on.
I wrote a second API test (WebKit.DoLoadWithNonDefaultDataStoreAfterTerminatingNetworkProcess)
to demonstrate the pre-existing bug without process prewarming enabled.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
2018-11-15 Vivek Seth <v_seth@apple.com>
Create feature flag (HTTPS_UPGRADE)
https://bugs.webkit.org/show_bug.cgi?id=191613
<rdar://problem/45851068>
Reviewed by Dean Jackson.
* config.h:
2018-11-15 Chris Dumez <cdumez@apple.com>
Regression(r238215) WKProcessPool.WarmInitialProcess API test is failing
https://bugs.webkit.org/show_bug.cgi?id=191693
Reviewed by Alex Christensen.
Allow *explicit* process prewarming to construct the default data store if necessary or we would
not be obeying the client's request. Only automatic process prewarming should avoid constructing
the default data store unnecessarily to avoid causing memory regressions.
* UIProcess/API/C/WKContext.cpp:
(WKContextWarmInitialProcess):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _warmInitialProcess]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::prewarmProcess):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToOneProcess):
2018-11-14 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, comment improvement over r238166.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Use a real nonce for CTAPHID_INIT
https://bugs.webkit.org/show_bug.cgi?id=191533
<rdar://problem/46103502>
Reviewed by Brent Fulgham.
Use a real nonce for CTAPHID_INIT request according to:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#ctaphid_init-0x06.
The challenge here is the new transaction needs to start in the next runloop otherwise a dead lock will form:
wrong nonce -> new transaction -> new nonce -> write init request -> read init response from last run as it
piped in the run loop -> wrong nonce of course -> ...
To break the above dead lock, we have to start the new transaction in the next run. However, that isn't
sufficient as the arrived init response will be piped in HidConnection::m_inputReports, which is designed
on purpose to store any data packets within (initialized, terminated) time interval to prevent data loss in
the case when HidConnection::registerDataReceivedCallback is called after the first data packet's arrival.
In order to break the dead lock completely, HidConnection::invalidateCache will bnnne called prior to every
send to delete any potential init response from last run. HidConnection::invalidateCache is not necessary
for other protocols though. The above scenario is more or less a design flaw in CTAP HID.
Of course, all above scenarios are covered in our mock tests.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Cocoa/HidConnection.h:
(WebKit::HidConnection::invalidateCache):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
* UIProcess/WebAuthentication/Mock/MockHidConnection.h:
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::Worker::transact):
(WebKit::CtapHidDriver::CtapHidDriver):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::returnResponse):
* UIProcess/WebAuthentication/fido/CtapHidDriver.h:
2018-11-15 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Reviewed by Simon Fraser and Antti Koivisto.
Add a CSSLogicalEnabled runtime flag.
* Shared/WebPreferences.yaml:
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
https://bugs.webkit.org/show_bug.cgi?id=191522
Reviewed by Brent Fulgham.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):
2018-11-15 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Make Accept-Languages header look more like other browsers
https://bugs.webkit.org/show_bug.cgi?id=191614
Reviewed by Carlos Garcia Campos.
This changes our Accept-Language header to better match other browsers, from something
like this:
Accept-Language: en-us, en;q=0.90, es-es;q=0.80, es;q=0.70
to something like this:
Accept-Language: en-US,en;q=0.90,es-ES;q=0.80,es;q=0.70
There's no particular motivation for this change. I just noticed we were different for no
clear reason.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_set_preferred_languages):
2018-11-15 Daniel Bates <dabates@apple.com>
[iOS] Shift + Tab does not focus previous field
https://bugs.webkit.org/show_bug.cgi?id=191596
<rdar://problem/45892053>
Reviewed by Wenson Hsieh.
Wire up the the tab and shift + tab key commands to the WKWebView/WKContentView's
action forwarding mechanism. Also rename -_prevAccessoryTab to -_previousAccessoryTab.
* Platform/spi/ios/UIKitSPI.h: Add more SPI.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView keyCommands]):
(-[WKContentView _nextAccessoryTabForWebView:]): Added.
(-[WKContentView _previousAccessoryTabForWebView:]): Added.
(-[WKContentView _nextAccessoryTab:]): Deleted.
(-[WKContentView _prevAccessoryTab:]): Deleted.
2018-11-15 Keith Rollin <krollin@apple.com>
Delete old .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191669
<rdar://problem/46081994>
Reviewed by Chris Dumez.
.xcfilelist files were created and added to the Xcode project files in
https://trac.webkit.org/changeset/238008/webkit. However, they caused
build issues and they were removed from the Xcode projects in
https://trac.webkit.org/changeset/238055/webkit. This check-in removes
the files from the repository altogether. They'll ultimately be
replaced with new files with names that indicate whether the
associated files are inputs to the Run Script phase or are files
created by the Run Script phase.
* DerivedSources.xcfilelist: Removed.
* UnifiedSources.xcfilelist: Removed.
2018-11-15 Frederic Wang <fwang@igalia.com>
[WebAuthN] Make AuthenticatorManager
https://bugs.webkit.org/show_bug.cgi?id=189279
Unreviewed build fix.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: Add missing header.
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: Ditto.
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: Ditto.
2018-11-14 Keith Rollin <krollin@apple.com>
Move scripts for Derived and Unified Sources to external files
https://bugs.webkit.org/show_bug.cgi?id=191670
<rdar://problem/46082278>
Reviewed by Keith Miller.
Move the scripts in the Generate Derived Sources and Generate Unified
Sources Run Script phases from the Xcode projects to external shell
script files. Then invoke those scripts from the Run Script phases.
This refactoring is being performed to support later work that will
invoke these scripts in other contexts.
The scripts were maintained as-is when making the move. I did a little
reformatting and added 'set -e' to the top of each file, but that's
it.
* Scripts/generate-derived-sources.sh: Added.
* Scripts/generate-unified-sources.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
2018-11-14 Chris Dumez <cdumez@apple.com>
WebKit.DecidePolicyForNavigationActionForHyperlinkThatRedirects API fails when PSON is enabled
https://bugs.webkit.org/show_bug.cgi?id=191640
Reviewed by Alex Christensen.
The issue was that when process-swapping on a redirect, the parameters provided by the new
WebContent process for navigationActionData / originatingFrameInfoData / frameSecurityOrigin
are not correct because it does not have sufficient information (it does not know a swap
happened).
To address the issue, we now store the navigationActionData / originatingFrameInfoData /
frameSecurityOrigin on the Navigation object whenever decidePolicyForNavigationAction is
called. If the decidePolicyForNavigationAction is for a redirect, use the ones we stored
on the Navigation object instead of the ones provided by the WebContent process. In case
of redirect, those do not change anyway.
This fixes all WebKit.DecidePolicyForNavigationAction* tests with PSON enabled.
* UIProcess/API/APINavigation.h:
(API::Navigation::currentRequestIsRedirect const):
(API::Navigation::wasUserInitiated const):
(API::Navigation::shouldForceDownload const):
(API::Navigation::treatAsSameOriginNavigation const):
(API::Navigation::hasOpenedFrames const):
(API::Navigation::openedViaWindowOpenWithOpener const):
(API::Navigation::opener const):
(API::Navigation::requesterOrigin const):
(API::Navigation::lockHistory const):
(API::Navigation::lockBackForwardList const):
(API::Navigation::clientRedirectSourceForHistory const):
(API::Navigation::setLastNavigationAction):
(API::Navigation::lastNavigationAction const):
(API::Navigation::setOriginatingFrameInfo):
(API::Navigation::originatingFrameInfo const):
(API::Navigation::setDestinationFrameSecurityOrigin):
(API::Navigation::destinationFrameSecurityOrigin const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
2018-11-14 Chris Dumez <cdumez@apple.com>
WebKit.WebsiteDataStoreCustomPaths API test is failing when enabling process prewarming
https://bugs.webkit.org/show_bug.cgi?id=191638
Reviewed by Alex Christensen.
WebProcessPool::prewarmProcess() should not create the default WebSite Data Store if it
does not exist yet. This is bad for memory consumption and it is what was causing this
API test to fail.
WebProcessPool::prewarmProcess() now tries to use the following data stores in this
order of preference:
1. WebProcessPool::m_websiteDataStore (aka this process pool's primary data store)
2. The data store of the last WebProcessProxy that was created
3. The default data store if it exists
If no suitable data store is found, we cancel the process prewarming and log a console
message instead.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::prewarmProcess):
2018-11-14 Timothy Hatcher <timothy@apple.com>
Enabled dark mode CSS support by default.
https://bugs.webkit.org/show_bug.cgi?id=191609
rdar://problem/46046861
Reviewed by Megan Gardner.
* Shared/WebPreferences.yaml: Set DarkModeCSSEnabled's defaultValue to true.
2018-11-14 Timothy Hatcher <timothy@apple.com>
Default the view background color and text color to different values when in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191607
rdar://problem/46045854
Reviewed by Dean Jackson.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::backgroundColor const): Use controlBackgroundColor.
(WebKit::WebViewImpl::updateLayer): Simplified and use backgroundColor() getter.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Drop backgroundColor.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setDrawsBackground): Drop backgroundColor.
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
https://bugs.webkit.org/show_bug.cgi?id=191612
Reviewed by Matt Baker.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
(WebKit::WebAutomationSession::terminate):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::connect):
(WebKit::WebPageDebuggable::disconnect):
* UIProcess/WebPageDebuggable.h:
* UIProcess/WebPageInspectorController.cpp:
(WebKit::WebPageInspectorController::connectFrontend):
(WebKit::WebPageInspectorController::disconnectFrontend):
* UIProcess/WebPageInspectorController.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::close):
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::connect):
(WebKit::WebPageInspectorTarget::disconnect):
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed attempted wincairo build fix after 238192.
* WebProcess/WebPage/WebPageInspectorTargetController.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Follow-up: Keep Disabling Process Swap for Local Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=191494
<rdar://problem/45469854>
Reviewed by Devin Rousso.
Continue to have the Local Inspector disable PSON while open
until support is added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::hasLocalInspectorFrontend const):
(WebKit::WebPageProxy::setHasLocalInspectorFrontend):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHasLocalInspectorFrontend):
* WebProcess/WebPage/WebPage.h:
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
https://bugs.webkit.org/show_bug.cgi?id=191494
<rdar://problem/45469854>
Reviewed by Devin Rousso.
To support process swapping a slim Web Inspector backend lives in the UIProcess.
The Web Inspector frontend connects to it and is told about sub-targets, namely
pages, that it can further connect to. When performing a process swap the backend
tells the frontend to destroy existing targets and create new targets.
In the UIProcess the WebPageProxy has a WebPageInspectorController, with a single
TargetAgent holding InspectorTargetProxies to targets it knows about. Inspector
protocol messages go through this inspector controller and are routed to the
WebPage and its WebCore::Page's InspectorController. The WebPageProxy decides
when to close and expose new page targets during process swap, or basically
any time it reconnects to a WebProcess. So this patch also makes Web Inspector
stay alive and reconnect to a page when the inspected page crashes!
In the WebContentProcess the WebPage has a WebPageInspectorTarget. It also
has a WebPageInspectorTargetController in anticipation of further sub-targets
within the page (workers, frames) but none exist at the moment. The WebPage
relies on the WebPageProxy to know when to expose this target as a debuggable.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
New files.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Remote inspector state can now stay in the UIProcess and does not need to
be passed down to the WebContentProcess.
* UIProcess/WebPageDebuggable.cpp: Copied from Source/WebCore/page/PageDebuggable.cpp.
(WebKit::WebPageDebuggable::WebPageDebuggable):
(WebKit::WebPageDebuggable::name const):
(WebKit::WebPageDebuggable::url const):
(WebKit::WebPageDebuggable::hasLocalDebugger const):
(WebKit::WebPageDebuggable::connect):
(WebKit::WebPageDebuggable::disconnect):
(WebKit::WebPageDebuggable::dispatchMessageFromRemote):
(WebKit::WebPageDebuggable::setIndicating):
(WebKit::WebPageDebuggable::setNameOverride):
* UIProcess/WebPageDebuggable.h: Copied from Source/WebCore/page/PageDebuggable.h.
Remote debuggable entry point into the UIProcess for a page.
This is pretty much identical to the PageDebuggable in WebCore.
* Scripts/webkit/messages.py:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::createInspectorTarget):
(WebKit::WebPageProxy::destroyInspectorTarget):
(WebKit::WebPageProxy::sendMessageToInspectorFrontend):
(WebKit::WebPageProxy::setIndicating):
(WebKit::WebPageProxy::allowsRemoteInspection const):
(WebKit::WebPageProxy::setAllowsRemoteInspection):
(WebKit::WebPageProxy::remoteInspectionNameOverride const):
(WebKit::WebPageProxy::setRemoteInspectionNameOverride):
(WebKit::WebPageProxy::remoteInspectorInformationDidChange):
(WebKit::WebPageProxy::clearInspectorTargets):
(WebKit::WebPageProxy::createInspectorTargets):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::inspectorController):
(WebKit::WebPageProxy::allowsRemoteInspection const): Deleted.
(WebKit::WebPageProxy::remoteInspectionNameOverride const): Deleted.
Own more inspector state in the UIProcess including a debuggable and inspector controller.
* UIProcess/WebPageInspectorController.h: Added.
* UIProcess/WebPageInspectorController.cpp: Added.
(WebKit::WebPageInspectorController::WebPageInspectorController):
(WebKit::WebPageInspectorController::pageClosed):
(WebKit::WebPageInspectorController::hasLocalFrontend const):
(WebKit::WebPageInspectorController::hasRemoteFrontend const):
(WebKit::WebPageInspectorController::connectFrontend):
(WebKit::WebPageInspectorController::disconnectFrontend):
(WebKit::WebPageInspectorController::disconnectAllFrontends):
(WebKit::WebPageInspectorController::dispatchMessageFromFrontend):
(WebKit::WebPageInspectorController::setIndicating):
(WebKit::WebPageInspectorController::clearTargets):
(WebKit::WebPageInspectorController::createInspectorTarget):
(WebKit::WebPageInspectorController::destroyInspectorTarget):
(WebKit::WebPageInspectorController::sendMessageToInspectorFrontend):
InspectorController with a single TargetAgent in the UIProcess.
* UIProcess/WebPageInspectorTargetAgent.h:
* UIProcess/WebPageInspectorTargetAgent.cpp:
(WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
(WebKit::WebPageInspectorTargetAgent::frontendChannel):
Target agent implementation.
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::create):
(WebKit::InspectorTargetProxy::InspectorTargetProxy):
(WebKit::InspectorTargetProxy::connect):
(WebKit::InspectorTargetProxy::disconnect):
(WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
* UIProcess/InspectorTargetProxy.h:
UIProcess proxy for an InspectorTarget in the WebContentProcess.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::connectInspector):
(WebKit::WebPage::disconnectInspector):
(WebKit::WebPage::sendMessageToTargetBackend):
(WebKit::WebPage::setIndicating):
(WebKit::WebPage::setAllowsRemoteInspection): Deleted.
(WebKit::WebPage::setRemoteInspectionNameOverride): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/WebPageInspectorTarget.h:
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::WebPageInspectorTarget):
(WebKit::WebPageInspectorTarget::identifier const):
(WebKit::WebPageInspectorTarget::connect):
(WebKit::WebPageInspectorTarget::disconnect):
(WebKit::WebPageInspectorTarget::sendMessageToTargetBackend):
InspectorTarget for this WebPage.
* WebProcess/WebPage/WebPageInspectorTargetController.cpp: Added.
(WebKit::WebPageInspectorTargetController::WebPageInspectorTargetController):
(WebKit::WebPageInspectorTargetController::~WebPageInspectorTargetController):
(WebKit::WebPageInspectorTargetController::addTarget):
(WebKit::WebPageInspectorTargetController::removeTarget):
(WebKit::WebPageInspectorTargetController::connectInspector):
(WebKit::WebPageInspectorTargetController::disconnectInspector):
(WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend):
(WebKit::WebPageInspectorTargetController::sendMessageToTargetFrontend):
* WebProcess/WebPage/WebPageInspectorTargetController.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
(WebKit::WebPageInspectorTargetFrontendChannel::create):
(WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
(WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend):
Preparation for more target managment in the WebContentProcess.
2018-11-14 Alex Christensen <achristensen@webkit.org>
Add SPI to show a safe browsing warning
https://bugs.webkit.org/show_bug.cgi?id=191604
Reviewed by Andy Estes.
Safari has a case where it shows safe browsing warnings for a reason other than being told to by the SafeBrowsing framework.
Because safe browsing is moving to WebKit, we will have Safari call this WebKit SPI in that case.
The warning looks a little different, so I had to change the structure of a SafeBrowsingResult and the location of the string processing,
but the existing behavior is the same as verified by existing unit tests. I added a unit test to verify behavior of the new SPI.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
(+[WKWebView _confirmMalwareSentinel]):
(+[WKWebView _visitUnsafeWebsiteSentinel]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Removed.
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm.
(WebKit::malwareDetailsBase):
(WebKit::learnMoreURL):
(WebKit::reportAnErrorBase):
(WebKit::localizedProvider):
(WebKit::SafeBrowsingWarning::visitUnsafeWebsiteSentinel):
(WebKit::SafeBrowsingWarning::confirmMalwareSentinel):
(WebKit::replace):
(WebKit::addLinkAndReplace):
(WebKit::reportAnErrorURL):
(WebKit::malwareDetailsURL):
(WebKit::safeBrowsingTitleText):
(WebKit::safeBrowsingWarningText):
(WebKit::safeBrowsingDetailsText):
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
(WebKit::learnMore): Deleted.
(WebKit::SafeBrowsingResult::SafeBrowsingResult): Deleted.
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingWarning clickedOnLink:]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
(confirmMalwareSentinel): Deleted.
(visitUnsafeWebsiteSentinel): Deleted.
(replace): Deleted.
(addLinkAndReplace): Deleted.
(reportAnErrorURL): Deleted.
(malwareDetailsURL): Deleted.
(titleText): Deleted.
(warningText): Deleted.
(detailsText): Deleted.
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]): Deleted.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
* UIProcess/PageClient.h:
(WebKit::PageClient::showSafeBrowsingWarning):
* UIProcess/SafeBrowsingResult.h: Removed.
* UIProcess/SafeBrowsingWarning.h: Copied from Source/WebKit/UIProcess/SafeBrowsingResult.h.
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::title const):
(WebKit::SafeBrowsingWarning::warning const):
(WebKit::SafeBrowsingWarning::details const):
(WebKit::SafeBrowsingResult::create): Deleted.
(WebKit::SafeBrowsingResult::isPhishing const): Deleted.
(WebKit::SafeBrowsingResult::isMalware const): Deleted.
(WebKit::SafeBrowsingResult::isUnwantedSoftware const): Deleted.
(WebKit::SafeBrowsingResult::url const): Deleted.
(WebKit::SafeBrowsingResult::provider const): Deleted.
(WebKit::SafeBrowsingResult::localizedProviderName const): Deleted.
(WebKit::SafeBrowsingResult::malwareDetailsURLBase const): Deleted.
(WebKit::SafeBrowsingResult::reportAnErrorURLBase const): Deleted.
(WebKit::SafeBrowsingResult::learnMoreURL const): Deleted.
(WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const): Deleted.
(): Deleted.
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
(WebKit::WebFramePolicyListenerProxy::use):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::WebFrameProxy):
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
(WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::create):
(WebKit::WebFrameProxy::page const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showSafeBrowsingWarning):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showSafeBrowsingWarning):
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
* WebKit.xcodeproj/project.pbxproj:
2018-11-14 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] A few drag and drop tests are crashing after r238146
https://bugs.webkit.org/show_bug.cgi?id=191617
Reviewed by Dean Jackson.
The notion of temporarily suppressing the selection assistant was introduced during iOS drag and drop
development as a way of allowing both the selection view and dropped content snapshot to fade in simultaneously
during a drop in an editable element. r238146 piggy-backs on this mechanism by changing selection suppression
state when an element is focused, when the selection changes, and when an element is blurred, depending on
whether the currently focused element is transparent.
However, in the case where the selection assistant is suppressed due to a running drop animation, if focus moves
to an element that is not fully transparent, we end up prematurely unsuppressing the text selection assistant.
This subsequently causes selection UI to immediately show up after a drop instead of animating in alongside a
snapshot of the inserted document fragment, if the drop moved focus to an editable element.
A number of drag and drop tests on iOS exercised this codepath by dragging content into editable fields and/or
moving content between editable elements in a web view. These tests began to crash due to selection views and
the accompanying callout bar appearing earlier than usual, which triggers an unrelated UIKit assertion in
<https://webkit.org/b/190401>.
This patch fixes the failing tests by refactoring our selection assistant suppression code. Instead of
maintaining a single `BOOL` flag indicating whether the selection is suppressed, we use an `OptionSet` of
`SuppressSelectionAssistantReason`s, which (at the moment) only include (1) a running drop animation, and (2)
focusing a transparent element. The text selection assistant is considered suppressed when either of the reasons
apply. This allows us to correctly handle a drop animation that occurs simultaneously as an element is focused
without unsuppressing the selection assistant early, and also allows us to handle selection assistant
suppression in more nuanced ways, depending on the suppression reason.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _displayFormNodeInputView]):
Only prevent zooming to the focused element during drop if we're suppressing the selection assistant due to
focusing a transparent element. In the case of a drop, we still want to allow scrolling and zooming.
(-[WKContentView canShowNonEmptySelectionView]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _shouldSuppressSelectionCommands]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
Add helper methods for adding or removing selection assistant suppression reasons. When the last selection
assistant suppression reason is removed, we activate the selection assistant, and conversely, when the first
suppression reason is added, we deactivate the selection assistant.
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView suppressAssistantSelectionView]): Deleted.
(-[WKContentView setSuppressAssistantSelectionView:]): Deleted.
2018-11-14 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WebKit2] Hook up some more editing actions (-_pasteAndMatchStyle:, -makeTextWritingDirectionNatural:)
https://bugs.webkit.org/show_bug.cgi?id=191605
<rdar://problem/45813991>
Reviewed by Dean Jackson.
Hook up a couple of editing actions on iOS and macOS. The `-pasteAndMatchStyle:` selector is privately declared
in UIKit, but does not exist on macOS; as such, add `-_pasteAndMatchStyle:` as SPI on WKWebView, and
additionally implement the unprefixed version, `-pasteAndMatchStyle:`, on iOS.
Since `-makeTextWritingDirectionNatural:` is already declared on both iOS and macOS (SPI on UIResponder and API
on macOS, respectively) we simply implement the unprefixed variant on both platforms.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
2018-11-14 Per Arne Vollan <pvollan@apple.com>
REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
https://bugs.webkit.org/show_bug.cgi?id=190884
Reviewed by Dean Jackson.
Since the Web page currently owns the display link on the UI process side, the display link will be
deleted in the UI process when a Web page is closed. This is incorrect, since a display link can be
reused between Web pages in the WebContent process. This patch moves the ownership of the UI process
display links to the Web process object to address this issue. Also, the display ID of the display
being updated is included in the message to the WebContent process.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::displayLinkCallback):
* UIProcess/mac/DisplayLink.h:
(WebKit::DisplayLink::displayID const):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::startDisplayLink): Deleted.
(WebKit::WebPageProxy::stopDisplayLink): Deleted.
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/DrawingAreaMac.cpp:
(WebKit::DisplayRefreshMonitorMac::create):
(WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
(WebKit::DrawingArea::createDisplayRefreshMonitor):
(WebKit::DrawingArea::displayWasRefreshed): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::displayWasRefreshed):
2018-11-14 Chris Dumez <cdumez@apple.com>
Client should be able to disable PSON even if the experimental feature is on by default
https://bugs.webkit.org/show_bug.cgi?id=191634
Reviewed by Dean Jackson.
Instead of overriding the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag to true
when the experimental is enabled, use a separate flag to store this information. If the client
explicitly sets the APIProcessPoolConfiguration's m_processSwapsOnNavigation flag then we obey
the client's request, otherwise, we fall back to using the state from experimental features.
This allows:
- API tests to explicitely disable PSON / Process prewarming even if those are on by default
in experimental features.
- If the client does not set those flags on the APIProcessPoolConfiguration (Safari for e.g.),
then the experimental feature flag still fully controls the feature.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
2018-11-14 Chris Dumez <cdumez@apple.com>
WebKit.ApplicationManifestBasic API test is failing when enabling PSON
https://bugs.webkit.org/show_bug.cgi?id=191602
Reviewed by Alex Christensen.
Add support for process swapping for a [WKWebView loadHTML:] load by storing
the necessary data on the API::Navigation and doing a loadData() instead of
a loadRequest() after process swapping when this data is present on the
navigation.
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
(API::Navigation::substituteData const):
* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadDataNavigation):
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
2018-11-14 Antti Koivisto <antti@apple.com>
Align Mac WK2 layer flush throttling with iOS
https://bugs.webkit.org/show_bug.cgi?id=191632
Reviewed by Zalan Bujtas.
Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has
throttling timer per-frame while the actual decision making and layer flushes itself are per page. These
timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how
flushing state is updated when frames are created dynamically.
On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also
make this implementation visually fast. We should align the Mac implementation and eventually unify them.
This patch implements throttling in TiledCoreAnimationDrawingArea mirroring the iOS RemoteLayerTreeDrawingArea
implementation. There are some adjustments for platform differences (local vs remote layers) and we continue
using runloop observer for the actual flushes. Timings are as in the existing Mac code.
The patch appears to be a significant performance progression.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
Schedule an immediate flush when layers are unfrozen.
(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
Track pending flushes with m_hasPendingFlush bit.
Delay flush if the flush throttling timer is active. Start it if we throttling but it is not active yet.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
Clear m_hasPendingFlush if the flush succeeded.
Restart the throttling timer if we are still throttling.
Manage runloop observer invalidation here instead of the caller (and stop returning value).
(WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
(WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
Returning 'true' here disables WebCore side throttling code.
Start or stop the throttling timer on state changes.
(WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const):
This is used to control style and layout timers on WebCore side. Return false on frozen
state since unfreezing depends on style and layout.
(WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer):
(WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
2018-11-14 Chris Dumez <cdumez@apple.com>
WebKit.WKHTTPCookieStoreWithoutProcessPool API test is failing with process prewarming is enabled
https://bugs.webkit.org/show_bug.cgi?id=191624
Reviewed by Alex Christensen.
Stop setting the WebProcessPool's primary data store (m_websiteDataStore) to the default one in
WebProcessPool::prewarmProcess(). We did not really need to, we can pass the default data store
to the new WebPageProxy without having to set m_websiteDataStore. m_websiteDataStore only gets
set upon constructor if thr default data store already exists or later on when creating a WebPage
that uses the default data store.
In the case of the API test, the following was happening:
1. Create an ephemeral data store EDS
2. Create a WebView V1 using datastore EDS
3. Do a load in V1
4. Process prewarming would kick in and wrongly associated V1's process pool PP1 with the default data store
5. Create/Get the default datastore and set a few cookies on it
6. Create a WebView V2 using default datastore and a fresh new process pool PP2
7. Do a load in V2 and expect the cookies to be there
In HTTPCookieStore::setCookie() that is called at step 5, we call:
m_owningDataStore->processPoolForCookieStorageOperations()
In this case, m_owningDataStore is the default datastore and this call would previously return null because
there is no WebProcessPool yet associated with the default datastore. However, with the process prewarming
bug at step 4, the process pool PP1 would be returned since it was wrongly associated with the default
data store. As a result, we would call setCookie() on PP1's WebCookieManagerProxy and this would fail
because PP1's network process knows nothing about this session ID (it was only ever used with an ephemeral
session).
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::prewarmProcess):
2018-11-13 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support CTAP HID authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=188623
<rdar://problem/43353777>
Reviewed by Brent Fulgham and Chris Dumez.
This patch introduces a primitive support of CTAP HID authenticators for WebAuthN in macOS.
It involves low level HID device management&communication, high level CTAP HID authenticator
management&communication, and mock testing. The above three aspects will be covered in details:
1) Low level HID device management&communication: HidService&HidConnection
It relies on IOHIDManager to discover appropriate hid devices by passing a matching dictionary:
{ PrimaryUsagePage: 0xf1d0, PrimaryUsage: 0x01}. For communication, it utilizes HID reports.
To send a report, it calls IOHIDDeviceSetReport since the async version is not implemented.
To recieve a report, it calls IOHIDDeviceRegisterInputReportCallback to asynchronously wait
for incoming reports.
Here is the corresponding reference:
https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/HID/new_api_10_5/tn2187.html#//apple_ref/doc/uid/TP40000970-CH214-SW2
2) High level CTAP HID authenticator management&communication: HidService&CtapHidDriver
Whenever an appropriate hid device is discovered by IOHIDManager, an AuthenticatorGetInfo command
is sent to the device to determine properties of the authenticator, says, which version of protocol
it supports, i.e. CTAP or U2F. So far, we only support CTAP authenticators. Once the authenticator
is determined to support CTAP, we then instantiate CtapHidAuthenticator which will then take care
of even higher level WebAuthN requests&responses.
Binaries are constructed and packaged according to the CTAP HID porotocol. CtapHidDriver takes care
of concurrency and channels, i.e. allocating channel and establishing the actual request/response
transaction. At the meantime, CtapHidDriver::Worker is then responsible for each single transaction.
Here is the corresponding reference:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#usb.
3) Mock Testing: MockHidService & MockHidConnection
A CTAP hid authenticator is simulated within MockHidConnection with options of specifying specific
error scenarios and of course could take care of successful cases. Four stages are presented in the
simulated authenticator to reflect: a) allocating channel for AuthenticatorGetInfo, b) sending
AuthenticatorGetInfo, c) allocating channel for actual request, and d) sending the actual request.
Besides implementing the above, it also does a few other things:
1) Make AuthenticatorManager::clearState asynchronous to avoid cyclic dependency:
Authenticator::returnResponse => AuthenticatorManager::respondReceived => AuthenticatorManager::clearState
=> Authenticator::~Authenticator.
2) Reorganize unified build sources to make it clear that which files are .mm and which are .cpp.
3) Import LocalAuthentication.framework in LocalAuthenticationSoftLink instead of being scattered.
* Sources.txt:
* SourcesCocoa.txt:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):
(WebKit::AuthenticatorManager::clearStateAsync):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
(WebKit::AuthenticatorTransportService::create):
(WebKit::AuthenticatorTransportService::createMock):
(WebKit::AuthenticatorTransportService::startDiscovery):
(WebKit::AuthenticatorTransportService::startDiscovery const): Deleted.
* UIProcess/WebAuthentication/AuthenticatorTransportService.h:
* UIProcess/WebAuthentication/Cocoa/HidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/AuthenticatorTransportService.h.
* UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Added.
(WebKit::reportReceived):
(WebKit::HidConnection::HidConnection):
(WebKit::HidConnection::~HidConnection):
(WebKit::HidConnection::initialize):
(WebKit::HidConnection::terminate):
(WebKit::HidConnection::send):
(WebKit::HidConnection::registerDataReceivedCallback):
(WebKit::HidConnection::unregisterDataReceivedCallback):
(WebKit::HidConnection::receiveReport):
(WebKit::HidConnection::consumeReports):
(WebKit::HidConnection::registerDataReceivedCallbackInternal):
* UIProcess/WebAuthentication/Cocoa/HidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
* UIProcess/WebAuthentication/Cocoa/HidService.mm: Added.
(WebKit::deviceAddedCallback):
(WebKit::deviceRemovedCallback):
(WebKit::HidService::HidService):
(WebKit::HidService::~HidService):
(WebKit::HidService::startDiscoveryInternal):
(WebKit::HidService::platformStartDiscovery):
(WebKit::HidService::createHidConnection const):
(WebKit::HidService::deviceAdded):
(WebKit::HidService::continueAddDeviceAfterGetInfo):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
* UIProcess/WebAuthentication/Cocoa/LocalService.h:
* UIProcess/WebAuthentication/Cocoa/LocalService.mm:
(WebKit::LocalService::startDiscoveryInternal):
(WebKit::LocalService::startDiscoveryInternal const): Deleted.
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: Added.
(WebKit::MockHidConnection::MockHidConnection):
(WebKit::MockHidConnection::initialize):
(WebKit::MockHidConnection::terminate):
(WebKit::MockHidConnection::send):
(WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
(WebKit::MockHidConnection::assembleRequest):
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
(WebKit::MockHidConnection::stagesMatch const):
(WebKit::MockHidConnection::shouldContinueFeedReports):
(WebKit::MockHidConnection::continueFeedReports):
* UIProcess/WebAuthentication/Mock/MockHidConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
* UIProcess/WebAuthentication/Mock/MockHidService.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
(WebKit::MockHidService::MockHidService):
(WebKit::MockHidService::platformStartDiscovery):
(WebKit::MockHidService::createHidConnection const):
* UIProcess/WebAuthentication/Mock/MockHidService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h.
* UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
* UIProcess/WebAuthentication/Mock/MockLocalService.mm: Renamed from Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp.
(WebKit::MockLocalService::MockLocalService):
(WebKit::MockLocalService::platformStartDiscovery const):
(WebKit::MockLocalService::createLocalConnection const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: Added.
(WebKit::CtapHidAuthenticator::CtapHidAuthenticator):
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
(WebKit::CtapHidAuthenticator::getAssertion):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.h.
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: Added.
(WebKit::CtapHidDriver::Worker::Worker):
(WebKit::CtapHidDriver::Worker::~Worker):
(WebKit::CtapHidDriver::Worker::transact):
(WebKit::CtapHidDriver::Worker::write):
(WebKit::CtapHidDriver::Worker::read):
(WebKit::CtapHidDriver::Worker::returnMessage):
(WebKit::CtapHidDriver::CtapHidDriver):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::continueAfterResponseReceived):
(WebKit::CtapHidDriver::returnResponse):
* UIProcess/WebAuthentication/fido/CtapHidDriver.h: Added.
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebKit.xcodeproj/project.pbxproj:
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed correction to previous build fix to avoid any internal/downstream repercussions.
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed GTK/WPE build fix for r238159.
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
2018-11-13 Timothy Hatcher <timothy@apple.com>
Use a light scrollbar for transparent web views in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191559
rdar://problem/46000489
Reviewed by Dean Jackson.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage): Use FrameView's useDarkAppaearance().
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRect): Ditto.
2018-11-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Do not show selection UI for editable elements with opacity near zero
https://bugs.webkit.org/show_bug.cgi?id=191442
<rdar://problem/45958625>
Reviewed by Simon Fraser.
Add support for suppressing native selection UI (for instance, selection highlight views, selection handles, and
selection-related gestures) when the selection is inside a transparent editable element. This helps maintain
compatibility with text editors that work by capturing key events and input events hidden contenteditable
elements, and reflect these changes in different document or different part of the document.
Since selection UI is rendered in the UI process on iOS using element geometry propagated from the web process,
selection rendering is entirely decoupled from the process of painting in the web process. This means that if
the editable root has an opacity of 0, we would correctly hide the caret and selection on macOS, but draw over
the transparent element on iOS. When these hidden editable elements are focused, this often results in unwanted
behaviors, such as double caret painting, native and custom selection UI from the page being drawn on top of one
another, and the ability to change selection via tap and loupe gestures within hidden text.
To fix this, we compute whether the focused element is transparent when an element is focused, or when the
selection changes, and send this information over to the UI process via `AssistedNodeInformation` and
`EditorState`. In the UI process, we then respect this information by suppressing the selection assistant if the
focused element is transparent; this disables showing and laying out selection views, as well as gestures
associated with selection overlays. However, this still allows for contextual autocorrection and spell checking.
* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Add `elementIsTransparent` flags, and also add boilerplate IPC code.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
Prevent zooming to the focused element if the focused element is hidden.
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
Don't allow these text interaction gestures to begin while suppressing the selection assistant.
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
When an element is focused, begin suppressing the selection assistant if the element is fully transparent.
(-[WKContentView _stopAssistingNode]):
When the focused element is blurred, reset state by ending selection assistant suppression (additionally
reactivating the selection assistant if needed). This ensures that selection in non-editable text isn't broken
after focusing a hidden editable element.
(-[WKContentView _updateChangedSelection:]):
If needed, suppress or un-suppress the selection assistant when the selection changes. On certain rich text
editors, a combination of custom selection UI and native selection UI is used. For instance, on Microsoft Office
365, caret selections are rendered using the native caret view, but as soon as the selection becomes ranged, the
editable root becomes fully transparent, and Office's selection UI takes over.
(-[WKContentView _shouldSuppressSelectionCommands]):
Override this UIKit SPI hook to suppress selection commands (e.g. the callout bar) when suppressing the
selection assistant.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::getAssistedNodeInformation):
Compute and set `elementIsTransparent` using the assisted node.
2018-11-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238137.
Introduced API test failures on macOS.
Reverted changeset:
"Enable process swap on cross-site navigation by default on
macOS"
https://bugs.webkit.org/show_bug.cgi?id=191572
https://trac.webkit.org/changeset/238137
2018-11-13 Ryosuke Niwa <rniwa@webkit.org>
Enable process swap on cross-site navigation by default on macOS
https://bugs.webkit.org/show_bug.cgi?id=191572
Reviewed by Chris Dumez.
Enabled the feature by default on macOS.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2018-11-13 Daniel Bates <dabates@apple.com>
Consolidate WebKit UIKitSPI.h and UIKitTestSPI.h
https://bugs.webkit.org/show_bug.cgi?id=173341
<rdar://problem/32752890>
Reviewed by Simon Fraser.
* Platform/spi/ios/UIKitSPI.h:
2018-11-13 Alex Christensen <achristensen@webkit.org>
Fix internal builds after r238115
https://bugs.webkit.org/show_bug.cgi?id=191441
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingTextView intrinsicContentSize]):
Some iOS-like operating systems don't have safe browsing. Don't use symbols that don't exist on those systems.
2018-11-13 Ali Juma <ajuma@chromium.org>
Turn Intersection Observer on by default
https://bugs.webkit.org/show_bug.cgi?id=191569
Reviewed by Simon Fraser.
* Shared/WebPreferences.yaml:
2018-11-12 Darshan Kadu <darsh7807@gmail.com>
Implement Cache API support for WPE/GTK
https://bugs.webkit.org/show_bug.cgi?id=178316
Reviewed by Michael Catanzaro.
Added a new API function WKWebsiteDataStoreSetCacheStoragePerOriginQuota which sets the
cache limit per origin.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetCacheStoragePerOriginQuota):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
2018-11-12 Alex Christensen <achristensen@webkit.org>
[iOS] Implement safe browsing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=191441
Reviewed by Tim Horton.
In r237863 I implemented this for Mac. This refines the UI and implements it for iOS.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextHandlesSafeBrowsing):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
(-[WKWebView _clearSafeBrowsingWarning]):
(-[WKWebView layoutSubviews]):
(-[WKWebView setFrameSize:]):
(+[WKWebView _handlesSafeBrowsing]):
(-[WKWebView _safeBrowsingWarningForTesting]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
(WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(confirmMalwareSentinel):
(visitUnsafeWebsiteSentinel):
(colorForItem):
(addLinkAndReplace):
(-[WKSafeBrowsingExclamationPoint drawRect:]):
(makeButton):
(makeTitleLabel):
(setBackground):
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingWarning layoutText]):
(-[WKSafeBrowsingWarning textView:clickedOnLink:atIndex:]):
(-[WKSafeBrowsingWarning layout]):
(-[WKSafeBrowsingWarning layoutSubviews]):
(-[WKSafeBrowsingWarning textView:shouldInteractWithURL:inRange:interaction:]):
(-[WKSafeBrowsingWarning didMoveToWindow]):
(-[WKSafeBrowsingWarning clickedOnLink:]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
(-[WKSafeBrowsingTextView intrinsicContentSize]):
(colorNamed): Deleted.
(+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]): Deleted.
(+[WKSafeBrowsingTextView viewWithString:]): Deleted.
(-[WKSafeBrowsingTextView clickedOnLink:atIndex:]): Deleted.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::isViewFocused):
(WebKit::PageClientImpl::isViewVisible):
(WebKit::PageClientImpl::isViewInWindow):
(WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
(WebKit::PageClientImpl::enterAcceleratedCompositingMode):
(WebKit::PageClientImpl::showSafeBrowsingWarning):
(WebKit::PageClientImpl::clearSafeBrowsingWarning):
(WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureWillEnd):
(WebKit::PageClientImpl::navigationGestureDidEnd):
(WebKit::PageClientImpl::willRecordNavigationSnapshot):
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showShareSheet):
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureWillEnd):
(WebKit::PageClientImpl::navigationGestureDidEnd):
(WebKit::PageClientImpl::willRecordNavigationSnapshot):
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
2018-11-12 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
* Platform/spi/ios/PencilKitSPI.h: Added.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::createForEmbeddedView):
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::embeddedViewID const):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerWasCreated):
Propagate EmbeddedViewID through the PlatformCALayer constructor and
through the layer creation parameters to the UI process.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setEditableImagesEnabled:]):
(-[WKWebViewConfiguration _editableImagesEnabled]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
Add a preference to enable editable images.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::createLayer):
Keep track of "embedded views" in two maps: embeddedViewID->UIView,
and layerID->embeddedViewID. Clean them up when layers go away.
If a embedded view is reparented, currently it must be added to a new
layer in the same commit as it is removed from the previous layer
in order to persist the view's state (otherwise the view will be
destroyed and recreated). This will be less of a problem after future
patches introduce serialization of image data and whatnot.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
Move the various remote layer tree UIView subclasses out into a separate file.
Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
and creates a WKDrawingView and sticks it in the maps.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
(-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
(-[WKCompositingView hitTest:withEvent:]):
(-[WKCompositingView description]):
(+[WKTransformView layerClass]):
(+[WKSimpleBackdropView layerClass]):
(+[WKShapeView layerClass]):
(-[WKRemoteView initWithFrame:contextID:]):
(+[WKRemoteView layerClass]):
(-[WKBackdropView hitTest:withEvent:]):
(-[WKBackdropView description]):
(-[WKChildScrollView initWithFrame:]):
Move various remote layer tree UIView subclasses here, to their own file.
Make our UIView hit testing override test for views that conform to the
protocol "WKNativelyInteractible", which switches to normal UIView hit
testing. WKDrawingView will be the one such view.
Add WKChildScrollView and pull the one thing we customize out into it,
to make RemoteLayerTreeHost::createLayer less logic-ful.
* UIProcess/ios/WKDrawingView.h: Added.
* UIProcess/ios/WKDrawingView.mm: Added.
(-[WKDrawingView init]):
(-[WKDrawingView layoutSubviews]):
Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
* WebKit.xcodeproj/project.pbxproj:
* SourcesCocoa.txt:
Add the new files.
2018-11-12 Don Olmstead <don.olmstead@sony.com>
Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
https://bugs.webkit.org/show_bug.cgi?id=189230
<rdar://problem/44050379>
Reviewed by Joseph Pecoraro.
Runs all png images through zopflipng. This results in a smaller file
size and takes care of this issue as a byproduct.
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png:
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png:
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png:
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png:
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png:
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png:
2018-11-12 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Screen capture should be an experimental feature on OSX only
https://bugs.webkit.org/show_bug.cgi?id=191552
<rdar://problem/45994142>
Reviewed by Youenn Fablet.
* Shared/WebPreferences.yaml: Make ScreenCaptureEnabled.condition ENABLE(MEDIA_STREAM) && PLATFORM(MAC).
2018-11-12 Takashi Komori <Takashi.Komori@sony.com>
Resurrect WebKitTestRunner for Windows port
https://bugs.webkit.org/show_bug.cgi?id=189257
Reviewed by Fujii Hironori.
* PlatformWin.cmake:
2018-11-12 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations experimental
https://bugs.webkit.org/show_bug.cgi?id=191543
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2018-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
Implement a new edit command to change the enclosing list type
https://bugs.webkit.org/show_bug.cgi?id=191487
<rdar://problem/45955922>
Reviewed by Ryosuke Niwa.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
Add undo/redo edit action strings for ConvertToOrderedList and ConvertToUnorderedList.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::increaseListLevel):
(WebKit::WebPage::decreaseListLevel):
(WebKit::WebPage::changeListType):
Remove preflight checks for these list editing commands. These are not necessary because these commands fall
back to being noops if these checks return false. This avoids an extraneous ancestor walk to determine the
enclosing list element when changing list type.
2018-11-11 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Notify the WebContent process with the current modifer state on window activation changes. Notify
the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
(-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
(hardwareKeyboardAvailabilityChangedCallback): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
keyboard flags changed event.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
so that we toggle visibility of the caps lock indicator.
2018-11-11 Dan Bernstein <mitz@apple.com>
ProcessPoolConfiguration::copy() doesn’t copy m_customWebContentServiceBundleIdentifier
https://bugs.webkit.org/show_bug.cgi?id=191514
Reviewed by Geoffrey Garen.
Test: WebKitCocoa/WKProcessPoolConfiguration.mm
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy): Copy m_customWebContentServiceBundleIdentifier.
2018-11-11 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
* Platform/mac/StringUtilities.mm:
* UIProcess/ApplicationStateTracker.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2018-11-10 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
* Platform/mac/StringUtilities.mm:
* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::applicationDidEnterBackground):
(WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
(WebKit::ApplicationStateTracker::applicationWillEnterForeground):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2018-11-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238065.
Breaks internal builds.
Reverted changeset:
"Make it possible to edit images inline"
https://bugs.webkit.org/show_bug.cgi?id=191352
https://trac.webkit.org/changeset/238065
2018-11-10 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
* Platform/spi/ios/PencilKitSPI.h: Added.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::createForEmbeddedView):
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::embeddedViewID const):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerWasCreated):
Propagate EmbeddedViewID through the PlatformCALayer constructor and
through the layer creation parameters to the UI process.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setEditableImagesEnabled:]):
(-[WKWebViewConfiguration _editableImagesEnabled]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
Add a preference to enable editable images.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::createLayer):
Keep track of "embedded views" in two maps: embeddedViewID->UIView,
and layerID->embeddedViewID. Clean them up when layers go away.
If a embedded view is reparented, currently it must be added to a new
layer in the same commit as it is removed from the previous layer
in order to persist the view's state (otherwise the view will be
destroyed and recreated). This will be less of a problem after future
patches introduce serialization of image data and whatnot.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
Move the various remote layer tree UIView subclasses out into a separate file.
Add createEmbeddedView, which is used for LayerTypeEditableImageLayer,
and creates a WKDrawingView and sticks it in the maps.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: Added.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: Added.
(-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]):
(-[UIView _web_findDescendantViewAtPoint:withEvent:]):
(-[WKCompositingView hitTest:withEvent:]):
(-[WKCompositingView description]):
(+[WKTransformView layerClass]):
(+[WKSimpleBackdropView layerClass]):
(+[WKShapeView layerClass]):
(-[WKRemoteView initWithFrame:contextID:]):
(+[WKRemoteView layerClass]):
(-[WKBackdropView hitTest:withEvent:]):
(-[WKBackdropView description]):
(-[WKChildScrollView initWithFrame:]):
Move various remote layer tree UIView subclasses here, to their own file.
Make our UIView hit testing override test for views that conform to the
protocol "WKNativelyInteractible", which switches to normal UIView hit
testing. WKDrawingView will be the one such view.
Add WKChildScrollView and pull the one thing we customize out into it,
to make RemoteLayerTreeHost::createLayer less logic-ful.
* UIProcess/ios/WKDrawingView.h: Added.
* UIProcess/ios/WKDrawingView.mm: Added.
(-[WKDrawingView init]):
(-[WKDrawingView layoutSubviews]):
Add a very simple WKDrawingView, which uses PKCanvasView to edit the image.
* WebKit.xcodeproj/project.pbxproj:
* SourcesCocoa.txt:
Add the new files.
2018-11-09 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerFlushThrottlingIsActive const):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
(WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
(WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
2018-11-09 John Wilander <wilander@apple.com>
Add ability to configure document.cookie lifetime cap through user defaults
https://bugs.webkit.org/show_bug.cgi?id=191480
<rdar://problem/45240871>
Reviewed by Chris Dumez.
This change makes the capped lifetime in seconds configurable through
user defaults.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
Renamed setAgeCapForClientSideCookies().
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
Renamed setAgeCapForClientSideCookies().
(WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
Renamed didSetAgeCapForClientSideCookies().
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
(WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
New function that handles all the things that need to be done when a network
process has been created.
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
Now just calls the corresponding function on its memory store where all the
configuration parameters are available.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
Renamed setAgeCapForClientSideCookies().
* UIProcess/WebsiteData/WebsiteDataStore.h:
2018-11-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238047.
Introduced layout test failures on iOS simulator.
Reverted changeset:
"[iOS] Draw caps lock indicator in password fields"
https://bugs.webkit.org/show_bug.cgi?id=190565
https://trac.webkit.org/changeset/238047
2018-11-09 Chris Dumez <cdumez@apple.com>
Suspended page persists even after back/forward list item is gone
https://bugs.webkit.org/show_bug.cgi?id=191488
<rdar://problem/45953006>
Reviewed by Geoffrey Garen.
Currently, the WebProcessPool owns the SuspendedPageProxy objects and makes sure we cap how
many we can have. The WebBackForwardListItem merely has a WeakPtr to its associated
SuspendedPageProxy. However, there is no point in having the WebProcessPool keeping a
SuspendedPageProxy object alive if there is no longer any WebBackForwardListItem pointing
to it.
To address the issue, WebBackForwardListItem nows tells the WebProcessPool to destroy
its SuspendedPageProxy when necessary. WebBackForwardList also takes care of nulling
out the WebBackForwardListItem's SuspendedPageProxy after the item has been removed
from the list (in case somebody keeps the item alive).
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::~WebBackForwardListItem):
(WebKit::WebBackForwardListItem::setSuspendedPage):
(WebKit::WebBackForwardListItem::suspendedPageIsNoLongerNeeded):
* Shared/WebBackForwardListItem.h:
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::didRemoveItem):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeSuspendedPageProxy):
* UIProcess/WebProcessPool.h:
2018-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Implement SPI on WKWebView to increase and decrease list levels
https://bugs.webkit.org/show_bug.cgi?id=191471
<rdar://problem/45952472>
Reviewed by Tim Horton.
Implement these method stubs by calling into Editor.
Test: WKWebViewEditActions.ModifyListLevel
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::increaseListLevel):
(WebKit::WebPage::decreaseListLevel):
(WebKit::WebPage::changeListType):
2018-11-09 Keith Rollin <krollin@apple.com>
Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
Remove the use of .xcfilelists until their side-effects are better
understood.
* WebKit.xcodeproj/project.pbxproj:
2018-11-09 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl][WebKit] Implement Proxy configuration API.
https://bugs.webkit.org/show_bug.cgi?id=189053
Reviewed by Youenn Fablet.
Added proxy configuration API to WebsiteDataStore. Three API were added in WKWebsiteDataStoreRefCurl.h:
- WKWebsiteDataStoreEnableDefaultNetworkProxySettings(WKWebsiteDataStoreRef)
- WKWebsiteDataStoreEnableCustomNetworkProxySettings(WKWebsiteDataStoreRef, WKURLRef, WKStringRef ignoreHosts)
- WKWebsiteDataStoreDisableNetworkProxySettings(WKWebsiteDataStoreRef)
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::setNetworkProxySettings):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* PlatformWin.cmake:
* Shared/WebCoreArgumentCoders.h:
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<CurlProxySettings>::encode):
(IPC::ArgumentCoder<CurlProxySettings>::decode):
* UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
(WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
(WKWebsiteDataStoreEnableCustomNetworkProxySettings):
(WKWebsiteDataStoreDisableNetworkProxySettings):
* UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h:
Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::networkProxySettings const):
* UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
Copied from Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp.
(WebKit::WebsiteDataStore::platformSetParameters):
(WebKit::WebsiteDataStore::setNetworkProxySettings):
2018-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Introduce WKWebView SPI to insert nested ordered and unordered lists
https://bugs.webkit.org/show_bug.cgi?id=191410
<rdar://problem/45898610>
Reviewed by Dean Jackson.
Prefixes a few iOS-only SPI methods declared on WKWebView in r236867 with underscores, and also exposes some
more cross-platform Cocoa editing SPI. Once the unprefixed SPI methods are no longer used by internal clients,
these will need to be removed (see followup bug: webkit.org/b/191450). See below for more details.
Covered by new and existing API tests in WKWebViewEditActions.
* UIProcess/API/Cocoa/WKWebView.mm:
Hoist the definition (and undefinition) of `FORWARD_ACTION_TO_WKCONTENTVIEW` to encompass both the WKWebView
implementation and the WKWebView (WKPrivate) implementation. This allows us to use this macro when implementing
SPI methods in the WKPrivate category, as well as methods that are part of the main WKWebView implementation.
(-[WKWebView canPerformAction:withSender:]):
(-[WKWebView targetForAction:withSender:]):
Add forwarding for the new editing commands in -canPerformAction: and -targetForAction:.
(-[WKWebView _toggleStrikeThrough:]):
(-[WKWebView _increaseListLevel:]):
(-[WKWebView _decreaseListLevel:]):
(-[WKWebView _changeListType:]):
(-[WKWebView _setFont:sender:]):
(-[WKWebView _setFontSize:sender:]):
(-[WKWebView _setTextColor:sender:]):
Add definitions for the new editing methods on WKWebView, using macros (`WEBCORE_PRIVATE_COMMAND` on macOS and
`FORWARD_ACTION_TO_WKCONTENTVIEW` on iOS) to help reduce the code duplication.
(-[WKWebView _pasteAsQuotation:]): Deleted.
Remove this method definition, which is now replaced by macros on iOS and macOS.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Introduce the new SPI to WKWebView (WKPrivate), and add FIXMEs to remove old, unprefixed variants of the SPI.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::increaseListLevel):
(WebKit::WebPageProxy::decreaseListLevel):
(WebKit::WebPageProxy::changeListType):
Add plumbing for these list editing commands.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _increaseListLevelForWebView:]):
(-[WKContentView _decreaseListLevelForWebView:]):
(-[WKContentView _changeListTypeForWebView:]):
(-[WKContentView _toggleStrikeThroughForWebView:]):
(-[WKContentView _setFontForWebView:sender:]):
(-[WKContentView _setFontSizeForWebView:sender:]):
(-[WKContentView _setTextColorForWebView:sender:]):
(-[WKContentView toggleStrikeThroughForWebView:]):
(-[WKContentView setFontForWebView:sender:]):
(-[WKContentView setFontSizeForWebView:sender:]):
(-[WKContentView setTextColorForWebView:sender:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
Check for the new action selectors here, and additionally add validation for `_pasteAsQuotation:`. Let the
unprefixed versions of these methods simply call the prefixed versions (these method implementations will be
removed in a followup once doing so would not affect any clients of WebKit).
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::increaseListLevel):
(WebKit::WebPage::decreaseListLevel):
(WebKit::WebPage::changeListType):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Add stubs for several list editing commands that are yet to be hooked up to WebCore. These will be implemented
in a future patch.
2018-11-09 Antti Koivisto <antti@apple.com>
Use OptionSet for layout milestones
https://bugs.webkit.org/show_bug.cgi?id=191470
Reviewed by Dean Jackson.
* Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
(renderingProgressEvents):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toWKLayoutMilestones):
(WebKit::toLayoutMilestones):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const):
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didReachLayoutMilestone):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::renderingProgressDidChange):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
(pageRenderingProgressEvents):
* UIProcess/API/Cocoa/WKWebView.mm:
(layoutMilestones):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::listenForLayoutMilestones):
(WebKit::WebPageProxy::didLayoutForCustomContentProvider):
(WebKit::WebPageProxy::didReachLayoutMilestone):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
(API::InjectedBundle::PageLoaderClient::layoutMilestones const):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
(WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::listenForLayoutMilestones):
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones):
(WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone):
2018-11-09 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Notify the WebContent process with the current modifer state on window activation changes. Notify
the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
(-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
(hardwareKeyboardAvailabilityChangedCallback): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
keyboard flags changed event.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
so that we toggle visibility of the caps lock indicator.
2018-11-09 Tim Horton <timothy_horton@apple.com>
Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
https://bugs.webkit.org/show_bug.cgi?id=191449
<rdar://problem/45884977>
Reviewed by Eric Carlson.
UIRemoteView has some nice process assertion management that it would
be nice to not duplicate. So, we can just use it instead of CALayerHost!
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::page const):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(-[WKUIRemoteView hitTest:withEvent:]):
(-[WKUIRemoteView description]):
(createRemoteView):
(WebKit::RemoteLayerTreeHost::createLayer):
2018-11-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Make screen capture an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=191472
<rdar://problem/45946499>
Reviewed by Jer Noble.
* Shared/WebPreferences.yaml: Make ScreenCaptureEnabled an experimental feature.
2018-11-09 Daniel Bates <dabates@apple.com>
[iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
action when forward delete is pressed outside a text field
https://bugs.webkit.org/show_bug.cgi?id=190566
<rdar://problem/45262367>
Reviewed by Wenson Hsieh.
Override -_deleteForwardAndNotify to perform a forward deletion and remove the dead code that
expected UIKit to send us a character string with 0xF728 for the forward delete key. UIKit
ceased doing this many years ago. We may revist this decision once <rdar://problem/45772078>
is fixed.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
(-[WKContentView _deleteForwardAndNotify:]):
2018-11-08 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, try to fix the 32-bit macOS build
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showDefinitionForAttributedString):
2018-11-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Add an SPI to allow WebView clients to add additional supported image formats
https://bugs.webkit.org/show_bug.cgi?id=190454
Reviewed by Simon Fraser.
* Platform/mac/StringUtilities.h:
* Platform/mac/StringUtilities.mm:
(WebKit::webCoreStringVectorFromNSStringArray):
A helper function which converts an NSArray of NSStrings to a Vector of
WTFString.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Handle encoding and decoding the AdditionalSupportedImageTypes which will
allow transferring it from the UI process to the web process.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::additionalSupportedImageTypes const):
(API::PageConfiguration::setAdditionalSupportedImageTypes):
Store the AdditionalSupportedImageTypes in the APIPageConfiguration
which is used when creating the WebPageProxy in the UIPorcess.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _additionalSupportedImageTypes]):
(-[WKWebViewConfiguration _setAdditionalSupportedImageTypes:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
Setter/Getter for the AdditionalSupportedImageTypes.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
Copy the AdditionalSupportedImageTypes from APIPageConfiguration to
WebPageCreationParameters.
* UIProcess/WebPageProxy.h:
Delete unimplemented function.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
Copy the AdditionalSupportedImageTypes from WebPageCreationParameters to
WebCore.
2018-11-08 Megan Gardner <megan_gardner@apple.com>
Adopt Reveal Framework to replace Lookup
https://bugs.webkit.org/show_bug.cgi?id=191097
<rdar://problem/45924508>
Reviewed by Tim Horton.
Pass in what it needed to clear the textIndicators. This is better than
the current notification structure.
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKWindowVisibilityObserver dealloc]):
(-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForText]):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showDefinitionForAttributedString):
Generate and pass in the text indicator information, as this is needed now.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
2018-11-08 Keith Rollin <krollin@apple.com>
Create .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191324
<rdar://problem/45852819>
Reviewed by Alex Christensen.
As part of preparing for enabling XCBuild, create and use .xcfilelist
files. These files are using during Run Script build phases in an
Xcode project. If a Run Script build phase produces new files that are
used later as inputs to subsequent build phases, XCBuild needs to know
about these files. These files can be either specified in an "output
files" section of the Run Script phase editor, or in .xcfilelist files
that are associated with the Run Script build phase.
This patch takes the second approach. It consists of three sets of changes:
- Modify the DerivedSources.make files to have a
'print_all_generated_files" target that produces a list of the files
they create.
- Create a shell script that produces .xcfilelist files from the
output of the previous step, as well as for the files created in the
Generate Unified Sources build steps.
- Add the new .xcfilelist files to the associated projects.
Note that, with these changes, the Xcode workspace and projects can no
longer be fully loaded into Xcode 9. Xcode will attempt to load the
projects that have .xcfilelist files associated with them, but will
fail and display a placeholder for those projects instead. It's
expected that all developers are using Xcode 10 by now and that not
being able to load into Xcode 9 is not a practical issue. Keep in mind
that this is strictly an IDE issue, and that the projects can still be
built with `xcodebuild`.
Also note that the shell script that creates the .xcfilelist files can
also be used to verify that the set of files that's currently checked
in is up-to-date. This checking can be used as part of a check-in hook
or part of check-webkit-style to sooner catch cases where the
.xcfilelist files need to be regenerated.
* DerivedSources.make:
* DerivedSources.xcfilelist: Added.
* UnifiedSources.xcfilelist: Added.
* WebKit.xcodeproj/project.pbxproj:
2018-11-08 Timothy Hatcher <timothy@apple.com>
Add experimental support for a `supported-color-schemes` CSS property.
https://bugs.webkit.org/show_bug.cgi?id=191319
rdar://problem/45852261
Reviewed by Dean Jackson.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRect):
2018-11-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Use DeviceIdHashSaltStorage to generate device ID hash salt
https://bugs.webkit.org/show_bug.cgi?id=190825
<rdar://problem/45486085>
Reviewed by Youenn Fablet.
* UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
(WKUserMediaPermissionCheckSetUserMediaAccessInfo):
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
(webkitDeviceInfoPermissionRequestAllow):
(webkitDeviceInfoPermissionRequestDeny):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdHashSaltForOrigin):
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigin):
* UIProcess/DeviceIdHashSaltStorage.h:
* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionCheckProxy.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::updateDeviceIDHashSalt):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): Deleted.
2018-11-08 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash when running with sandbox enabled
https://bugs.webkit.org/show_bug.cgi?id=191353
Reviewed by Michael Catanzaro.
g_key_file_set_string_list() expects a null-terminated array as parameter.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::createFlatpakInfo): Append nullptr to sharedPermissions array.
2018-11-07 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]):
2018-11-07 John Wilander <wilander@apple.com>
Resource Load Statistics: Enable cap on partitioned cache max age
https://bugs.webkit.org/show_bug.cgi?id=191395
<rdar://problem/45885977>
Reviewed by Chris Dumez.
This change does not bump the network cache revision number.
It's not needed since it was done just a week ago.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap):
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
2018-11-07 Daniel Bates <dabates@apple.com>
[iOS] Support deleting to the start of the line and to the end of the line
https://bugs.webkit.org/show_bug.cgi?id=191389
<rdar://problem/45883972>
Reviewed by Wenson Hsieh.
Add support for the key commands Command + Delete and Control + K to delete to the start
of the line and to delete to the end of the line, respectively.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteToStartOfLine]): Added.
(-[WKContentView _deleteToEndOfLine]): Added.
2018-11-07 Daniel Bates <dabates@apple.com>
[iOS] Option + Delete should delete previous word
https://bugs.webkit.org/show_bug.cgi?id=191381
<rdar://problem/23681351>
Reviewed by Wenson Hsieh.
Implement support for pressing Option + Delete to delete the previous word. This makes text editing
in WebKit more closely match the platform conventions.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteByWord]):
2018-11-07 Daniel Bates <dabates@apple.com>
Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=190141
Reviewed by Darin Adler.
Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
deterministic regardless of whether a hardware keyboard is attached.
* Shared/NativeWebKeyboardEvent.h:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
(WebKit::isInHardwareKeyboardMode): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
2018-11-07 Zamiul Haque <zhaque@apple.com>
Force a gregorian calendar to show for credit card expiration date inputs
(autocomplete='cc-exp'*) regardless of default system settings.
https://bugs.webkit.org/show_bug.cgi?id=191096
rdar://problem/42640256
Reviewed by Tim Horton.
Added some plumbing code to expose the calendar identifier of the calendar used by a
presented date picker. Added shouldPresentGregorianCalendar:, to be used for
determining what property values a date input control must present a Gregorian
calendar for.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView formInputPeripheral]):
* UIProcess/ios/forms/WKFormInputControl.mm:
2018-11-07 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK/WPE build when memfd is not available after r237922.
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::createSharedMemory):
2018-11-07 Carlos Garcia Campos <cgarcia@igalia.com>
[Linux] Use memfd_create when available in SharedMemory implementation
https://bugs.webkit.org/show_bug.cgi?id=189741
Reviewed by Michael Catanzaro.
If memfd is available, use it instead of shm_open.
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
shm if it's not available.
(WebKit::SharedMemory::create): Use createSharedMemory() helper.
2018-11-06 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191291
Reviewed by Myles Maxfield.
Properly disable WEBGPU on all non-Metal platforms for now.
* Configurations/FeatureDefines.xcconfig:
2018-11-06 Youenn Fablet <youenn@apple.com>
Make mDNS ICE Candidate an experimental flag again
https://bugs.webkit.org/show_bug.cgi?id=191262
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
(WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-11-06 Suresh Koppisetty <skoppisetty@apple.com>
Don’t use the main queue to create an XPC connection.
https://bugs.webkit.org/show_bug.cgi?id=191160
<rdar://problem/45736262>
Reviewed by Geoffrey Garen.
Don't use the main queue to create an XPC connection. xpc_connection_set_bootstrap does
dispatch_mach_send_barrier_f on this queue which delays the sending of the subsequent
bootstrap message (sent to launchd for launching a new target process) when the main queue is busy.
Now that the XPC connection runs on the default concurrent queue, errorHandler could be invoked
by any thread. The job of errorHandler is to dispatch errorHandlerImpl to the main thread,
where errorHandlerImpl is responsible for the actual handling of errors if any.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
2018-11-06 Brian Burg <bburg@apple.com>
Add missing iOS availability macro to _WKAutomationSessionConfiguration
https://bugs.webkit.org/show_bug.cgi?id=191320
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
2018-11-06 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
https://bugs.webkit.org/show_bug.cgi?id=189760
<rdar://problem/44612242>
Reviewed by Youenn Fablet and Antti Koivisto.
When a redirect cache entry for a prevalent resource reaches its max
age cap, it is loaded again from the network and the network response
is compared with what's in the cache. If it's a match, the cache entry
is fully accepted. If not, a new capped cache entry is created.
This feature is still off by default.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canUseCachedRedirect const):
Now checks the new member m_cacheEntryForMaxAgeCapValidation.
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
New case handled for entry->hasReachedPrevalentResourceAgeCap().
(WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
This is where the new logic compares the incoming redirect with the
cached one. If they match, an uncapped entry is allowed to be stored.
If they don't match, a new capped entry will be stored.
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
Now calls the new
NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation()
function.
* NetworkProcess/NetworkResourceLoader.h:
Added the m_cacheEntryForMaxAgeCapValidation member.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
Restored to previous behavior which means
UseDecision::NoDueToPrevalentResourceAgeCap was removed.
(WebKit::NetworkCache::Cache::retrieve):
Restored to previous behavior.
(WebKit::NetworkCache::Cache::storeRedirect):
Now takes the optional maxAgeCap and caps the entry's max age if it's set.
(WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::encodeAsStorageRecord const):
Now encodes m_maxAgeCap.
(WebKit::NetworkCache::Entry::decodeStorageRecord):
Now decodes m_maxAgeCap.
(WebKit::NetworkCache::Entry::hasReachedPrevalentResourceAgeCap const):
Added.
(WebKit::NetworkCache::Entry::capMaxAge):
Added.
* NetworkProcess/cache/NetworkCacheEntry.h:
Added the optional m_maxAgeCap.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
Now gets the optional max age cap from the NetworkStorageSession and sends it
to Cache::storeRedirect().
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
Removed handling of UseDecision::NoDueToPrevalentResourceAgeCap.
2018-11-06 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r230523): Caps lock indicator not shown in password field
https://bugs.webkit.org/show_bug.cgi?id=190056
Reviewed by Ryosuke Niwa.
Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and
when the window becomes active.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::updateCurrentModifierState):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::updateCurrentModifierState):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-11-06 Alex Christensen <achristensen@webkit.org>
Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
https://bugs.webkit.org/show_bug.cgi?id=191329
Reviewed by Tim Horton.
Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
in two repositories.
* UIProcess/API/Cocoa/WKWebView.mm:
(+[WKWebView handlesSafeBrowsing]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2018-11-06 Eric Carlson <eric.carlson@apple.com>
[MediaStream] User should not be prompted again after denying getDisplayMedia request
https://bugs.webkit.org/show_bug.cgi?id=191227
<rdar://problem/45784512>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
2018-11-06 Fujii Hironori <Hironori.Fujii@sony.com>
[MediaStream] User should not be prompted again after denying getDisplayMedia request
https://bugs.webkit.org/show_bug.cgi?id=191227
<rdar://problem/45784512>
Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
* UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
2018-11-03 Alex Christensen <achristensen@webkit.org>
[Mac] Implement safe browsing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=188871
Reviewed by Tim Horton.
* Platform/spi/Cocoa/SafeBrowsingSPI.h:
* Resources/SafeBrowsing.xcassets: Added.
* Resources/SafeBrowsing.xcassets/Contents.json: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset/Contents.json: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset/Contents.json: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset: Added.
* Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset/Contents.json: Added.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextHandlesSafeBrowsing):
* UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
(WebKit::malwareDetailsBase):
(WebKit::learnMore):
(WebKit::reportAnErrorBase):
(WebKit::localizedProvider):
(WebKit::SafeBrowsingResult::SafeBrowsingResult):
* UIProcess/Cocoa/WKSafeBrowsingWarning.h: Added.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Added.
(confirmMalwareSentinel):
(visitUnsafeWebsiteSentinel):
(colorNamed):
(replace):
(addLinkAndReplace):
(-[WKSafeBrowsingExclamationPoint drawRect:]):
(-[WKSafeBrowsingExclamationPoint intrinsicContentSize]):
(reportAnErrorURL):
(malwareDetailsURL):
(titleText):
(warningText):
(detailsText):
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
(-[WKSafeBrowsingWarning dealloc]):
(-[WKSafeBrowsingWarning goBackClicked]):
(-[WKSafeBrowsingWarning clickedOnLink:]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]):
(+[WKSafeBrowsingTextView viewWithString:]):
(-[WKSafeBrowsingTextView intrinsicContentSize]):
(-[WKSafeBrowsingTextView clickedOnLink:atIndex:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
(WebKit::WebViewImpl::clearSafeBrowsingWarning):
(WebKit::WebViewImpl::setFrameSize):
* UIProcess/PageClient.h:
(WebKit::PageClient::showSafeBrowsingWarning):
(WebKit::PageClient::clearSafeBrowsingWarning):
* UIProcess/SafeBrowsingResult.h:
(WebKit::SafeBrowsingResult::url const):
(WebKit::SafeBrowsingResult::provider const):
(WebKit::SafeBrowsingResult::localizedProviderName const):
(WebKit::SafeBrowsingResult::malwareDetailsURLBase const):
(WebKit::SafeBrowsingResult::reportAnErrorURLBase const):
(WebKit::SafeBrowsingResult::learnMoreURL const):
(WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const):
(WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showSafeBrowsingWarning):
(WebKit::PageClientImpl::clearSafeBrowsingWarning):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setImpl):
(WebKit::PageClientImpl::showSafeBrowsingWarning):
(WebKit::PageClientImpl::clearSafeBrowsingWarning):
* WebKit.xcodeproj/project.pbxproj:
2018-11-05 Zan Dobersek <zdobersek@igalia.com>
[WPE] Remove BackingStore, BackingStoreCairo implementation files from build
https://bugs.webkit.org/show_bug.cgi?id=191269
Reviewed by Michael Catanzaro.
* SourcesWPE.txt: Drop the BackingStore.cpp and BackingStoreCairo.cpp
files from the WPE build. These are not used at all in WPE configuration
as they are only used by the GTK+ port for non-AC functionality.
2018-11-05 Chris Dumez <cdumez@apple.com>
Use same limit for page cache and suspended pages
https://bugs.webkit.org/show_bug.cgi?id=191266
Reviewed by Geoffrey Garen.
Use same limit for page cache and suspended pages as they serve the same purpose.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _maximumSuspendedPageCount]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateMaxSuspendedPageCount):
(WebKit::WebProcessPool::setCacheModel):
(WebKit::WebProcessPool::addSuspendedPageProxy):
* UIProcess/WebProcessPool.h:
2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Allow WKWebView clients to customize bar button item groups in the accessory view when editing
https://bugs.webkit.org/show_bug.cgi?id=191240
<rdar://problem/44872806>
Reviewed by Tim Horton.
Allow WKWebView clients to override WKContentView's default input assistant item by plumbing the call to
`-inputAssistantItem` through `-[WKWebView inputAssistantItem]`, such that if a client asks WKWebView for its
input assistant item and changes its leading or trailing bar button groups, the changes will be reflected by
WKContentView; additionally, this allows clients to achieve the same effect by overriding `-inputAssistantItem`
on WKWebView.
Test: KeyboardInputTests.ModifyInputAssistantItemBarButtonGroups
KeyboardInputTests.OverrideInputAssistantItemBarButtonGroups
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView inputAssistantItem]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputAssistantItem]):
Route the call to `[super inputAssistantItem]` through `-[WKWebView inputAssistantItem]`, so that the input
assistant item may be overridden via WKWebView.
(-[WKContentView inputAssistantItemForWebView]):
2018-11-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237785.
Introduced layout test and API test failures on macOS and iOS.
Reverted changeset:
"[iOS] Issue initial paint soon after the visuallyNonEmpty
milestone is fired."
https://bugs.webkit.org/show_bug.cgi?id=191078
https://trac.webkit.org/changeset/237785
2018-11-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237784 and r237788.
https://bugs.webkit.org/show_bug.cgi?id=191270
Caused mediastream layout test failures (Requested by
ryanhaddad on #webkit).
Reverted changesets:
"[MediaStream] User should not be prompted again after denying
getDisplayMedia request"
https://bugs.webkit.org/show_bug.cgi?id=191227
https://trac.webkit.org/changeset/237784
"[MediaStream] User should not be prompted again after denying
getDisplayMedia request"
https://bugs.webkit.org/show_bug.cgi?id=191227
https://trac.webkit.org/changeset/237788
2018-11-04 Fujii Hironori <Hironori.Fujii@sony.com>
[MediaStream] User should not be prompted again after denying getDisplayMedia request
https://bugs.webkit.org/show_bug.cgi?id=191227
<rdar://problem/45784512>
Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
* UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
2018-11-04 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerFlushThrottlingIsActive const):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
(WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
(WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
2018-11-04 Eric Carlson <eric.carlson@apple.com>
[MediaStream] User should not be prompted again after denying getDisplayMedia request
https://bugs.webkit.org/show_bug.cgi?id=191227
<rdar://problem/45784512>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
2018-11-03 Alex Christensen <achristensen@webkit.org>
Mac production builds should sign the network process xpc service with entitlements
https://bugs.webkit.org/show_bug.cgi?id=191209
<rdar://problem/45377609>
Reviewed by Geoff Garen.
* Configurations/Network-OSX.entitlements: Copied from Configurations/Network-OSX-sandbox.entitlements.
* Configurations/NetworkService.xcconfig:
Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
except with the corresponoding network process entitlements file.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:
Add infrastructure to test that the network process actually has an entitlement.
2018-11-03 Philippe Normand <pnormand@igalia.com>
[WPE] Add the WebKitVersion.h header
https://bugs.webkit.org/show_bug.cgi?id=191015
<rdar://problem/45647211>
Reviewed by Michael Catanzaro.
* PlatformWPE.cmake: Install the generated header as well.
2018-11-02 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r237761.
Makes most API tests timeout and WK2 tests crash
Reverted changeset:
"Mac production builds should sign the network process xpc
service with entitlements"
https://bugs.webkit.org/show_bug.cgi?id=191209
https://trac.webkit.org/changeset/237761
2018-11-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the build with recent SDKs.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceExit):
2018-11-02 Alex Christensen <achristensen@webkit.org>
Mac production builds should sign the network process xpc service with entitlements
https://bugs.webkit.org/show_bug.cgi?id=191209
<rdar://problem/45377609>
Reviewed by Geoff Garen.
* Configurations/NetworkService.xcconfig:
Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
except with the corresponoding network process entitlements file.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
* UIProcess/WebProcessPool.h:
Add infrastructure to test that the network process actually has an entitlement.
2018-11-02 Daniel Bates <dabates@apple.com>
[iOS] WebKit should dispatch DOM events when a modifier key is pressed
https://bugs.webkit.org/show_bug.cgi?id=190487
Reviewed by Tim Horton.
Add support for modifier flags change events dispatched by UIKit.
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent): Update for renamed enumerations.
(WebIOSEventFactory::createWebKeyboardEvent): Modifier keys do not have an associated
character and do not participate in key repeat.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Update for renamed enumerations.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]): Return NO if the event represents a
modifier flags change to allow the default handling.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): Update for renamed enumerations.
2018-11-02 Chris Dumez <cdumez@apple.com>
[PSON] Reuse SuspendedPages' process when possible, for performance
https://bugs.webkit.org/show_bug.cgi?id=191166
Reviewed by Geoffrey Garen.
When process-swapping check if there is an existing SuspendedPage for the domain we're going to.
If there is, use this SuspendedPage's process for the navigation instead of a fresh new process.
This change should be beneficial for performance as it:
- Avoids spinning up a new process (CPU & memory cost)
- Likely better leverages caches since this process already loaded this domain in the past
Due to current limitations, using a SuspendedPage's proxy may consume the SuspendedPage, which
means that it can no longer be used for PageCache on history navigations. We need to do this when
the SuspendedPageProxy in question was created for the current WebPageProxy because:
- This SuspendedPageProxy's process already has a suspended WebPage with this WebPageProxy's pageID
and
- We do not currently support having more than one WebPage with a given pageID within a single
WebProcess.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
https://bugs.webkit.org/show_bug.cgi?id=189693
Reviewed by Yusuke Suzuki.
* Shared/API/APIString.h: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
2018-11-01 Daniel Bates <dabates@apple.com>
Cleanup: Extraneous platform guarding of -_setUpSQLiteDatabaseTrackerClient
https://bugs.webkit.org/show_bug.cgi?id=191124
Reviewed by Tim Horton.
Remove the platform guard around the call to -_setUpSQLiteDatabaseTrackerClient as the
implementation of that message is already guarded.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
2018-11-01 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the build with recent SDKs.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
2018-11-01 Sihui Liu <sihui_liu@apple.com>
Add a storage limit for IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=190598
<rdar://problem/44654715>
Reviewed by Chris Dumez.
Add SPI for testing.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::setIDBPerOriginQuota):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetIDBPerOriginQuota):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setIDBPerOriginQuota):
* UIProcess/WebProcessPool.h:
2018-11-01 Chris Dumez <cdumez@apple.com>
[PSON] WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping
https://bugs.webkit.org/show_bug.cgi?id=191076
Reviewed by Geoffrey Garen.
WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping.
The client can request a new load synchronously after answering the policy decision, in which case we'd end up loading
the wrong URL.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
2018-11-01 Chris Dumez <cdumez@apple.com>
[PSON] Unable to submit a file in FormData cross-site
https://bugs.webkit.org/show_bug.cgi?id=191138
Reviewed by Alex Christensen.
When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
files.
Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
FormData, and have its decoder consume those extensions so that the recipient has access to those
files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
(which encodes both FormData and sandbox extensions) instead of a FormData.
* Platform/IPC/FormDataReference.h:
(IPC::FormDataReference::encode const):
(IPC::FormDataReference::decode):
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
2018-11-01 Claudio Saavedra <csaavedra@igalia.com>
ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
https://bugs.webkit.org/show_bug.cgi?id=191152
Reviewed by Chris Dumez.
The statistics file is not created unconditionally, so
make sure it exists before logging an error.
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::clear):
Check that the file exists before logging an error.
2018-11-01 Claudio Saavedra <csaavedra@igalia.com>
[GLIB] Silent a build warning when not using Wayland
Unreviewed.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2018-11-01 Frederic Wang <fwang@igalia.com>
[WebAuthN] Make AuthenticatorManager
https://bugs.webkit.org/show_bug.cgi?id=189279
Unreviewed build fix.
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Add missing headers.
2018-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
https://bugs.webkit.org/show_bug.cgi?id=191114
<rdar://problem/45700410>
Reviewed by Dean Jackson.
Followup to r237648: also make sure that we insecurely unarchive NSFileWrapper on platforms that don't support
secure archiving of file wrappers.
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::updateFromSerializedRepresentation):
2018-10-31 Dean Jackson <dino@apple.com>
Forward original fragment identifier into System Preview
https://bugs.webkit.org/show_bug.cgi?id=191141
<rdar://problem/45717542>
Reviewed by Wenson Hsieh.
If the URL used by the page includes a fragment identifier, use
it when telling QuickLook to open a local file.
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didFinish): Append original fragment identifier
to the destination URL.
2018-10-31 Zalan Bujtas <zalan@apple.com>
[iOS] Do not paint tap highlight unless it is above a certain threshold
https://bugs.webkit.org/show_bug.cgi?id=191134
<rdar://problem/43615142>
Flashing a large portion of the screen on every tap looks unpleasant.
This patch impoves the existing heuristic by adding area check and a % threshold.
Reviewed by Tim Horton.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):
(highlightedQuadsAreSmallerThanRect): Deleted.
2018-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
https://bugs.webkit.org/show_bug.cgi?id=191114
<rdar://problem/45700410>
Reviewed by Dean Jackson.
On macOS 10.12, we don't attempt secure archival at all because SECURE_ARCHIVER_API is turned off, and on macOS
10.14, NSFileWrapper supports secure coding. However, on macOS 10.13, SECURE_ARCHIVER_API is on despite
NSFileWrapper not being securely codable, so we're unable to serialize attachment data.
To fix this, we only use the secure archiver on ≥ macOS 10.14 and ≥ iOS 12.
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::createSerializedRepresentation const):
2018-10-31 Zach Li <zacharyli323@gmail.com>
Add credit card autofill button
https://bugs.webkit.org/show_bug.cgi?id=191051
<rdar://problem/45657011>
Reviewed by Wenson Hsieh.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(toAutoFillButtonType):
(toWKAutoFillButtonType):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
Introduce a new button type for credit card autofill.
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(toAutoFillButtonType):
(toWKAutoFillButtonType):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2018-10-31 Chris Dumez <cdumez@apple.com>
[PSON] When process-swapping for a POST request the HTTP body gets dropped
https://bugs.webkit.org/show_bug.cgi?id=191046
<rdar://problem/45229732>
Reviewed by Alex Christensen.
For performance reasons, the ResourceRequest IPC encoder does not encode the request's HTTP body (aka form data).
When we decide to process-swap for a POST request in WebPageProxy::decidePolicyForNavigationAction(), the request
we pass the new WebProcess thus no longer has a HTTP body and the load will likely fail in the new process.
To address the issue, we now pass the request body along with the request when sending the DecidePolicyForNavigationActionAsync
/ DecidePolicyForNavigationActionSync IPC from the WebProcess to the UIProcess. No action is needed for the
LoadRequest IPC to the new WebProcess since the LoadParameters' IPC encoder takes care of encoding the request's
body already.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2018-10-31 Antti Koivisto <antti@apple.com>
Stop using LayerFlushScheduler in WK2
https://bugs.webkit.org/show_bug.cgi?id=191065
Reviewed by Tim Horton.
Code gets more understandable when TiledCoreAnimationDrawingArea simply uses RunLoopObserver
directly for flush scheduling. LayerFlushScheduler can be later moved to WK1.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
(WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
(WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
(WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
(WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):
2018-10-31 Claudio Saavedra <csaavedra@igalia.com>
[WPE][GTK] Certificates loaded from the cache don't include the certificate chain
https://bugs.webkit.org/show_bug.cgi?id=190956
Reviewed by Youenn Fablet.
Similarly to what was done for the IPC coders, serialize
the entire certificate chain in the cache coder. Bump
the cache version due to the caching format changes.
* NetworkProcess/cache/NetworkCacheCoders.h: Add GRefPtr<GByteArray> coders.
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
(WTF::Persistence::certificatesDataListFromCertificateInfo):
(WTF::Persistence::certificateFromCertificatesDataList): Helpers.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode):
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode):
* NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version.
2018-10-30 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Attachment dropped from one web view to another is missing its file wrapper
https://bugs.webkit.org/show_bug.cgi?id=190530
<rdar://problem/45232149>
Reviewed by Tim Horton.
See WebCore ChangeLog for more details.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<SerializedAttachmentData>::encode):
(IPC::ArgumentCoder<SerializedAttachmentData>::decode):
* Shared/WebCoreArgumentCoders.h:
Add IPC encoding/decoding support for SerializedAttachmentData.
* UIProcess/API/APIAttachment.cpp:
(API::Attachment::createSerializedRepresentation const):
(API::Attachment::updateFromSerializedRepresentation):
* UIProcess/API/APIAttachment.h:
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::createSerializedRepresentation const):
Add a method to serialize and return attachment info as a blob of data.
(API::Attachment::updateFromSerializedRepresentation):
Add a method to update the attachment, given a serialized blob of data. On Cocoa platforms, this fails
gracefully if the serialized data cannot be decoded.
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
(WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
(WebKit::PageClientImplCocoa::allocFileWrapperInstance): Deleted.
Add an additional hook to return the list of NSFileWrapper subclasses suitable for deserialization. This
array contains (at minimum) NSFileWrapper, but may additionally include a custom NSFileWrapper subclass, if
configured.
* UIProcess/PageClient.h:
(WebKit::PageClient::allocFileWrapperInstance const):
(WebKit::PageClient::serializableFileWrapperClasses const):
(WebKit::PageClient::allocFileWrapperInstance): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
Registers the given serialized attachment data, creating new _WKAttachment instances if necessary. Currently,
this does not update the file wrappers of existing _WKAttachments; we should revisit this in the future to see
if we can additionally update file wrappers for existing attachments, without breaking the case where the user
copies and pastes or drags and drops attachments within a single web view and the client expects _WKAttachment
instances to be reused.
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerAttachments):
(WebKit::WebEditorClient::serializedAttachmentDataForIdentifiers):
Implement a new IPC hook to fetch an array of serialized attachment data blobs, given a list of attachment
identifiers.
* WebProcess/WebCoreSupport/WebEditorClient.h:
2018-10-30 Chris Dumez <cdumez@apple.com>
[PSON] View gesture snapshot gets taken down early when process-swapping
https://bugs.webkit.org/show_bug.cgi?id=191083
<rdar://problem/45058738>
Reviewed by Alex Christensen.
When process-swapping, we would call WebViewImpl::processDidExit(), which would destroy
the ViewGestureController and thus take down the swipe navigation snapshot before it
should. We now call WebViewImpl::processDidSwap() instead, which does the same thing,
except for destroying the ViewGestureController. As a result, the view snapshot stays
visible as long as it is needed, even in case of process swap.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::handleProcessSwapOrExit):
(WebKit::WebViewImpl::processWillSwap):
(WebKit::WebViewImpl::processDidExit):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::processWillSwap):
2018-10-30 Chris Dumez <cdumez@apple.com>
[PSON] WebView renders with incorrect dimensions after back or forward
https://bugs.webkit.org/show_bug.cgi?id=191071
<rdar://problem/45058950>
Reviewed by Alex Christensen.
Make sure WebPage::reinitializeWebPage() updates the page's dimensions if needed using the
WebPageCreationParameters it is provided.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
2018-10-30 Dewei Zhu <dewei_zhu@apple.com>
Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
https://bugs.webkit.org/show_bug.cgi?id=191049
Reviewed by Dean Jackson.
Move the feature flag to experimental feature section.
* Shared/WebPreferences.yaml:
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Enable InstallAPI for iOS unconditionally
https://bugs.webkit.org/show_bug.cgi?id=191043
rdar://problem/32728423
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig: Enabled it. Added NSURLDownloadSPI.h as an
excluded header - WebKit doesn't export NSURLDownload, so the definition
shouldn't be processed by InstallAPI.
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete MAX_ALLOWED macros
https://bugs.webkit.org/show_bug.cgi?id=190916
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
* Platform/spi/Cocoa/DeviceIdentitySPI.h:
* Platform/spi/ios/UIKitSPI.h:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentRequest):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
2018-10-30 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237600 and r237604.
https://bugs.webkit.org/show_bug.cgi?id=191086
Breaks internal iOS builds (Requested by ryanhadd_ on
#webkit).
Reverted changesets:
"Enable InstallAPI for iOS unconditionally"
https://bugs.webkit.org/show_bug.cgi?id=191043
https://trac.webkit.org/changeset/237600
"Build fix attempt after enabling InstallAPI for iOS."
https://bugs.webkit.org/show_bug.cgi?id=191043
https://trac.webkit.org/changeset/237604
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Build fix attempt after enabling InstallAPI for iOS.
https://bugs.webkit.org/show_bug.cgi?id=191043
rdar://problem/32728423
* Configurations/WebKit.xcconfig: Skip NSURLDownloadSPI.h here too.
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Enable InstallAPI for iOS unconditionally
https://bugs.webkit.org/show_bug.cgi?id=191043
rdar://problem/32728423
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig: Enabled it.
2018-10-30 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] CoordinatedLayerTreeHost::flushLayersAndForceRepaint() should schedule the flush
https://bugs.webkit.org/show_bug.cgi?id=191066
Reviewed by Michael Catanzaro.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
Only schedule the layer flush in this call, don't perform it on the
spot. This avoids re-entry of the layer flushing process in cases when
the associated display refresh monitor is requested a callback during
the layout phase that's executed under the initial layer flush.
2018-10-29 Dewei Zhu <dewei_zhu@apple.com>
Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
https://bugs.webkit.org/show_bug.cgi?id=191049
Reviewed by Chris Dumez.
Move 'ProcessSwapOnCrossSiteNavigationEnabled' from 'internal' to 'experimental' category.
* Shared/WebPreferences.yaml:
2018-10-29 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Add support for AsyncResolver to resolve MDNS.
This basically reuse the code path used to resolve STUN server addresses.
Removed MDNS specific resolution.
Use existing CFHost resolution mechanism to do the actual resolution.
Make sure that a resolver is kept alive while iterating through its clients when signaling done.
Some of its clients may indeed call Destroy() on the resolver during that iteration.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
* NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCResolver::Destroy):
(WebKit::LibWebRTCResolver::doDestroy):
(WebKit::LibWebRTCResolver::setResolvedAddress):
(WebKit::LibWebRTCResolver::setError):
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
* WebProcess/Network/webrtc/WebMDNSRegister.cpp:
* WebProcess/Network/webrtc/WebMDNSRegister.h:
* WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
2018-10-29 Tim Horton <timothy_horton@apple.com>
Modernize WebKit nibs and lprojs for localization's sake
https://bugs.webkit.org/show_bug.cgi?id=190911
<rdar://problem/45349466>
Reviewed by Dan Bernstein.
* Resources/WebContentProcess.xib:
* WebKit.xcodeproj/project.pbxproj:
* en.lproj/InfoPlist.strings: Renamed from Source/WebKit/English.lproj/InfoPlist.strings.
English->en
2018-10-29 Tim Horton <timothy_horton@apple.com>
Make FindOptionsShowOverlay work on iOS
https://bugs.webkit.org/show_bug.cgi?id=190551
Reviewed by Andy Estes.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
Update the find indicator after installing the page overlay for the find holes.
This ensures that if the find indicator mechanism also uses page overlays,
as it does on iOS, that they are installed in the correct order (because
order of installation directly affects z-order).
(WebKit::FindController::findIndicatorRadius const):
(WebKit::FindController::shouldHideFindIndicatorOnScroll const):
Add two getters for design differences between find-in-page on iOS vs. other platforms.
(WebKit::FindController::rectsForTextMatchesInRect):
Return FloatRects instead of IntRects for ease of use in the caller.
Don't clip rects for matches that intersect the current tile. We still
drop ones that don't intersect at all, but if they do intersect, we
provide the full rect (which may overlap a different tile), so that
e.g. border drawing will work correctly.
(WebKit::FindController::drawRect):
Adopt shrink-wrapping for find holes. This has minimal impact on macOS,
where the holes don't have rounded corners, but on iOS this makes
overlapping or adjacent holes look great. We already do this for the indicator,
so it only makes sense to do the same for the holes.
In order to support shrink-wrapping here, switch to using a Clear operator
with a path-fill instead of clearRect to clear out the holes.
Avoid hiding the find indicator on scroll if the platform says not to.
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::findIndicatorRadius const):
(WebKit::FindController::shouldHideFindIndicatorOnScroll const):
Slightly adjust the find indicator's parameters to be compatible with having holes.
Reduce the horizontal margin by half a point so that it fits precisely in the hole.
Drop the "TightlyFitContent" text indicator parameter, because we want
rects that match the holes, and they do not tightly fit the content's height.
This matches macOS's behavior.
2018-10-29 Jer Noble <jer.noble@apple.com>
CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
https://bugs.webkit.org/show_bug.cgi?id=190954
Reviewed by Simon Fraser.
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::makeCGImage):
2018-10-29 Youenn Fablet <youenn@apple.com>
Guard H264 simulcast with a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=191025
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2018-10-29 Chris Dumez <cdumez@apple.com>
[PSON] When Safari restores session state after launching, going back and forward does not swap processes
https://bugs.webkit.org/show_bug.cgi?id=190975
<rdar://problem/45059256>
Reviewed by Antti Koivisto.
When deciding to process-swap or not on a history navigation, we normally check the BackForwardListItems'
process identifiers do check if they come from different WebProcesses or not. However, the check was invalid
in the case where the BackForwardListItems were restored by the client. After a session restore, the
items' process identifier is the UIProcess one. Therefore, we need to disable the BackForwardListItems'
process identifiers check if if the process identifier is the one of the UIProcess.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-10-29 Youenn Fablet <youenn@apple.com>
[WebRTC] Enable VP8 by default
https://bugs.webkit.org/show_bug.cgi?id=190672
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2018-10-28 Zan Dobersek <zdobersek@igalia.com>
[WPE] Add the WebKitVersion.h header
https://bugs.webkit.org/show_bug.cgi?id=191015
Reviewed by Michael Catanzaro.
Add the WebKitVersion.h API header for the WPE port. As with other
headers providing the GLib API, we have to provide a WPE-specific
version, but the implementation file can be shared with the GTK port,
and is moved under the UIProcess/API/glib/ directory accordingly.
* PlatformWPE.cmake:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
* UIProcess/API/wpe/WebKitVersion.h.in: Added.
* UIProcess/API/wpe/webkit.h:
2018-10-26 Megan Gardner <megan_gardner@apple.com>
Remove Unused WebSelectionAssistant
https://bugs.webkit.org/show_bug.cgi?id=190939
Reviewed by Tim Horton.
We made webSelectionAssistant alwasys nil last year when we moved to using
the textSelectionAssistant for all text selection on the web. This patch merely
goes through and cleans out all the references to this object that is always nil.
No functionality should change.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didExitStableState]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _scrollingNodeScrollingWillBegin]):
(-[WKContentView _scrollingNodeScrollingDidEnd]):
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _uiTextSelectionRects]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView _addShortcutForWebView:]):
(-[WKContentView _showDictionary:]):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView selectionInteractionAssistant]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
(-[WKContentView _restoreCalloutBarIfNeeded]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView webSelectionAssistant]): Deleted.
2018-10-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237458.
https://bugs.webkit.org/show_bug.cgi?id=190973
broke internal iOS builds (Requested by zalan on #webkit).
Reverted changeset:
"Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
https://bugs.webkit.org/show_bug.cgi?id=190951
https://trac.webkit.org/changeset/237458
2018-10-26 Chris Dumez <cdumez@apple.com>
[PSON] Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake
https://bugs.webkit.org/show_bug.cgi?id=190971
Reviewed by Geoffrey Garen.
Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake.
Since r236257, the WebProcess would always delay attaching the drawing area when a new WebPage is created. The
WebProcess would send a DidCompletePageTransition IPC to the UIProcess when the page transition is complete and
the UIProcess would then send an IPC back to attach the drawing area.
In the new design, WebPageCreationParameters contains a flag indicating if the WebPage should delay attaching
the drawing area or not. We only delay attaching in case of process swap and we've successfuly suspended the
previous page. Then when WebPage::didCompletePageTransition(), we stop sending the DidCompletePageTransition
IPC to the UIProcess and instead have the WebProcess attach the drawing area right away if we've delayed
attaching until then.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/DrawingAreaProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2018-10-26 Chris Dumez <cdumez@apple.com>
[PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
https://bugs.webkit.org/show_bug.cgi?id=190879
Reviewed by Antti Koivisto.
Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset
the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension
and this has caused various crashes because code usually assumes we always have a drawing area.
This patch also drops various drawing area null checks that were added to address PSON crashes.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): Deleted.
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didCompletePageTransition):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsAndRootView):
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
(WebKit::WebChromeClient::contentsSizeChanged const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::exitAcceleratedCompositingMode):
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::tearDownDrawingAreaForSuspend): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-26 Antti Koivisto <antti@apple.com>
Use random() instead of begin() to limit cache sizes
https://bugs.webkit.org/show_bug.cgi?id=190957
Reviewed by Chris Dumez.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didCollectPrewarmInformation):
2018-10-26 Chris Dumez <cdumez@apple.com>
Modernize / Simplify IPC::Connection::sendOutgoingMessage()
https://bugs.webkit.org/show_bug.cgi?id=190931
Reviewed by Alex Christensen.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage):
2018-10-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Add an asyncronous reply request to VideoFullscreenManager.
Drive-by fix: messages.py generates "WTFMove(*arg1, *arg2)" instead of "WTFMove(*arg1), WTFMove(*arg2)"
in its reply handler generation.
* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply):
* Scripts/webkit/messages.py:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
* WebProcess/cocoa/VideoFullscreenManager.h:
* WebProcess/cocoa/VideoFullscreenManager.messages.in:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, another try at fixing the GTK build with sandbox enabled
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::memfd_create): Deleted.
2018-10-25 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations CSS Integration off by default
https://bugs.webkit.org/show_bug.cgi?id=190901
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, try to fix GTK build with sandbox enabled
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2018-10-25 Claudio Saavedra <csaavedra@igalia.com>
[WPE][GTK] Follow-up fixes to the certificate coders
https://bugs.webkit.org/show_bug.cgi?id=190900
Reviewed by Michael Catanzaro.
Cleanup the GRefPtr mess I created earlier. Also we now bail out
if any certificate in the chain has no data instead of returning a
cropped chain.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<CertificateInfo>::encode):
(IPC::ArgumentCoder<CertificateInfo>::decode):
2018-10-25 Zan Dobersek <zdobersek@igalia.com>
[GTK][AC] Resizing the window doesn't always update the visible rect
https://bugs.webkit.org/show_bug.cgi?id=189743
Reviewed by Michael Catanzaro.
Disassociate resizing that can be done on an AcceleratedSurface object
between "host resizes" and "client resizes".
The former is done from ThreadedCoordinatedLayerTreeHost directly, and
is currently used only for GTK on X11, where a new pixmap object is
created on each resize, which affects the context ID that is based on
that pixmap object's address.
The latter is done from the composition thread. It's used for GTK on
Wayland and WPE. In both cases, the underlying window object does not
change on each resize, but it's necessary to perform the actual resize
on the composition thread.
So far it hasn't been performed there, which ended up pushing sizes of
the WebKit view and the underlying window object out of sync during
resizing, leaving parts of window unrendered.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::hostResize):
(WebKit::AcceleratedSurface::resize): Deleted.
* WebProcess/WebPage/AcceleratedSurface.h:
(WebKit::AcceleratedSurface::clientResize):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
(WebKit::AcceleratedSurfaceWayland::clientResize):
(WebKit::AcceleratedSurfaceWayland::resize): Deleted.
* WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
(WebKit::AcceleratedSurfaceX11::hostResize):
(WebKit::AcceleratedSurfaceX11::resize): Deleted.
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::clientResize):
(WebKit::AcceleratedSurfaceWPE::resize): Deleted.
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
2018-10-24 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete macOS version guards
https://bugs.webkit.org/show_bug.cgi?id=190887
Reviewed by Dan Bernstein.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
2018-10-24 Megan Gardner <megan_gardner@apple.com>
Turn on Conic Gradients
https://bugs.webkit.org/show_bug.cgi?id=190810
Reviewed by Tim Horton.
Remove conic gradients from experimental features and turn it on always.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
2018-10-24 Said Abou-Hallawa <sabouhallawa@apple.com>
Cleanup: MIMETypeRegistry functions
https://bugs.webkit.org/show_bug.cgi?id=190838
Reviewed by Simon Fraser.
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):
2018-10-24 Chris Dumez <cdumez@apple.com>
REGRESSION (r237257): [iOS] Crashes in com.apple.WebKit: WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit
https://bugs.webkit.org/show_bug.cgi?id=190804
Reviewed by Alex Christensen.
Fix null-dereference of the drawing area in RemoteScrollingCoordinator::scheduleTreeStateCommit.
With process-swap-on-navigation enabled, suspended pages' drawing area gets torn down.
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
2018-10-24 Claudio Saavedra <csaavedra@igalia.com>
[WPE][GTK] Cleanups to the certificate decoder
https://bugs.webkit.org/show_bug.cgi?id=190867
Reviewed by Žan Doberšek.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<CertificateInfo>::decode):
2018-10-24 Claudio Saavedra <csaavedra@igalia.com>
[WPE][GTK] Cleanups to the certificate encoder
https://bugs.webkit.org/show_bug.cgi?id=190865
Reviewed by Žan Doberšek.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<CertificateInfo>::encode):
2018-10-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237261.
The layout test for this change crashes under GuardMalloc.
Reverted changeset:
"Handle MDNS resolution of candidates through libwebrtc
directly"
https://bugs.webkit.org/show_bug.cgi?id=190681
https://trac.webkit.org/changeset/237261
2018-10-23 David Kilzer <ddkilzer@apple.com>
Fix false positive leaks when using custom -init methods that don't start with -init
<https://webkit.org/b/190818>
<rdar://problem/45476042>
Reviewed by Dan Bernstein.
* UIProcess/Cocoa/WKWebViewContentProvider.h:
(-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]):
Add attribute to make this behave like an -init method.
2018-10-23 Chris Dumez <cdumez@apple.com>
[PSON] Add support for cross-site client-side redirects
https://bugs.webkit.org/show_bug.cgi?id=190806
<rdar://problem/45047344>
Reviewed by Geoffrey Garen.
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::setSuspendedPage):
* UIProcess/API/APINavigation.h:
(API::Navigation::setLockHistory):
(API::Navigation::lockHistory const):
(API::Navigation::setLockBackForwardList):
(API::Navigation::lockBackForwardList const):
(API::Navigation::setClientRedirectSourceForHistory):
(API::Navigation::clientRedirectSourceForHistory const):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::willPerformClientRedirect):
(API::NavigationClient::didPerformClientRedirect):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
* UIProcess/FrameLoadState.h:
(WebKit::FrameLoadState::setURL):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::didPerformClientRedirect):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::setCurrentHistoryItemForReattach):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-23 Claudio Saavedra <csaavedra@igalia.com>
[WPE][GTK] Pass full certificate chain in CertificateInfo coder
https://bugs.webkit.org/show_bug.cgi?id=190789
Reviewed by Michael Catanzaro.
When the network process serializes certificate data to other
processes through the argument coders, the certificate chain, if
present, is lost. In practice this means that applications using
the public API to process certificate info have no details on the
certificate chain, other than the very basics included in the
certificate. Serialize the entire chain if available in the
certificate.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<CertificateInfo>::encode): Encode the
certificate chain if present.
(IPC::ArgumentCoder<CertificateInfo>::decode): Decode the
entire certificate chain and rebuild it.
2018-10-22 Keith Rollin <krollin@apple.com>
Use Location = "Relative to Build Products" rather than "Relative to Group"
https://bugs.webkit.org/show_bug.cgi?id=190781
Reviewed by Alexey Proskuryakov.
Almost all Derived Files are included in Xcode projects with the
Location attribute set to "Relative to Group". While this currently
works, the Derived Files can no longer be found when enabling XCBuild
(which has stricter requirements). Fix this by setting the Location
attribute to "Relative to Build Products".
* WebKit.xcodeproj/project.pbxproj:
2018-10-22 Tim Horton <timothy_horton@apple.com>
Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=190801
<rdar://problem/43674361>
Reviewed by Megan Gardner.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView didMoveToWindow]):
Defer the first call to WKContentViewInteraction's -setupInteraction
until the view is parented. This avoids a few milliseconds of unnecessary
work for views that are never parented.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
Keep track of the current state of WKContentViewInteraction's gestures.
Use this to make it OK to call -setupInteraction multiple times.
2018-10-22 Chris Dumez <cdumez@apple.com>
Deque's contains() and findIf() should be const
https://bugs.webkit.org/show_bug.cgi?id=190796
Reviewed by Antti Koivisto.
Mark method as const now that Deque's implementation allows it to be.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::hasSuspendedPageProxyFor const):
(WebKit::WebProcessPool::hasSuspendedPageProxyFor): Deleted.
* UIProcess/WebProcessPool.h:
2018-10-19 Brent Fulgham <bfulgham@apple.com>
Allow WebContent process to check some file system features
https://bugs.webkit.org/show_bug.cgi?id=190768
<rdar://problem/45377609>
Reviewed by Alexey Proskuryakov.
This patch unblocks some IOKit properties that are needed by lower level frameworks to make decisions
about how to efficiently use the file system.
* WebProcess/com.apple.WebProcess.sb.in:
2018-10-19 Stephan Szabo <stephan.szabo@sony.com>
[WinCairo] Search terms are not saved for <input type="search">
https://bugs.webkit.org/show_bug.cgi?id=188174
Reviewed by Fujii Hironori.
Add support for saving the search terms for <input
type="search"> to a SQLite database, replacing the
CF-based implementation for Windows and adding support
for non-legacy WebKit.
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::saveRecentSearches): Use SQLite database
implementation in WebCore::SearchPopupMenuDB to save search
terms
(WebKit::WebPageProxy::loadRecentSearches): Use SQLite database
implementation in WebCore::SearchPopupMenuDB to load search
terms
2018-10-19 Alex Christensen <achristensen@webkit.org>
WebDataListSuggestionsDropdown should use a WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=190763
<rdar://problem/45417449>
Reviewed by Tim Horton.
Nothing suspicious here. It's just good practice to not keep raw pointers that aren't reset when the object they point to are destroyed.
* UIProcess/WebDataListSuggestionsDropdown.cpp:
(WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
(WebKit::WebDataListSuggestionsDropdown::close):
* UIProcess/WebDataListSuggestionsDropdown.h:
(WebKit::WebDataListSuggestionsDropdown::Client::~Client): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(WebKit::WebDataListSuggestionsDropdownIOS::create):
(WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
(WebKit::WebDataListSuggestionsDropdownIOS::close):
(WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
* UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(WebKit::WebDataListSuggestionsDropdownMac::create):
(WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
(WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
(WebKit::WebDataListSuggestionsDropdownMac::selectOption):
2018-10-19 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [Datalist] Can't pick datalist suggestions in a stock WKWebView
https://bugs.webkit.org/show_bug.cgi?id=190621
<rdar://problem/45310649>
Reviewed by Tim Horton.
Fixes the bug by refactoring datalist suggestion information on iOS; currently, we override text suggestions on
_WKFormInputSession. This only works for a few internal clients (including Safari) that set a _WKInputDelegate
and also implement either -_webView:willStartInputSession: or -_webView:didStartInputSession:, which is
necessary in order to ensure that WebKit creates and maintains a form input session.
The two pieces of information that datalist code needs to vend to WKContentView are a list of UITextSuggestions
and a custom input view, which are both currently properties of _WKFormInputSession. This patch lifts these out
of the input session and makes them properties of WKContentView, which are used in
WebDataListSuggestionsDropdownIOS.
Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
Add new properties to WKContentView: an input view for datalist suggestions, and a list of text suggestions.
(-[WKFormInputSession setSuggestions:]):
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _endEditing]):
Pull out common logic when resigning first responder or tabbing to the next or previous text field into a new
helper. This helper notifies `_inputPeripheral`, `_formInputSession`, and `_dataListTextSuggestionsInputView`
when editing has ended; the input peripheral and suggestions input view use this chance to send the value of the
form control to the web process.
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView inputView]):
If a custom input view is not set but we have an input view for a datalist's text suggestions, use the datalist
input view.
(-[WKContentView accessoryTab:]):
(-[WKContentView _stopAssistingNode]):
Clear datalist state on WKContentView.
(-[WKContentView dataListTextSuggestionsInputView]):
(-[WKContentView dataListTextSuggestions]):
(-[WKContentView setDataListTextSuggestionsInputView:]):
(-[WKContentView setDataListTextSuggestions:]):
(-[WKContentView updateTextSuggestionsForInputDelegate]):
Pull out logic for setting suggestions on UIKit's `inputDelegate` (i.e. UIKeyboardImpl). We now first consult
internally-vended text suggestions from _WKFormInputSession; if an internal client has not overridden our text
suggestions, then we simply use suggestions from the current datalist (if present).
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsPicker updateWithInformation:]):
(-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
(-[WKDataListSuggestionsPicker invalidate]):
(-[WKDataListSuggestionsPopover updateWithInformation:]):
(-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
(-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
Change all the places that currently manipulate WKContentView's form input session to directly set text
suggestions and the text suggestion input view on the content view instead.
2018-10-19 John Wilander <wilander@apple.com>
Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
https://bugs.webkit.org/show_bug.cgi?id=190687
<rdar://problem/45349024>
Reviewed by Alex Christensen.
This patch adds the following:
- The WebProcessPool now tells the WebsiteDataStore when a network process has
been created.
- The WebsiteDataStore in turn tells the WebResourceLoadStatisticsStore when
a network process has been created.
- The WebResourceLoadStatisticsStore makes sure to update the network processes
with its cookie policy when it's notified that a network process has been
created.
In addition, this patch changes the following:
- The ResourceLoadStatisticsMemoryStore no longer keeps track of which domains
it has told the network process to block cookies for. The reason is that
we cannot assume that there is only one network process so we should
always send complete blocking data.
- The ResourceLoadStatisticsMemoryStore's functions for communicating cookie
blocking state to the network process no longer take and forward the
"clear first" parameter. This is because complete data is sent every time
and thus the network process' set is always cleared on an update.
- Removes WebsiteDataStore::networkProcessDidCrash() and
WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset() since
the call site---WebProcessPool::ensureNetworkProcess()---now calls
WebsiteDataStore::didCreateNetworkProcess() after a network process
crash and the state sync for cookie blocking is triggered.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies):
(WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::clear):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState): Deleted.
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies):
(WebKit::WebsiteDataStore::didCreateNetworkProcess):
(WebKit::WebsiteDataStore::networkProcessDidCrash): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2018-10-19 Alex Christensen <achristensen@webkit.org>
Rebase python tests.
* Scripts/webkit/messages_unittest.py:
2018-10-19 Alex Christensen <achristensen@webkit.org>
Rebase python tests.
* Scripts/Makefile:
* Scripts/webkit/MessageReceiver-expected.cpp:
* Scripts/webkit/Messages-expected.h:
2018-10-19 Alex Christensen <achristensen@webkit.org>
Mark LegacySync IPC messages
https://bugs.webkit.org/show_bug.cgi?id=190759
Reviewed by Tim Horton.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* Platform/IPC/HandleMessage.h:
(IPC::handleMessageLegacySync):
* PluginProcess/PluginControllerProxy.messages.in:
* Scripts/webkit/messages.py:
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/WebFullScreenManagerProxy.messages.in:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/WebProcessPool.messages.in:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/WebStorage/StorageManager.messages.in:
* UIProcess/mac/SecItemShimProxy.messages.in:
* WebProcess/Plugins/PluginProcessConnection.messages.in:
* WebProcess/Plugins/PluginProxy.messages.in:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.messages.in:
2018-10-19 Alex Christensen <achristensen@webkit.org>
Update and add python tests after r237294
https://bugs.webkit.org/show_bug.cgi?id=190746
* Scripts/Makefile: Added to help updating expectations.
* Scripts/webkit/LegacyMessageReceiver-expected.cpp:
* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestAsyncMessage::callReply):
(Messages::WebPage::TestAsyncMessage::cancelReply):
(Messages::WebPage::TestAsyncMessage::send):
(WebKit::WebPage::didReceiveMessage):
* Scripts/webkit/MessagesSuperclass-expected.h:
(Messages::WebPage::TestAsyncMessage::receiverName):
(Messages::WebPage::TestAsyncMessage::name):
(Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
(Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
(Messages::WebPage::TestAsyncMessage::arguments const):
* Scripts/webkit/test-superclass-messages.in:
Adding the extra newline made python tests fail.
I also added more tests for the new functionality introduced in r237924.
2018-10-19 Alex Christensen <achristensen@webkit.org>
Introduce CompletionHandler-based Async IPC messages with replies
https://bugs.webkit.org/show_bug.cgi?id=190746
Reviewed by Tim Horton.
Before this patch, to make an asynchronous IPC message with a reply you had to find two objects that
can talk to each other, make two new message types, send a generated identifier, keep track of that
identifier, make a HashMap somewhere to store the object waiting for the response, and hook it all up.
What a mess. No wonder people take shortcuts and make strange design decisions.
Now, you can just use a CompletionHandler and mark the reply as Async in *.messages.in.
I've adopted this with a message whose behavior is covered by the storage/indexeddb/modern/blob-cursor.html
layout test and many others. I intent to refine and further adopt this incrementally.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
This is representative of how code will be simplified with greater adoption.
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):
Modernize HandleArray decoding.
* Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchMessage):
(IPC::nextAsyncReplyHandlerID):
(IPC::asyncReplyHandlerMap):
Handle async replies when looking at incoming messages from the sending process.
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
Send a message with an async reply and prepare the reply receiver.
* Platform/IPC/Encoder.h:
Make the uint64_t encoder public so we can use it when encoding the listenerID.
* Platform/IPC/HandleMessage.h:
(IPC::handleMessageAsync):
Handle an asynchronous message with a reply from the receiving process.
This is similar to how DelayedReply messages are handled, but the listenerID is automatically captured and sent back.
* Scripts/webkit/messages.py:
Generate code for async message replies.
* Shared/Databases/IndexedDB/WebIDBResult.cpp:
(WebKit::WebIDBResult::decode):
* Shared/SandboxExtension.h:
(WebKit::SandboxExtension::HandleArray::at):
(WebKit::SandboxExtension::HandleArray::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::decode):
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtension::HandleArray::decode):
Modernize the decoding of HandleArray to work with generated decoding.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
This is also representative of how code will be simplified with greater adoption.
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
(WebKit::MediaDeviceSandboxExtensions::decode):
Modernize HandleArray decoding.
2018-10-19 Chris Dumez <cdumez@apple.com>
[PSON] WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation
https://bugs.webkit.org/show_bug.cgi?id=190717
Reviewed by Antti Koivisto.
WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation. We need
to reset m_lastSuspendedPage whenever the page starts a new navigation as m_lastSuspendedPage is only updated when
we process-swap otherwise.
Also rename the data member to m_pageSuspendedDueToCurrentNavigation for clarity.
In a follow-up, I will see if I can get rid of this data member entirely or maybe move it to the Navigation
object.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didCompletePageTransition):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
(WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
capture "devices".
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
(WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
(WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
(WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
(WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
(WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
(WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a
PixelBuffer-backed media sample and call videoSampleAvailable.
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
factory overrides.
(WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
* WebProcess/cocoa/UserMediaCaptureManager.h:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2018-10-18 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237272.
Broke on device iOS builds and Windows builds
Reverted changeset:
"[MediaStream] Allow ports to optionally do screen capture in
the UI process"
https://bugs.webkit.org/show_bug.cgi?id=190728
https://trac.webkit.org/changeset/237272
2018-10-18 Jer Noble <jer.noble@apple.com>
Enable WKPreferences._lowPowerVideoAudioBufferSizeEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=190315
Reviewed by Eric Carlson.
This preference is disabled for WebKitLegacy because it can interact poorly with clients' own use of audio.
It can be enabled for WebKit since it will only affect the WebProcess and not the client process.
* Shared/WebPreferences.yaml:
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
(WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
capture "devices".
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
(WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
(WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
(WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
(WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
(WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
(WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a
PixelBuffer-backed media sample and call videoSampleAvailable.
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
factory overrides.
(WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
* WebProcess/cocoa/UserMediaCaptureManager.h:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2018-10-18 Chris Dumez <cdumez@apple.com>
[PSON] SuspendedPages do not report meaningful domains in Activity Monitor
https://bugs.webkit.org/show_bug.cgi?id=190721
<rdar://problem/45059699>
Reviewed by Alex Christensen.
SuspendedPages do not report meaningful domains in Activity Monitor, which makes
debugging harder.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):
(WebKit::WebProcess::updateActivePages):
2018-10-18 Alexey Proskuryakov <ap@apple.com>
Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190729
Reviewed by Tim Horton.
* DerivedSources.make:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
* NetworkProcess/NetworkActivityTracker.h:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::updateTaskWithFirstPartyForSameSiteCookies):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
(WebKit::NetworkProcess::sourceApplicationAuditData const):
(WebKit::NetworkProcess::platformSyncAllCookies):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/ios/NetworkProcessIOS.mm:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
(IPC::Connection::receiveSourceEventHandler):
(IPC::AccessibilityProcessSuspendedNotification):
* Platform/ios/AccessibilityIOS.mm:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* Platform/spi/Cocoa/DeviceIdentitySPI.h:
* Platform/spi/ios/CelestialSPI.h:
* Platform/spi/ios/FrontBoardServicesSPI.h:
* PluginProcess/mac/PluginProcessShim.mm:
* Shared/API/Cocoa/WKDataDetectorTypesInternal.h:
* Shared/API/Cocoa/WebKit.m:
* Shared/AssistedNodeInformation.cpp:
* Shared/AssistedNodeInformation.h:
* Shared/CacheModel.cpp:
(WebKit::calculateURLCacheSizes):
* Shared/ChildProcess.cpp:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/Cocoa/WebKit2InitializeCocoa.mm:
(WebKit::runInitializationCode):
* Shared/DrawingAreaInfo.h:
* Shared/EditorState.cpp:
(WebKit::EditorState::encode const):
(WebKit::EditorState::decode):
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
(WebKit::operator<<):
* Shared/EditorState.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebTouchEvent.h:
* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode const):
(WebKit::PrintInfo::decode):
* Shared/PrintInfo.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* Shared/SessionState.cpp:
(WebKit::FrameState::encode const):
(WebKit::FrameState::decode):
* Shared/SessionState.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebEvent.h:
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
* Shared/WebKeyboardEvent.cpp:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebPlatformTouchPoint.cpp:
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultPassiveTouchListenersAsDefaultOnDocument):
(defaultCustomPasteboardDataEnabled):
* Shared/WebPreferencesDefaultValues.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebTouchEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
* Shared/cf/ArgumentCodersCF.h:
* Shared/ios/ChildProcessIOS.mm:
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
* Shared/ios/InteractionInformationRequest.cpp:
* Shared/ios/InteractionInformationRequest.h:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
* Shared/ios/NativeWebMouseEventIOS.mm:
* Shared/ios/NativeWebTouchEventIOS.mm:
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
* Shared/ios/WebIconUtilities.h:
* Shared/ios/WebIconUtilities.mm:
* Shared/mac/ArgumentCodersMac.h:
* Shared/mac/ArgumentCodersMac.mm:
* Shared/mac/SandboxExtensionMac.mm:
* Shared/mac/SecItemShim.cpp:
(WebKit::initializeSecItemShim):
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy const):
* UIProcess/API/APIPageConfiguration.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/APIUIClient.h:
* UIProcess/API/C/WKInspector.cpp:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetIgnoresViewportScaleLimits):
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextIsPlugInUpdateAvailable):
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
(API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
(API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction description]):
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
* UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(IGNORE_WARNINGS_BEGIN):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _pluginProcessCount]):
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldRequireUserGestureToLoadVideo):
(validate):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setUpSQLiteDatabaseTrackerClient]):
(-[WKWebView dealloc]):
(-[WKWebView allowsLinkPreview]):
(-[WKWebView setAllowsLinkPreview:]):
(-[WKWebView _countStringMatches:options:maxCount:]):
(-[WKWebView _findString:options:maxCount:]):
(-[WKWebView _hideFindUI]):
(-[WKWebView _scrollPerformanceData]):
(-[WKWebView _allowsMediaDocumentInlinePlayback]):
(-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
(-[WKWebView _contentsOfUserInterfaceItem:]):
(-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
(-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(defaultApplicationNameForUserAgent):
* UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]):
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
* UIProcess/API/Cocoa/_WKAttachment.mm:
* UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
* UIProcess/API/Cocoa/_WKElementAction.mm:
* UIProcess/API/Cocoa/_WKElementActionInternal.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::toPKPaymentRequest):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
* UIProcess/ApplicationStateTracker.h:
* UIProcess/ApplicationStateTracker.mm:
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::shutDownProcess):
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::takeActivityToken):
(WebKit::DownloadClient::releaseActivityTokenIfNecessary):
* UIProcess/Cocoa/LayerRepresentation.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationState):
(WebKit::NavigationState::didChangeIsLoading):
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
(WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
(WebKit::VideoFullscreenManagerProxy::setVideoLayerFrame):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet presentWithParameters:completionHandler:]):
* UIProcess/Cocoa/WKWebViewContentProvider.h:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
* UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::shouldLeakBoost):
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/PageClient.h:
* UIProcess/ProcessAssertion.cpp:
* UIProcess/ProcessAssertion.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation const):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::detachRootLayer):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
* UIProcess/WKImagePreviewViewController.h:
* UIProcess/WKImagePreviewViewController.mm:
* UIProcess/WKInspectorHighlightView.h:
* UIProcess/WKInspectorHighlightView.mm:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::buildAuthData):
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Cocoa/LocalService.mm:
(WebKit::LocalService::isAvailable):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::supportsFullScreen):
* UIProcess/WebGeolocationManagerProxy.cpp:
* UIProcess/WebGeolocationManagerProxy.h:
* UIProcess/WebInspectorProxy.cpp:
* UIProcess/WebOpenPanelResultListenerProxy.cpp:
* UIProcess/WebOpenPanelResultListenerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::viewDidLeaveWindow):
(WebKit::WebPageProxy::updateThrottleState):
(WebKit::WebPageProxy::waitForDidUpdateActivityState):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::exitFullscreenImmediately):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
(WebKit::WebPageProxy::requestControlledElementID const):
(WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
(WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::isMainThreadOrCheckDisabled):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::didSetAssertionState):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath const):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
* UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/_WKWebViewPrintFormatter.mm:
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/DragDropInteractionState.mm:
* UIProcess/ios/InputViewUpdateDeferrer.h:
* UIProcess/ios/InputViewUpdateDeferrer.mm:
* UIProcess/ios/LayerRepresentation.mm:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/ios/ProcessAssertionIOS.mm:
* UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.messages.in:
* UIProcess/ios/SmartMagnificationController.mm:
* UIProcess/ios/TextCheckerIOS.mm:
* UIProcess/ios/ViewGestureControllerIOS.mm:
* UIProcess/ios/WKActionSheet.h:
* UIProcess/ios/WKActionSheet.mm:
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
* UIProcess/ios/WKApplicationStateTrackingView.h:
* UIProcess/ios/WKApplicationStateTrackingView.mm:
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/WKGeolocationProviderIOS.h:
* UIProcess/ios/WKGeolocationProviderIOS.mm:
* UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
* UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h:
* UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm:
* UIProcess/ios/WKKeyboardScrollingAnimator.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
* UIProcess/ios/WKPDFPageNumberIndicator.h:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
* UIProcess/ios/WKPasswordView.h:
* UIProcess/ios/WKPasswordView.mm:
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
* UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h:
* UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
* UIProcess/ios/WKWebEvent.h:
* UIProcess/ios/WKWebEvent.mm:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
* UIProcess/ios/WebPageProxyIOS.mm:
* UIProcess/ios/WebProcessProxyIOS.mm:
* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
* UIProcess/ios/forms/WKFileUploadPanel.h:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
* UIProcess/ios/forms/WKFormColorControl.h:
* UIProcess/ios/forms/WKFormColorControl.mm:
* UIProcess/ios/forms/WKFormColorPicker.h:
* UIProcess/ios/forms/WKFormColorPicker.mm:
* UIProcess/ios/forms/WKFormInputControl.h:
* UIProcess/ios/forms/WKFormInputControl.mm:
* UIProcess/ios/forms/WKFormPopover.h:
* UIProcess/ios/forms/WKFormPopover.mm:
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
* UIProcess/ios/forms/WKFormSelectPicker.h:
* UIProcess/ios/forms/WKFormSelectPicker.mm:
* UIProcess/ios/forms/WKFormSelectPopover.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
* UIProcess/ios/fullscreen/WKFullscreenStackView.h:
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFrameStateNode):
(WebKit::decodeBackForwardTreeNode):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
* UIProcess/mac/ViewSnapshotStore.mm:
* UIProcess/mac/WKFullScreenWindowController.mm:
* WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
(WebContentServiceInitializer):
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
* WebProcess/Geolocation/WebGeolocationManager.cpp:
* WebProcess/Geolocation/WebGeolocationManager.h:
* WebProcess/Geolocation/WebGeolocationManager.messages.in:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
* WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
* WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::windowRect):
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidLayout):
(WebKit::WebFrameLoaderClient::saveViewStateToItem):
(WebKit::WebFrameLoaderClient::restoreViewState):
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
(WebKit::WebFrameLoaderClient::objectContentType):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::hideHighlight):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findString):
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/ViewUpdateDispatcher.cpp:
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.h:
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebOpenPanelResultListener.cpp:
* WebProcess/WebPage/WebOpenPanelResultListener.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
(WebKit::WebPage::~WebPage):
(WebKit::WebPage::scalePage):
(WebKit::WebPage::setUseFixedLayout):
(WebKit::WebPage::disabledAdaptationsDidChange):
(WebKit::WebPage::viewportPropertiesDidChange):
(WebKit::WebPage::pageDidScroll):
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::updatePreferences):
(WebKit::WebPage::willCommitLayerTree):
(WebKit::WebPage::didFlushLayerTreeAtTime):
(WebKit::WebPage::mainFrameDidLayout):
(WebKit::WebPage::resetAssistedNodeForFrame):
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::elementDidBlur):
(WebKit::WebPage::willReplaceMultipartContent):
(WebKit::WebPage::didReplaceMultipartContent):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.messages.in:
* WebProcess/cocoa/PlaybackSessionManager.mm:
* WebProcess/cocoa/VideoFullscreenManager.h:
* WebProcess/cocoa/VideoFullscreenManager.messages.in:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
(WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
(WebKit::VideoFullscreenManager::didSetupFullscreen):
(WebKit::VideoFullscreenManager::didExitFullscreen):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::initializeProcessName):
(WebKit::registerWithAccessibility):
(WebKit::WebProcess::sourceApplicationAuditData const):
(WebKit::WebProcess::initializeSandbox):
* WebProcess/mac/SecItemShimLibrary.mm:
* config.h:
2018-10-18 Alex Christensen <achristensen@webkit.org>
Clean up FrameLoader two-state enums
https://bugs.webkit.org/show_bug.cgi?id=190731
Reviewed by Chris Dumez.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebCoreArgumentCoders.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2018-10-18 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Add support for AsyncResolver to resolve MDNS.
This basically reuse the code path used to resolve STUN server addresses.
Removed MDNS specific resolution.
Use existing CFHost resolution mechanism to do the actual resolution.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
* NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
* WebProcess/Network/webrtc/WebMDNSRegister.cpp:
* WebProcess/Network/webrtc/WebMDNSRegister.h:
* WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
2018-10-18 Chris Dumez <cdumez@apple.com>
[PSON] Cap number of SuspendedPageProxy objects and allow a WebPageProxy to have more than one
https://bugs.webkit.org/show_bug.cgi?id=190688
<rdar://problem/45354095>
Reviewed by Antti Koivisto.
Cap number of SuspendedPageProxy objects to 3 to avoid accumulating too many "suspended" processes.
Also allow a WebPageProxy to have more than one SuspendedPageProxy so that PageCache now works for
more than 1 history navigation (up to 3 with the suspended page limit in this patch).
The following cleanup / refactoring was made to support this:
- The SuspendedPageProxy objects are now owned by the WebProcessPool instead of the WebPageProxy.
The WebProcessPool is in charge of limiting the number of SuspendedPageProxy objects by dropping
the oldest one whenever a WebPageProxy tries to add a new one and we've already reached the limit.
- WebProcessProxy no longer needs to know anything about suspended pages, which simplifies the
code quite a bit. Instead, the SuspendedPageProxy objects now register themselves as
IPC::MessageReceivers with their WebProcessProxy. The SuspendedPageProxy also take care of
calling maybeShutdown() on their WebProcessProxy when they get destroyed.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didFinishLoad):
(WebKit::SuspendedPageProxy::didReceiveSyncMessage):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCompletePageTransition):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::addSuspendedPageProxy):
(WebKit::WebProcessPool::removeAllSuspendedPageProxiesForPage):
(WebKit::WebProcessPool::takeSuspendedPageProxy):
(WebKit::WebProcessPool::hasSuspendedPageProxyFor):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::canTerminateChildProcess):
(WebKit::WebProcessProxy::requestTermination):
* UIProcess/WebProcessProxy.h:
2018-10-17 Wenson Hsieh <wenson_hsieh@apple.com>
Enable the datalist element by default on iOS and macOS
https://bugs.webkit.org/show_bug.cgi?id=190594
<rdar://problem/45281159>
Reviewed by Ryosuke Niwa and Tim Horton.
* Configurations/FeatureDefines.xcconfig:
* Platform/spi/ios/UIKitSPI.h:
Add SPI to UITextSuggestion.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionCell setText:]):
(-[WKDataListSuggestionTable initWithElementRect:]):
Fix the 32-bit macOS build with ENABLE(DATALIST_ELEMENT).
2018-10-17 Andy Estes <aestes@apple.com>
[Apple Pay] Increment the API version to 5
https://bugs.webkit.org/show_bug.cgi?id=190686
<rdar://problem/45348523>
Reviewed by Simon Fraser.
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion):
2018-10-17 Alex Christensen <achristensen@webkit.org>
BackForwardClient needs to be able to support UIProcess-only back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190675
Reviewed by Chris Dumez.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::itemAtIndex const):
(WebKit::WebBackForwardList::backListCount const):
(WebKit::WebBackForwardList::forwardListCount const):
* UIProcess/WebBackForwardList.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::backForwardBackListCount):
(WebKit::WebPageProxy::backForwardForwardListCount):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::itemAtIndex):
(WebKit::WebBackForwardListProxy::backListCount const):
(WebKit::WebBackForwardListProxy::forwardListCount const):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dumpHistoryForTesting):
2018-10-17 Ali Juma <ajuma@chromium.org>
Flaky IntersectionObserver web platform tests involving style updates
https://bugs.webkit.org/show_bug.cgi?id=189091
Reviewed by Simon Fraser.
Add a WebPage::willDisplayPage bottleneck that gets called when flushing layers
or, in the non-composited case, when rendering the page into a bitmap.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::updateBackingStoreState):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willDisplayPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2018-10-16 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Fix xdg-desktop-portal permissions from a sandbox
https://bugs.webkit.org/show_bug.cgi?id=190619
Reviewed by Michael Catanzaro.
We have to generate a /.flatpak-info file for xdg-desktop-portal
to properly treat us as a sandboxed application.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::createSealedMemFdWithData):
(WebKit::argsToFd):
(WebKit::XDGDBusProxyLauncher::setPermissions):
(WebKit::createFlatpakInfo):
(WebKit::bubblewrapSpawn):
2018-10-16 Sihui Liu <sihui_liu@apple.com>
Add a switch for Web SQL
https://bugs.webkit.org/show_bug.cgi?id=190271
Reviewed by Ryosuke Niwa.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebSQLDisabled):
(WKPreferencesGetWebSQLDisabled):
* UIProcess/API/C/WKPreferencesRef.h:
2018-10-16 Alex Christensen <achristensen@webkit.org>
Remove InjectedBundleBackForwardList
https://bugs.webkit.org/show_bug.cgi?id=190640
Reviewed by Chris Dumez.
These objects are only used in testing now, so I made a replacement to be used for testing,
WKBundlePageDumpHistoryForTesting and WKBundleClearHistoryForTesting.
The existence of these objects is problematic with process swapping and the true back/forward list being in the UIProcess.
* Sources.txt:
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
(WKBundleBackForwardListGetTypeID):
(WKBundleBackForwardListCopyItemAtIndex):
(WKBundleBackForwardListGetBackListCount):
(WKBundleBackForwardListGetForwardListCount):
(WKBundleBackForwardListClear):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h:
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
(WKBundleBackForwardListItemGetTypeID):
(WKBundleBackForwardListItemIsSame):
(WKBundleBackForwardListItemCopyURL):
(WKBundleBackForwardListItemCopyTarget):
(WKBundleBackForwardListItemIsTargetItem):
(WKBundleBackForwardListItemCopyChildren):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageDumpHistoryForTesting):
(WKBundleClearHistoryForTesting):
(WKBundlePageGetBackForwardList):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: Removed.
* WebProcess/InjectedBundle/InjectedBundleBackForwardList.h: Removed.
* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp: Removed.
* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h: Removed.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
(WebKit::dumpHistoryItem):
(WebKit::WebPage::dumpHistoryForTesting):
(WebKit::WebPage::clearHistory):
(WebKit::WebPage::didReceiveSyncMessage):
(WebKit::WebPage::backForwardList): Deleted.
* WebProcess/WebPage/WebPage.h:
2018-10-16 Timothy Hatcher <timothy@apple.com>
Add <meta name="supported-color-schemes"> to control what color schemes the page supports
https://bugs.webkit.org/show_bug.cgi?id=190526
rdar://problem/45230140
Reviewed by Dean Jackson.
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView drawRect:]): Update use of LocalDefaultSystemAppearance.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::paintControlForLayerInContext): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRect): Ditto.
2018-10-16 Justin Michaud <justin_michaud@apple.com>
Implement feature flag and bindings for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190237
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-10-16 Philippe Normand <pnormand@igalia.com>
[GLib] Build error with RemoteInspector disabled
https://bugs.webkit.org/show_bug.cgi?id=190623
Reviewed by Michael Catanzaro.
Compilation guards added to ensure the build still works when the
Remote WebInspector has been disabled.
* UIProcess/API/glib/WebKitAutomationSession.cpp:
* UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
2018-10-16 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Fix sandbox on distros with suid bubblewrap
https://bugs.webkit.org/show_bug.cgi?id=190616
Reviewed by Michael Catanzaro.
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
2018-10-16 Alex Christensen <achristensen@webkit.org>
Replace HistoryItem* with HistoryItem& where possible
https://bugs.webkit.org/show_bug.cgi?id=190617
Reviewed by Chris Dumez.
* WebProcess/WebCoreSupport/SessionStateConversion.h:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WK2NotifyHistoryItemChanged):
(WebKit::WebBackForwardListProxy::goToItem):
* WebProcess/WebPage/WebBackForwardListProxy.h:
2018-10-16 Philippe Normand <pnormand@igalia.com>
Unreviewed, another GTK build fix after r237146
* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2018-10-15 Justin Fan <justin_fan@apple.com>
Add WebGPU 2018 feature flag and experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=190509
Reviewed by Dean Jackson.
Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature
for the 2018 WebGPU prototype.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Fix API tests after r237146
* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::decode):
I accidentally changed the decoder.
2018-10-15 Sihui Liu <sihui_liu@apple.com>
HSTS cache entries cannot be removed by origin
https://bugs.webkit.org/show_bug.cgi?id=190455
<rdar://problem/45181322>
Reviewed by Chris Dumez.
The SPI _CFNetworkResetHSTS does not recognize url without protocol, so we need to add protocol manually.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Fix GTK build, even though bots are not working right now.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r237146
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
2018-10-15 Chris Dumez <cdumez@apple.com>
REGRESSION (r236512): [ Mac WK2 ] Layout Test editing/undo/undo-smart-delete-word.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190375
<rdar://problem/45177807>
Reviewed by Ryosuke Niwa.
The test is doing the following:
> document.execCommand("Delete"); document.execCommand("Undo");
Both operation are synchronous and rely on synchronous IPC from the WebProcess to the UIProcess.
However, for the undo operation to succeed, the first command need to have been registered with
with the UIProcess via the WebPageProxy::RegisterEditCommandForUndo IPC to the UIProcess, which
is asynchronous.
After r236512, the UIProcess no longer processes incoming sync / async IPC in order and thus,
it is possible for the WebPageProxy::ExecuteUndoRedo synchronous IPC to get processed by the
UIProcess *before* the WebPageProxy::RegisterEditCommandForUndo asynchronous IPC for the
previous "Delete" command. As a result, canUndo would return false and we would fail to undo.
To address the issue, use SendOption::DispatchMessageEvenWhenWaitingForSyncReply flag when sending
the WebPageProxy::RegisterEditCommandForUndo IPC, so that it gets processed in order with regards
to surrounding synchronous IPC.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Modernize BackForwardClient.h
https://bugs.webkit.org/show_bug.cgi?id=190610
Reviewed by Chris Dumez.
* WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
(WebKit::InjectedBundleBackForwardList::clear):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
(WebKit::WebBackForwardListProxy::backListCount const):
(WebKit::WebBackForwardListProxy::forwardListCount const):
(WebKit::WebBackForwardListProxy::backListCount): Deleted.
(WebKit::WebBackForwardListProxy::forwardListCount): Deleted.
* WebProcess/WebPage/WebBackForwardListProxy.h:
(WebKit::WebBackForwardListProxy::create):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
(WebKit::WebPage::restoreSessionInternal):
2018-10-15 Timothy Hatcher <timothy@apple.com>
Add support for prefers-color-scheme media query
https://bugs.webkit.org/show_bug.cgi?id=190499
rdar://problem/45212025
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS.
* Shared/WebPreferences.yaml: Added DarkModeCSSEnabled as experimental.
2018-10-15 Patrick Griffis <pgriffis@igalia.com>
Remove StorageProcess leftover
https://bugs.webkit.org/show_bug.cgi?id=190591
Reviewed by Michael Catanzaro.
The process was deleted.
* Shared/ChildProcess.h:
* Shared/mac/ChildProcessMac.mm:
(WebKit::processStorageClass):
(WebKit::sandboxDirectory):
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused parameters of WebPageGroupData
https://bugs.webkit.org/show_bug.cgi?id=190600
Reviewed by Chris Dumez.
visibleToInjectedBundle and visibleToHistoryClient are both always true.
This removes a mysterious check in the history code.
* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode const):
(WebKit::WebPageGroupData::decode):
* Shared/WebPageGroupData.h:
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::create):
(WebKit::pageGroupData):
(WebKit::WebPageGroup::WebPageGroup):
* UIProcess/WebPageGroup.h:
(WebKit::WebPageGroup::WebPageGroup):
(WebKit::WebPageGroup::create):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::updateGlobalHistory):
(WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
(WebKit::WebFrameLoaderClient::setTitle):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::create):
* WebProcess/WebPage/WebPageGroupProxy.h:
(WebKit::WebPageGroupProxy::pageGroupID const):
(WebKit::WebPageGroupProxy::isVisibleToInjectedBundle const): Deleted.
(WebKit::WebPageGroupProxy::isVisibleToHistoryClient const): Deleted.
2018-10-15 Chris Dumez <cdumez@apple.com>
Experiment: target=_blank on anchors should imply rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=190481
Reviewed by Alex Christensen.
* Shared/WebPreferences.yaml:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused parameters from FrameLoaderClient::createFrame
https://bugs.webkit.org/show_bug.cgi?id=190587
Reviewed by Chris Dumez.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createFrame):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2018-10-15 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Can't select text after dismissing the keyboard when changing focus
https://bugs.webkit.org/show_bug.cgi?id=190563
<rdar://problem/44613559>
Reviewed by Tim Horton.
In r230686, we switched from using UIWKSelectionAssistant to UIWKTextInteractionAssistant for handling selection
in non-editable content on iOS; as such, when an editable element loses focus, instead of switching from the
text interaction assistant to the web selection assistant as we've previously done, we now reset our text
interaction assistant by calling `-[UIWKTextInteractionAssistant setGestureRecognizers]`, which removes all of
the current text selection gesture recognizers from WKContentView and regenerates them by building up a tree of
`UITextInteraction`s and adding them to the assistant (see `-[UITextInteractionAssistant
addGestureRecognizersToView:]`). In particular, `_UITextSelectionForceGesture` is the gesture recognizer used to
trigger text selection when long pressing.
After dismissing the keyboard by tapping the "Done" button, the UITextInteractions and gesture recognizers on
the interaction assistant include:
<UITextInteraction>
…
<UITextIndirectNonEditableInteraction>
<_UIKeyboardBasedNonEditableTextSelectionInteraction>
↳ "_UIKeyboardTextSelectionGestureForcePress" → <_UITextSelectionForceGesture>
However, after the keyboard dismisses due to an editable element losing focus, the UITextInteractions on the
interaction assistant look like this:
<UITextInteraction>
…
<UITextIndirectNonEditableInteraction>
Subsequently, the lack of a `_UIKeyboardBasedNonEditableTextSelectionInteraction` makes text selection by long
pressing impossible, since the `_UITextSelectionForceGesture` is never introduced to `WKContentView`. In UIKit,
`UITextIndirectNonEditableInteraction` only adds `_UIKeyboardBasedNonEditableTextSelectionInteraction` as a
child if the text input view — in our case, WKContentView — is missing an input delegate (see `-initWithView:`).
In the case where the Done button is used to dismiss the keyboard, WKContentView loses first responder, and the
input delegate of WKContentView is cleared out early on, before we call `-stopAssistingKeyboard`:
-[WKContentView(WKInteraction) setInputDelegate:]
-[UIKeyboardImpl setDelegate:force:]
-[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
-[UIResponder _finishResignFirstResponder]
-[UIResponder resignFirstResponder]
-[WKContentView(WKInteraction) resignFirstResponderForWebView]
-[UIKeyboardImpl dismissKeyboard]
However, in the case where the focused element is blurred, we end up clearing out the delegate in
`-_stopAssistingNode`, *after* we've already called `-setGestureRecognizers` on the interaction assistant. This
means UIKit will skip adding `_UIKeyboardBasedNonEditableTextSelectionInteraction` to the text interaction
assistant.
-[WKContentView(WKInteraction) setInputDelegate:]
-[UIKeyboardImpl setDelegate:force:]
-[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
-[UIResponder(UIResponderInputViewAdditions) reloadInputViews]
-[WKContentView(WKInteraction) _stopAssistingNode]
To fix this, we simply reset our `inputDelegate` earlier in `_stopAssistingKeyboard` instead of waiting until
we reload input views. This ensures that UIKit sets up the text interaction assistant's gestures when changing
focus in the same way as we would when the keyboard is dismissed via `-resignFirstResponder` (e.g. when pressing
the Done button).
Test: editing/selection/ios/select-text-after-changing-focus.html
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView setUpTextSelectionAssistant]):
(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _stopAssistingKeyboard]):
(-[WKContentView useSelectionAssistantWithGranularity:]): Deleted.
Additionally rename this to -setUpTextSelectionAssistant and remove the selection granularity argument. This was
previously used to switch between web and text interaction assistants.
2018-10-15 Remy Demarest <rdemarest@apple.com>
Web Inspector: RDM: Toolbar hidden in when Inspector is docked to side.
https://bugs.webkit.org/show_bug.cgi?id=190545
rdar://problem/44674500
Reviewed by Brian Burg.
When the inspector is placed next to the web view it uses its _topContentInset and _totalHeightOfBanners
to lay out the inspector so it does not underlap the window toolbar, but this technique does not work when
in responsive design mode because of the different attachment view. This patch fixes the issue by using
-[NSWindow contentLayoutRect] to figure out the height of the inspector instead of relying on the content
insets of the web view. This requires observing -contentLayoutRect and ensure we only observe its changes
when the view is actually on the screen.
* UIProcess/WebInspectorProxy.h:
Declare helpers to add/remove observer on the attached inspector window.
* UIProcess/mac/WKInspectorViewController.h:
* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController inspectorWKWebView:willMoveToWindow:]):
(-[WKInspectorViewController inspectorWKWebViewDidMoveToWindow:]):
* UIProcess/mac/WKInspectorWKWebView.h:
* UIProcess/mac/WKInspectorWKWebView.mm:
(-[WKInspectorWKWebView viewWillMoveToWindow:]):
(-[WKInspectorWKWebView viewDidMoveToWindow]):
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter observeValueForKeyPath:ofObject:change:context:]): Update inspector layout
whenever the contentLayoutRect changes. Except when live resizing since the attachment view also sends
notifications at the same time.
(-[WKWebInspectorProxyObjCAdapter inspectorViewController:willMoveToWindow:]):
(-[WKWebInspectorProxyObjCAdapter inspectorViewControllerDidMoveToWindow:]):
(WebKit::WebInspectorProxy::attachmentWillMoveFromWindow): Remove the observer only if we set it up before.
(WebKit::WebInspectorProxy::attachmentDidMoveToWindow): Set up the observer and immediately update the frame
of the inspector since it just moved to its final destination.
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Adjust the frame of the attached inspector based
on the contentLayoutRect of the window rather than the topContentInset of the web view.
2018-10-15 Wenson Hsieh <wenson_hsieh@apple.com>
Changing view scale should zoom to initial scale if the page is already at initial scale
https://bugs.webkit.org/show_bug.cgi?id=190570
<rdar://problem/45261877>
Reviewed by Tim Horton.
r237087 added support for changing the view scale on iOS, by making it possible to let the minimum layout size
be a factor of the view size; this allows internal clients to change page zoom levels on iOS. Currently,
changing the page zoom level automatically zooms to the new initial scale only if the user has not manually
scaled the page before, even if the page is already at initial scale (e.g. after the user double taps to zoom on
a small element, and double taps again to zoom back out to initial scale).
This patch makes some minor adjustments to automatically zoom to the new initial scale after changing the view
scale, as long as the page was at initial scale when changing zoom levels.
Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::areEssentiallyEqualAsFloat):
Move this function further up in the file, so that we can use it in `setViewportConfigurationViewLayoutSize`.
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
If the page is near initial scale and the zoom level changes, zoom to the new initial scale.
(WebKit::WebPage::viewportConfigurationChanged):
Make this take a new enum argument that determines whether we want to zoom to initial scale as a result of the
viewport configuration change (`No` by default).
2018-10-15 Chris Dumez <cdumez@apple.com>
Restrict browsing context lookup by name to frames that are related to one another
https://bugs.webkit.org/show_bug.cgi?id=190475
Reviewed by Alex Christensen.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Fix assertion after r237102
https://bugs.webkit.org/show_bug.cgi?id=190459
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient):
Shipping Safari still uses shouldGoToBackForwardListItem, so only assert on
newer platforms like we do in WKPageSetPageLoaderClient.
2018-10-15 Alex Christensen <achristensen@webkit.org>
Shrink more enum classes
https://bugs.webkit.org/show_bug.cgi?id=190540
Reviewed by Chris Dumez.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/Authentication/AuthenticationChallengeDisposition.h:
* Shared/Authentication/AuthenticationManager.h:
* Shared/Authentication/AuthenticationManager.messages.in:
* Shared/DragControllerAction.h:
* Shared/LayerTreeContext.h:
* Shared/UndoOrRedo.h:
* UIProcess/Authentication/AuthenticationDecisionListener.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Notifications/WebNotification.h:
* UIProcess/Notifications/WebNotificationManagerProxy.h:
* UIProcess/PageClient.h:
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/UserContent/InjectUserScriptImmediately.h:
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-15 Michael Catanzaro <mcatanzaro@igalia.com>
Add new files missing from previous commit.
* Source/cmake/FindLibseccomp.cmake: Added.
2018-10-15 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Implement subprocess sandboxing
https://bugs.webkit.org/show_bug.cgi?id=188568
Reviewed by Michael Catanzaro.
This implements sandboxing of WebKitWebProcesses.
The sandbox is opt-in at runtime as it is a behavior change.
See webkit_web_context_set_sandbox_enabled() and the
WEBKIT_FORCE_SANDBOX env var for developers.
This is Linux specific using Namespaces, Seccomp, and a DBus proxy service.
This introduces three new dependencies:
- bwrap executable
- libseccomp library
- xdg-dbus-proxy executable
The use of xdg-dbus-proxy will ideally be replaced once upstream DBus
gains the same filtering abilities which is a work in progress.
Currently the sandbox is not completed and there are a few large holes:
- Pulseaudio: The Pipewire project will solve this.
- DRI device access: No immediate solutions planned.
- Webcam device access: Pipewire will also solve this.
- Webprocess network access: Will require GStreamer changes.
- DConf access: Custom proxy planned.
- X11 access: Wayland solves this.
That is not an exhaustive list but are the noteworthy ones. Filesystem access
is still an evolving list as problems are found as is specific DBus name access.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_set_sandbox_enabled):
(webkit_web_context_get_sandbox_enabled):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions):
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::platformGetLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp: Added.
(WebKit::memfd_create):
(WebKit::argsToFd):
(WebKit::XDGDBusProxyLauncher::setAddress):
(WebKit::XDGDBusProxyLauncher::isRunning const):
(WebKit::XDGDBusProxyLauncher::path const):
(WebKit::XDGDBusProxyLauncher::proxyPath const):
(WebKit::XDGDBusProxyLauncher::setPermissions):
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::XDGDBusProxyLauncher::childSetupFunc):
(WebKit::XDGDBusProxyLauncher::makeProxyPath):
(WebKit::XDGDBusProxyLauncher::dbusAddressToPath):
(WebKit::bindIfExists):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindDconf):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindFonts):
(WebKit::bindGtkData):
(WebKit::bindA11y):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bindOpenGL):
(WebKit::bindV4l):
(WebKit::bindSymlinksRealPath):
(WebKit::setupSeccomp):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/BubblewrapLauncher.h: Added.
* UIProcess/Launcher/glib/FlatpakLauncher.cpp: Added.
(WebKit::flatpakSpawn):
* UIProcess/Launcher/glib/FlatpakLauncher.h: Added.
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::isInsideFlatpak):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
* UIProcess/WebProcessProxy.h:
* UIProcess/glib/WebProcessProxyGLib.cpp: Added.
(WebKit::WebProcessProxy::platformGetLaunchOptions):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Add a temporarily off by default preference for doing safe browsing checks
https://bugs.webkit.org/show_bug.cgi?id=190522
Reviewed by Chris Dumez.
Safe browsing development has taken longer than anticipated.
To prevent the unused possible contacting the safe browsing provider for no benefit, make this off by default for now.
I'll make it on by default when it's actually used.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setSafeBrowsingEnabled:]):
(-[WKPreferences _safeBrowsingEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Include EnumTraits.h less
https://bugs.webkit.org/show_bug.cgi?id=190535
Reviewed by Chris Dumez.
* NetworkProcess/NetworkSessionCreationParameters.h:
* Shared/Authentication/AuthenticationChallengeDisposition.h:
* Shared/CoordinateSystem.h:
* Shared/LayerTreeContext.h:
* Shared/UndoOrRedo.h:
* Shared/WebsiteAutoplayPolicy.h:
* Shared/WebsitePopUpPolicy.h:
* UIProcess/API/APIWebsitePolicies.h:
* WebProcess/UserContent/InjectUserScriptImmediately.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove InjectedBundle processing of back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190459
Reviewed by Chris Dumez.
* Shared/API/c/WKDeprecated.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::willGoToBackForwardListItem):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
(API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
(WKBundleBackForwardListItemCopyOriginalURL):
(WKBundleBackForwardListItemCopyTitle):
(WKBundleBackForwardListItemIsTargetItem):
(WKBundleBackForwardListItemIsInPageCache):
(WKBundleBackForwardListItemHasCachedPageExpired):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient):
(WebKit::InjectedBundlePageLoaderClient::shouldGoToBackForwardListItem): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
WebPageProxy should always have a HistoryClient
https://bugs.webkit.org/show_bug.cgi?id=190450
Reviewed by Chris Dumez.
This will make it so we don't forget to null check it.
No change in behavior because the default HistoryClient does nothing.
* UIProcess/API/APIHistoryClient.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createHistoryClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setHistoryClient):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
* UIProcess/WebPageProxy.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Use std::optional<size_t> for a WebBackForwardList's current index
https://bugs.webkit.org/show_bug.cgi?id=190448
Reviewed by Chris Dumez.
Also remove m_capacity, which was immutable.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::WebBackForwardList):
(WebKit::WebBackForwardList::~WebBackForwardList):
(WebKit::WebBackForwardList::pageClosed):
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):
(WebKit::WebBackForwardList::currentItem const):
(WebKit::WebBackForwardList::backItem const):
(WebKit::WebBackForwardList::forwardItem const):
(WebKit::WebBackForwardList::itemAtIndex const):
(WebKit::WebBackForwardList::backListCount const):
(WebKit::WebBackForwardList::forwardListCount const):
(WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardList::removeAllItems):
(WebKit::WebBackForwardList::clear):
(WebKit::WebBackForwardList::backForwardListState const):
(WebKit::WebBackForwardList::restoreFromState):
(WebKit::WebBackForwardList::loggingString):
* UIProcess/WebBackForwardList.h:
(WebKit::WebBackForwardList::currentIndex const): Deleted.
2018-10-14 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Remove Option::useAsyncIterator
https://bugs.webkit.org/show_bug.cgi?id=190567
Reviewed by Saam Barati.
* Configurations/FeatureDefines.xcconfig:
2018-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
https://bugs.webkit.org/show_bug.cgi?id=190504
<rdar://problem/45117760>
Reviewed by Tim Horton.
Add support for _setViewScale: and _viewScale on iOS. While similar in concept to macOS, changing this property
on iOS uses viewport configurations to change the minimum layout size of the document and apply view scaling.
Setting the view scale on iOS to a value `s` multiplies the minimium layout size by a factor `1 / s`, but also
multiplies the initial, minimum and maximum scales by a factor of `s`. The net effect of applying this scale
causes the page to lay out at a larger width and shrink (or a smaller width and expand) to fit the viewport.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Send `viewportConfigurationLayoutSizeScaleFactor` alongside `viewportConfigurationViewLayoutSize`.
(-[WKWebView _dispatchSetViewLayoutSize:]):
(-[WKWebView _viewScale]):
(-[WKWebView _setViewScale:]):
Provide a different implementation of `_setViewScale:` on iOS, by scaling the effective minimum layout size.
(See above for more detail).
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add missing API availability annotations for the _viewScale property.
* UIProcess/API/mac/WKView.mm:
(-[WKView _setViewScale:]):
* UIProcess/Cocoa/WebViewImpl.mm:
Both -[WKView _setViewScale:] and -[WKWebView _setViewScale:] throw Objective C exceptions upon receiving a bad
argument (e.g. scale <= 0). However, logic for throwing this exception is specific to iOS in WKWebView, and
handled in WebViewImpl on macOS. To make this less confusing, move the exception throwing code out of
!PLATFORM(MAC) in WKWebView, and move the path for raising this exception in WKView on macOS from WebViewImpl to
WKView.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::layoutSizeScaleFactor const):
Tie the notion of "view scale" on iOS to `layoutSizeScaleFactor`. As its name suggests, this is a scale factor
by which we transform the layout size.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Plumb the layout size scale factor over to the web process, along with the layout size.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
2018-10-12 Alex Christensen <achristensen@webkit.org>
Allow encoding of small enum classes
https://bugs.webkit.org/show_bug.cgi?id=190531
Reviewed by Tim Horton.
* NetworkProcess/NetworkLoadClient.h:
* Scripts/webkit/messages.py:
* Scripts/webkit/parser.py:
(parse_parameters_string):
* UIProcess/API/APINavigation.h:
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-12 Rob Buis <rbuis@igalia.com>
Solve the confusion around blankURL() and isBlankURL() in URL
https://bugs.webkit.org/show_bug.cgi?id=158988
Reviewed by Alex Christensen.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2018-10-12 Youenn Fablet <youenn@apple.com>
Cache API tests are flaky due to file writing failing from time to time
https://bugs.webkit.org/show_bug.cgi?id=190321
Reviewed by Chris Dumez.
Make NetworkCache::Storage::store callback return an error in case of writing failure.
Use this to surface this error at Cache API level.
Minor clean-up to make Storage::clear take a completion handler.
Make also sure to create the folder before writing the file in CacheStorageEngine.
As can be seen from some logging, it does happen that writing the 'origin' file sometimes fail with Posix error 9,
which might mean the folder is not present.
Changes are covered by current tests, flaky tests like http/wpt/cache-storage/cache-put-keys.https.any.worker.html
will show a "failed writing data to the file system" error message.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::writeFile):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::storeOrigin):
(WebKit::CacheStorage::Caches::writeCachesToDisk):
(WebKit::CacheStorage::Caches::writeRecord):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
(WebKit::NetworkCache::Storage::dispatchWriteOperation):
(WebKit::NetworkCache::Storage::finishWriteOperation):
(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::store):
2018-10-11 Youenn Fablet <youenn@apple.com>
IOS 12 - Service worker cache not shared when added to homescreen
https://bugs.webkit.org/show_bug.cgi?id=190269
<rdar://problem/45009961>
Reviewed by Alex Christensen.
NetworkProcessProxy does not always have all its stores in its hash map.
Make sure to check for the default web process pool store when grabbing cache storage parameters from a given session ID.
Add a way to remove the default website data for testing.
This is used in the new API test.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::deleteDefaultDataStoreForTesting):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
2018-10-10 Simon Fraser <simon.fraser@apple.com>
Hide RenderLayer z-order and normal flow lists behind iterators
https://bugs.webkit.org/show_bug.cgi?id=190457
Reviewed by Zalan Bujtas.
Expose the positive z-order, negative z-order and normal flow lists
from RenderLayer as iterators rather than vectors of raw pointers.
Use a lambda function to get access to the private constructor, while not having
to refer to the nested RenderLayer::LayerIterator class in the header.
* Shared/WebRenderLayer.cpp:
(WebKit::WebRenderLayer::WebRenderLayer):
(WebKit::WebRenderLayer::createArrayFromLayerList): Deleted.
* Shared/WebRenderLayer.h:
2018-10-11 Tim Horton <timothy_horton@apple.com>
iOS: Scrolling using the arrow keys doesn't show the scroll indicator like it does on macOS
https://bugs.webkit.org/show_bug.cgi?id=190478
<rdar://problem/22194031>
Reviewed by Megan Gardner.
* Platform/spi/ios/UIKitSPI.h:
Add some SPI.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
Do a persistent flash when scrolling continuously.
(-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
Do a single flash when doing a scroll-to-top/bottom.
2018-10-11 Tim Horton <timothy_horton@apple.com>
Clicking on bookmarklet crashes at NavigationState::willRecordNavigationSnapshot
https://bugs.webkit.org/show_bug.cgi?id=190476
<rdar://problem/32757191>
Reviewed by Megan Gardner.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _saveBackForwardSnapshotForItem:]):
The WKBackForwardListItem can be nil. Then we retrieve a reference from it.
An Objective-C method that returns a reference is a great way to get
a null reference. Other code then assumes it's not null and crashes.
Add a nil check.
2018-10-11 Tim Horton <timothy_horton@apple.com>
Hardware keyboard arrow keys/spacebar don't scroll PDFs (works for web content)
https://bugs.webkit.org/show_bug.cgi?id=190495
<rdar://problem/22734616>
Reviewed by Andy Estes.
Hook up WKKeyboardScrollViewAnimator to the scroll view when
WKPDFView is installed.
* Platform/spi/ios/UIKitSPI.h:
Move _inputFlags to the IPI section so we can remove it
from WKContentViewInteraction.
* SourcesCocoa.txt:
* UIProcess/ios/WKWebEvent.h:
* UIProcess/ios/WKWebEvent.mm:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyEvent:]):
(-[WKWebEvent dealloc]): Deleted.
* WebKit.xcodeproj/project.pbxproj:
Move WKWebEvent out of WKContentViewInteraction.
We tend to prefer one file per class.
Also, move the code to make a WKWebEvent from a UIEvent into
-initWithEvent:, instead of being ad-hoc in WKContentViewInteraction.
Adopt RetainPtr for the WKWebEvent's uiEvent property.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _handleKeyUIEvent:]):
* UIProcess/Cocoa/WKWebViewContentProvider.h:
Plumb hardware keyboard events to custom content views, if they want them.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView dealloc]):
(-[WKPDFView web_handleKeyEvent:]):
(-[WKPDFView web_initWithFrame:webView:mimeType:]):
Install a WKKeyboardScrollViewAnimator and plumb key events to it.
2018-10-11 Antoine Quint <graouts@apple.com>
[Web Animations] Allow iOS to also control toggling Web Animations CSS Integration
https://bugs.webkit.org/show_bug.cgi?id=190489
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
(-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2018-10-11 Keith Rollin <krollin@apple.com>
CURRENT_ARCH should not be used in Run Script phase.
https://bugs.webkit.org/show_bug.cgi?id=190407
<rdar://problem/45133556>
Reviewed by Alexey Proskuryakov.
CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
CURRENT_ARCH is not well-defined during this phase (and may even have
the value "undefined") since this phase is run just once per build
rather than once per supported architecture. Migrate away from
CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
performing an operation for each value, or by picking the first entry
in ARCHS and using that as a representative value.
* DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
first entry in ARCHS rather than use CURRENT_ARCH.
2018-10-11 Chris Dumez <cdumez@apple.com>
Regression(PSON): Deal with the drawing area potentially being null under WebChromeClient::contentsSizeChanged()
https://bugs.webkit.org/show_bug.cgi?id=190474
Reviewed by Geoffrey Garen.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged const):
2018-10-11 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Add mediaDevices.enumerateDevices support
https://bugs.webkit.org/show_bug.cgi?id=185761
Reviewed by Youenn Fablet.
Implemented the enumerateDevices API using a new WebKit class
(DeviceIdHashSaltStorage) that generates and stores the device ids
hash salts per origin, used to avoid fingerprinting in the
webpages.
The patch also adds a new type of data for the WebsiteDataStore.
That way the users can call the WebsiteDataStore to show what
origins have hash salt generated and remove them at some point.
For the moment just GTK+ and WPE ports are using this class to
generate the hash salts. The patch adds code to the
checkUserMediaPermissionForOrigin API implementation, it was empty
until now for these ports. In this function we create an instance
of a new class WebKitDeviceInfoPermissionRequest that implements
the WebKitPermissionRequestIface interface, that allows the ports
to use the current permission managers implemented in the
embedders to handle this new kind of request the way they like
it. The default implementation is deny.
The class WebKitDeviceInfoPermissionRequest takes care of
contacting the DeviceIdHashSaltStorage and request/regenerate the
hash salts accordingly.
Persistency is still not implemented, we will add it in a
future patch.
* Shared/WebsiteData/WebsiteDataType.h: Added the new type of
webside data: DeviceIdHashSalt.
* Sources.txt: Added new files to compilation.
* SourcesGTK.txt: Ditto.
* SourcesWPE.txt: Ditto.
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp: Added
this class to represent a request of permission to access the
devices information. This is specific for glib ports and implements
the policies regarding the hash salts when the embedder allows or
denies the access using the DeviceIdHashSaltStorage class.
(webkitDeviceInfoPermissionRequestAllow): Get the device hash salt
when the origin is allowed and set it in the original request.
(webkitDeviceInfoPermissionRequestDeny): Regenerate the device id
hash salt when the user does not allow to access the device information.
(webkit_permission_request_interface_init):
(webkitDeviceInfoPermissionRequestDispose):
(webkit_device_info_permission_request_class_init):
(webkitDeviceInfoPermissionRequestCreate): Create the class using
the proxy request from the webprocess and a reference to the
DeviceIdHashSaltStorage.
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
Ditto.
* UIProcess/API/glib/WebKitUIClient.cpp: Added the implementation
for the checkUserMediaPermissionForOrigin API for the glib ports,
it creates the device info request and calls the permission
request API.
* UIProcess/API/glib/WebKitWebsiteData.cpp:
(recordContainsSupportedDataTypes): Added the DeviceIdHashSalt
type.
(toWebKitWebsiteDataTypes): Added the conversion from the WebKit
types to the glib types for the WebsiteDataType::DeviceIdHashSalt.
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(toWebsiteDataTypes): Added the conversion from the glib type
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT to the WebKit type.
(webkit_website_data_manager_remove): Make sure we remote the
DeviceIdHashSalt if the Cookies are selected.
* UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Added
this new class that represents a permission request for the device
information in the GTK+ port.
* UIProcess/API/gtk/WebKitWebsiteData.h: Added the new type of
website that in the GTK+ port:
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
* UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Added
this new class that represents a permission request for the device
information in the WPE port.
* UIProcess/API/wpe/WebKitWebsiteData.h: Added the new type of
website that in the WPE port:
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
* UIProcess/DeviceIdHashSaltStorage.cpp: Added this new class that
handles how to generate and store the hash salts inside
WebKit. Persistency is still not implemented, we will add it in a
future patch.
(WebKit::DeviceIdHashSaltStorage::create):
(WebKit::DeviceIdHashSaltStorage::deviceIdentifierHashSaltForOrigin):
Check the map to get the hash salt for an origin, if there is none
create a new random one.
(WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdentifierHashSaltForOrigin):
Delete the hash salt of an origin if it already exists and create a new one.
(WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
Returns the list of origins that have a hash salt generated for
them. It is used in the WebsiteDataStore.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
Deletes the hash salts in the map for an origin.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
Delete the origins that have not been modified since a time.
* UIProcess/DeviceIdHashSaltStorage.h: Ditto.
* UIProcess/UserMediaPermissionCheckProxy.h: Remove uneeded class
definition.
* UIProcess/WebsiteData/WebsiteDataStore.cpp: Added support to
return and remove the origins with a generate hash salt used to
generate the device ids.
(WebKit::WebsiteDataStore::WebsiteDataStore): Added the new
reference to the DeviceIdHashSaltStorage class, used to handle the
hash salts.
(WebKit::WebsiteDataStore::fetchDataAndApply): Get the list of
origins with a hash salts in the DeviceIdHashSaltStorage.
(WebKit::WebsiteDataStore::removeData): Remove the hash salts in
DeviceIdHashSaltStorage for an origin.
* UIProcess/WebsiteData/WebsiteDataStore.h: Ditto.
(WebKit::WebsiteDataStore::deviceIdHashSaltStorage):
* WebKit.xcodeproj/project.pbxproj: Added the
DeviceIdHashSaltStorage to the compilation.
2018-10-10 Tim Horton <timothy_horton@apple.com>
Safari crashes when attempting to share a YouTube video while in full-screen
https://bugs.webkit.org/show_bug.cgi?id=190456
<rdar://problem/45130748>
Reviewed by Wenson Hsieh.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet presentWithParameters:completionHandler:]):
Allow the share sheet to present centered, since we don't have enough
context to put it in a more sensible place.
2018-10-10 Tim Horton <timothy_horton@apple.com>
REGRESSION (r236935): Layout test fast/events/ios/keyboard-scrolling-distance.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=190444
<rdar://problem/45110698>
Reviewed by Simon Fraser.
There's a race in WKKeyboardScrollingAnimator that's exacerbated by HIDEventGenerator
being much faster than a human finger. We get our "begin" events from interpretKeyEvent,
after the Web Content process has had its way with it, but currently the
back-channel "handle" events (e.g. for key up, which doesn't go to interpretKeyEvent)
are retrieved from handleKeyWebEvent in the UI process, which is *before*
the Web Content process has had a swing at it.
If you lose the race (an insanely short tap like you get from HIDEventGenerator,
or with a very busy Web Content process), we see handle(keyDown), handle(keyUp), begin(keyDown),
and get stuck scrolling!
Instead, retrieve the out-of-band "handle" events from _didHandleKeyEvent,
so that they're sensibly and strictly ordered with respect to the timing of interpretKeyEvent/"begin".
Also, hook up didFinishScrolling, so that UIScriptController's callbacks work correctly.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]):
(-[WKContentView keyboardScrollViewAnimatorDidFinishScrolling:]):
* UIProcess/ios/WKKeyboardScrollingAnimator.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator handleKeyEvent:]):
(-[WKKeyboardScrollingAnimator displayLinkFired:]):
(-[WKKeyboardScrollViewAnimator setDelegate:]):
(-[WKKeyboardScrollViewAnimator handleKeyEvent:]):
(-[WKKeyboardScrollViewAnimator didFinishScrolling]):
2018-10-10 Tim Horton <timothy_horton@apple.com>
Share more WKShareSheet code between macOS and iOS, and fix a few bugs
https://bugs.webkit.org/show_bug.cgi?id=190420
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _resolutionForShareSheetImmediateCompletionForTesting]):
(-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]):
(-[WKWebView _invokeShareSheetWithResolution:]): Deleted.
Add a new mechanism to tell the share sheet up-front that it should
immediately dismiss with a particular resolution, for testing.
See the Tools ChangeLog for justification.
We keep the bit on WKWebView instead of WKShareSheet so that it can be
called prior to invoking the share sheet.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WKShareSheet.h:
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet initWithView:]):
(-[WKShareSheet presentWithParameters:completionHandler:]):
(-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
(-[WKShareSheet _didCompleteWithSuccess:]):
(-[WKShareSheet dismiss]):
(-[WKShareSheet dispatchDidDismiss]):
(-[WKShareSheet initWithView:initWithView:]): Deleted.
(-[WKShareSheet _dispatchDidDismiss]): Deleted.
(-[WKShareSheet _cancel]): Deleted.
(-[WKShareSheet _dismissDisplayAnimated:]): Deleted.
(-[WKShareSheet _presentFullscreenViewController:animated:]): Deleted.
(-[WKShareSheet invokeShareSheetWithResolution:]): Deleted.
Reduce the number of extraneous members, methods, and #ifdefs.
Try to share as much of WKShareSheet between the platforms as makes sense.
The interface is now totally identical on the two platforms.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showShareSheet):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView invokeShareSheetWithResolution:]): Deleted.
Instead of silently failing (without even calling the completion handler!)
if we try to present one share sheet on top of another, dismiss the first
and present the new one. This is important because there are (separately
filed) bugs on both platforms where the completion handler is not called;
now, instead of a tab getting stuck forever, we'll reject the promise
when another share takes place.
2018-10-10 Tim Horton <timothy_horton@apple.com>
REGRESSION (r236678): Keyboard scrolling with arrow keys doesn't work on iOS
https://bugs.webkit.org/show_bug.cgi?id=190433
<rdar://problem/45111986>
Reviewed by Simon Fraser.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
(-[WKKeyboardScrollingAnimator beginWithEvent:]): Deleted.
(-[WKKeyboardScrollViewAnimator beginWithEvent:]): Deleted.
r236678 changes the characters in charactersIgnoringModifiers to match AppKit.
We similarly need to update WKKeyboardScrollingAnimator's comparison.
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
https://bugs.webkit.org/show_bug.cgi?id=190429
Reviewed by Saam Barati.
Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
* Shared/API/c/WKString.cpp:
(WKStringCopyJSString):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSValue):
(WebKit::callPropertyFunction):
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::runScriptsInPDFDocument):
2018-10-10 Chris Dumez <cdumez@apple.com>
Regression(PSON): Assertion hit under WebPageProxy::didNavigateWithNavigationData()
https://bugs.webkit.org/show_bug.cgi?id=190418
<rdar://problem/45059769>
Reviewed by Geoffrey Garen.
When process swapping and "suspending" the previous WebProcess in a SuspendedPageProxy,
we need to keep around the main frame's ID that still exists on in this process. This
is needed so that we can re-create a UI-side WebFrameProxy for the WebFrame that exists
in the WebProcess, if we ever swap back to this suspended process (see login in
WebPageProxy::swapToWebProcess()).
The bug was that the main frame ID was stored on the WebPageProxy via m_mainFrameID instead of the
SuspendedPageProxy. This means that m_mainFrameID would get overriden when navigating in the new
WebProcess with the value 1 (because WebFrame identifiers start at 1 and are per-WebProcess).
This would lead to us constructing a WebFrameProxy with the wrong frame identifier in
WebPageProxy::swapToWebProcess(), which would override an existing unrelated WebFrame in the
WebProcessProxy's HashMap of frames. This would lead to crashes later on as the WebFrame
would not be associated to the WebPageProxy we expect.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::mainFrameID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeCreateSuspendedPage):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCreateMainFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::suspendWebPageProxy):
* UIProcess/WebProcessProxy.h:
2018-10-10 Antti Koivisto <antti@apple.com>
Do domain prewarming for processes for new tabs
https://bugs.webkit.org/show_bug.cgi?id=190425
Reviewed by Chris Dumez.
We currently only do domain prewarming for navigation process swaps.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
Do domain prewarming when using an existing but so far unused process.
(WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
Factor into a function.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
This didn't usually get invoked.
(WebKit::WebPage::didReceivePolicyDecision):
(WebKit::WebPage::didFinishLoad):
Update prewarm information when a top level load finishes.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::sendPrewarmInformation):
* WebProcess/WebProcess.h:
2018-10-09 Antoine Quint <graouts@apple.com>
Remove the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=190034
<rdar://problem/44827544>
Reviewed by Dean Jackson.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FramesTimingFunction>::encode): Deleted.
(IPC::ArgumentCoder<FramesTimingFunction>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::Properties::encode const):
(WebKit::PlatformCAAnimationRemote::Properties::decode):
2018-10-09 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_cachesLocks.contains(sessionID) in WebKit::CacheStorageEngineConnection::dereference(PAL::SessionID, unsigned long long)
https://bugs.webkit.org/show_bug.cgi?id=190373
<rdar://problem/45106402>
Reviewed by Alex Christensen.
This assertion can be hit if:
- WebProcess has a DOMCache
- NetworkProcess crashes
- WebProcess navigates and dereference DOMCache.
Remove this assertion as it is hit when a test is using testRunner.terminateNetworkProcess().
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::dereference):
2018-10-09 Jer Noble <jer.noble@apple.com>
Crash when closing WKWebView during enter fullscreen animation
https://bugs.webkit.org/show_bug.cgi?id=190412
Reviewed by Brian Burg.
We need a valid _webView if, during -[NSWindow close], we catch a notification saying we failed to enter
fullscreen and try to replace the placeholder with the actual _webView.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController close]):
2018-10-09 Alex Christensen <achristensen@webkit.org>
REGRESSION(r231663) loading in hidden WKWebViews stalls because WebProcess is suspended
https://bugs.webkit.org/show_bug.cgi?id=190417
<rdar://problem/43391014>
Reviewed by Chris Dumez.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::didChangeIsLoading):
Revert r321663, but keep the change to TestWKWebView.mm because that made the tests more reliable.
2018-10-09 Chris Dumez <cdumez@apple.com>
Allow behavior when the parent process IPC::Connection closes to be overridden by ChildProcess subclasses
https://bugs.webkit.org/show_bug.cgi?id=190294
Reviewed by Geoffrey Garen.
Allow behavior when the parent process IPC::Connection closes to be overridden by ChildProcess subclasses.
This will be useful to allow the NetworkProcess to not exit if it still has pending downloads.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::callExitSoon):
(WebKit::NetworkProcess::initializeConnection):
* NetworkProcess/NetworkProcess.h:
* PluginProcess/PluginProcess.cpp:
(WebKit::callExit):
(WebKit::PluginProcess::initializeConnection):
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::didClose):
(WebKit::ChildProcess::initialize):
(WebKit::callExitNow): Deleted.
(WebKit::callExitSoon): Deleted.
* Shared/ChildProcess.h:
(WebKit::ChildProcess::shouldCallExitWhenConnectionIsClosed const): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::callExit):
(WebKit::WebProcess::initializeConnection):
2018-10-09 Jer Noble <jer.noble@apple.com>
WebDriver: thrown ObjC exception under -[WKFullScreenWindowController windowDidFailToEnterFullScreen:] when session is terminated
https://bugs.webkit.org/show_bug.cgi?id=190098
<rdar://problem/42822671>
Reviewed by Brian Burg.
Forcibly exit fullscreen in resetState(), while the VideoFullscreenManagerProxy is still valid.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
2018-10-09 Daniel Bates <dabates@apple.com>
[iOS] Ignore some deprecated declarations
https://bugs.webkit.org/show_bug.cgi?id=190371
Reviewed by Dan Bernstein.
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet init]):
(-[WKActionSheet presentSheet:]):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant presentSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker initWithView:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController initWithView:hasGroups:]):
2018-10-09 Claudio Saavedra <csaavedra@igalia.com>
[WPE] Explicitly link against gmodule where used
https://bugs.webkit.org/show_bug.cgi?id=190398
Reviewed by Michael Catanzaro.
* PlatformWPE.cmake:
2018-10-09 Chris Dumez <cdumez@apple.com>
PSON: Doing a cross-site navigation via the URL bar does not swap process on iOS
https://bugs.webkit.org/show_bug.cgi?id=190378
<rdar://problem/45059466>
Reviewed by Geoffrey Garen.
Process swapping was sometimes not happening via URL bar navigation on iOS due to top-hit preloading,
which would use a new WKWebView for the speculative load and rely on the _relatedWebView SPI to use
the same WebContent process as the view currently on screen.
To address the issue, if the source URL is empty and the page has a related page, use the related
page's URL as source URL when doing the process-swap decision.
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::relatedPage const):
(API::PageConfiguration::relatedPage): Deleted.
* UIProcess/API/APIPageConfiguration.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-10-09 Andy Estes <aestes@apple.com>
[iOS] Replace @"UIPreviewDataAttachmentListIsContentManaged" with a UIKit constant
https://bugs.webkit.org/show_bug.cgi?id=190400
<rdar://problem/35442879>
Reviewed by Wenson Hsieh.
Also fixed the iOS version check in WKContentViewInteraction.mm.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2018-10-09 Tim Horton <timothy_horton@apple.com>
REGRESSION (r232416): Can not scroll after swiping back on quoteunquoteapps.com
https://bugs.webkit.org/show_bug.cgi?id=190377
<rdar://problem/45108222>
Reviewed by Andy Estes.
Introduce the notion of 'pausing' to SnapshotRemovalTracker.
Reimplement r232416 in terms of this: the SnapshotRemovalTracker
starts out paused (not accepting events), and un-pauses when
we get a provisional load or same-document navigation.
This way, we don't lose the watchdog timer in cases where we get
no provisional load, same-document navigation, or main frame load
(which is the separate root cause for this bug -- this just papers
over it with a timeout).
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
Resume the snapshot removal tracker.
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
If we didn't see a provisional load or same document navigation,
but somehow got to the terminal load state, immediately remove the snapshot.
(WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
(WebKit::ViewGestureController::SnapshotRemovalTracker::start):
Start the SnapshotRemovalTracker out in the paused state; it will be
resumed in the same places we previously would call the
provisionalOrSameDocumentLoadCallback.
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
Ignore (but debug log) incoming events while paused.
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
(WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
Add the pausing bit.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):
Remove m_provisionalOrSameDocumentLoadCallback.
2018-10-09 Antti Koivisto <antti@apple.com>
Prewarm FontDatabase on process swap
https://bugs.webkit.org/show_bug.cgi?id=190312
Reviewed by Chris Dumez.
Add mechanism for caching prewarm information per domain on UI process side. This information
is then passed to newly initialized web processes that are being used for the same domain.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
Pass prewarm information on process swap to the new process.
(WebKit::WebProcessPool::didCollectPrewarmInformation):
UI process side cache.
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didCollectPrewarmInformation):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::didReceivePolicyDecision):
Collect and cache prewarm information for the previous process on process swap.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prewarmGlobally):
Renamed for clarity.
(WebKit::WebProcess::prewarmWithDomainInformation):
(WebKit::WebProcess::sendPrewarmInformation):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2018-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WK2] Add support for text alignment and text lists in font attributes
https://bugs.webkit.org/show_bug.cgi?id=190342
<rdar://problem/44767118>
Reviewed by Tim Horton.
Add encoding and decoding for text alignment and text lists in FontAttributes.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
2018-10-08 Justin Fan <justin_fan@apple.com>
WebGPU: Rename old WebGPU prototype to WebMetal
https://bugs.webkit.org/show_bug.cgi?id=190325
<rdar://problem/44990443>
Reviewed by Dean Jackson.
Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
Followup to r236942: Make input type=color an internal feature
https://bugs.webkit.org/show_bug.cgi?id=189162
Rubber-stamped by Dean Jackson.
I've learned from Dean that an internal feature is more suitable than an experimental feature in this scenario.
* Shared/WebPreferences.yaml:
2018-10-08 Aditya Keerthi <akeerthi@apple.com>
Make <input type=color> a runtime enabled (on-by-default) feature
https://bugs.webkit.org/show_bug.cgi?id=189162
Reviewed by Wenson Hsieh and Tim Horton.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
Add an experimental feature flag for input type=color.
* UIProcess/mac/WebColorPickerMac.mm:
(-[WKPopoverColorWell webDelegate]):
(-[WKPopoverColorWell setWebDelegate:]):
2018-10-08 Tim Horton <timothy_horton@apple.com>
Try to fix the build
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2018-10-08 Brian Burg <bburg@apple.com>
[Mac] Web Automation: some keyboard interactions don't generate events, causing event simulation to stall
https://bugs.webkit.org/show_bug.cgi?id=190316
<rdar://problem/42833290>
Reviewed by Tim Horton.
Some users have reported that Cmd-A for Select All no longer works in safaridriver.
Instead, this hangs the session. This happens because the WebAutomationSession class
assumes that each call to simulateKeyboardInteraction causes keyboard events to be processed,
but in corner cases like Cmd-A, some events that we simulate are swallowed by AppKit and
never make it back to WebKit. Because the session never gets the "keyboard events flushed"
callback, it assumes the interaction is still ongoing, and never returns, causing a hang.
This patch consists of two parts:
- Add logging of important state changes and events when simulating user input.
- Make code more robust when simulating key actions that generate no events on macOS.
This change progresses WPT test key_shortcuts.py::test_mod_a_and_backspace_deletes_all_text on Mac.
* Platform/Logging.h: Add a logging channel.
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired):
(WebKit::SimulatedInputDispatcher::transitionBetweenKeyFrames):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
(WebKit::SimulatedInputDispatcher::run):
(WebKit::SimulatedInputDispatcher::finishDispatching):
Add a bunch of logging so its easier to figure out where things get stuck.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::simulateKeyboardInteraction):
In some cases, no keyboard events need to be processed for the simulated interaction.
When that happens, early exit rather than waiting for keyboard events to be flushed.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage): Logging.
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
On Mac, if you tap a character key while Command is held down, only a KeyDown event
is forwarded to the first responder by AppKit, even if you send a KeyUp event too.
In this case don't send an NSEvent since it won't ever be delivered back to WebKit.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isProcessingKeyboardEvents const): Expose this state for keyboard
events too.
2018-10-08 Youenn Fablet <youenn@apple.com>
NetworkCache::Storage should be WTF::DestructionThread::Main
https://bugs.webkit.org/show_bug.cgi?id=190324
Reviewed by Alex Christensen.
Use WTF::DestructionThread::Main to make sure that Storage is destroyed in the main thread.
Remove the code that was making sure that any ref was destroyed in the main thread.
* NetworkProcess/cache/CacheStorageEngineCaches.cpp: Make sure the completion handler is not null.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation): Make it clear that a ref is taken.
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize): Protect 'this' when dispatching back to the main thread.
Move the code that was after dispatch before dispatch to allow moving protectedThis in the dispatch lambda.
(WebKit::NetworkCache::Storage::remove):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/cache/NetworkCacheStorage.h:
2018-10-08 Tim Horton <timothy_horton@apple.com>
Adjust keyboard scrolling animator to springy and semiphysical
https://bugs.webkit.org/show_bug.cgi?id=190345
<rdar://problem/43494393>
Reviewed by Simon Fraser.
Introduce WKKeyboardScrollViewAnimator, which wraps WKKeyboardScrollingAnimator
and provides a reasonable set of default behaviors for UIScrollView.
This is the first step on the way to WKKeyboardScrollingAnimator
being platform- and toolkit-agnostic, and helps avoid adding a whole
bunch of code to WKContentView.
Adopt UIKit's scroll-to-top animation curve for whole-document scrolls.
Adjust WKKeyboardScrollingAnimator's physics; it now simulates a spring
attached to the page when decelerating. When a key is pressed, it applies
a constant force to the page (up to some maximum velocity). When released,
the spring causes the page to decelerate smoothly.
Add rubber-banding to keyboard scrolling, based on the same spring that
decelerates the page.
Remove the initial bounce on keydown before starting the smooth scroll.
Remove arrow key commands from WKContentView; this avoids double-processing
incoming arrow key events, makes the event stream make more sense, and was
entirely unnecessary.
* Platform/spi/ios/UIKitSPI.h:
Add a wide variety of useful SPI.
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
Remove _scrollByContentOffset:animated: because it's only used by
the keyboard scrolling mechanism.
Remove _arrowKey because we're removing the arrow key commands.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
Create a WKKeyboardScrollViewAnimator (which knows how to directly
manipulate a UIScrollView) instead of a WKKeyboardScrollingAnimator
(which requires its clients to implement everything in terms of an
abstract interface.
(-[WKContentView scrollViewWillStartPanOrPinchGesture]):
Inform the keyboard scrolling animator that the user is going to start
an interactive gesture that needs control of the scroll view, so it
can stop its current animated scroll.
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView keyCommands]):
(-[WKContentView _arrowKeyForWebView:]): Deleted.
Remove arrow key commands.
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
Scale from content to WKWebView coordinate space; the keyboard scrolling
animator operates in WKWebView coordinates. This was broken before.
(-[WKContentView keyboardScrollViewAnimatorWillScroll:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView isKeyboardScrollable]): Deleted.
(-[WKContentView distanceForScrollingIncrement:]): Deleted.
(-[WKContentView scrollByContentOffset:animated:]): Deleted.
Reimplement these as keyboardScrollViewAnimator delegate methods.
* UIProcess/ios/WKKeyboardScrollingAnimator.h:
Add WKKeyboardScrollViewAnimator, hide the interface for
WKKeyboardScrollingAnimator itself in the implementation file.
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator initWithScrollable:]):
(-[WKKeyboardScrollingAnimator parameters]):
(-[WKKeyboardScrollingAnimator invalidate]):
(unitVector):
Return a unit vector in the given direction.
(perpendicularAbsoluteUnitVector):
Return a positive unit vector perpendicular to the axis of the given direction.
Useful for multiplying with another vector to remove the component in the
axis of the given direction.
(boxSide):
Convert ScrollingDirection to WebCore::PhysicalBoxSide, for use with RectEdges.
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Instead of just returning the desired increment, compute everything we'll need
for the lifetime of the scroll (including the force applied, maximum
velocity, etc.) and return them together.
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
Use the scrollable's native scroll-to-extent animation (e.g. UIScrollView's
scroll-to-top curve) for whole-document scrolls.
Remove the first discrete scroll; start the smooth scroll immediately.
(-[WKKeyboardScrollingAnimator handleKeyEvent:]):
(farthestPointInDirection):
(-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
Stop the current scroll. Let the spring coast to its natural stopping
point given the system's current energy, unless that stopping point is
less than one increment from the starting point. In that case, we attach
the spring to /that/ point and let it run.
(-[WKKeyboardScrollingAnimator startDisplayLinkIfNeeded]):
(-[WKKeyboardScrollingAnimator stopDisplayLink]):
(-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
Immediately stop all motion if the user touches the screen to scroll
or zoom with fingers.
(-[WKKeyboardScrollingAnimator displayLinkFired:]):
Update the position of the scrollable based on the applied force and spring.
See the comments in this function for more details.
(-[WKKeyboardScrollViewAnimator init]):
(-[WKKeyboardScrollViewAnimator initWithScrollView:]):
(-[WKKeyboardScrollViewAnimator dealloc]):
(-[WKKeyboardScrollViewAnimator invalidate]):
(-[WKKeyboardScrollViewAnimator setDelegate:]):
(-[WKKeyboardScrollViewAnimator willStartInteractiveScroll]):
(-[WKKeyboardScrollViewAnimator beginWithEvent:]):
(-[WKKeyboardScrollViewAnimator handleKeyEvent:]):
(-[WKKeyboardScrollViewAnimator isKeyboardScrollable]):
(-[WKKeyboardScrollViewAnimator distanceForIncrement:]):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
(-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
(-[WKKeyboardScrollViewAnimator contentOffset]):
(-[WKKeyboardScrollViewAnimator boundedContentOffset:]):
(-[WKKeyboardScrollViewAnimator interactiveScrollVelocity]):
(-[WKKeyboardScrollViewAnimator scrollableDirectionsFromOffset:]):
(-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
Add WKKeyboardScrollViewAnimator, which wraps WKKeyboardScrollingAnimator
and provides animated keyboard scrolling for a UIScrollView without much
additional plumbing work. It contains reasonable default behaviors,
with a few optional delegate methods for customization.
(-[WKKeyboardScrollingAnimator _scrollOffsetForEvent:]): Deleted.
(-[WKKeyboardScrollingAnimator startAnimatedScroll]): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: VideoFullscreenModel::isVisible()
https://bugs.webkit.org/show_bug.cgi?id=190356
Reviewed by Jon Lee.
Remove isVisible since it is no longer used.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::isVisible const): Deleted.
(WebKit::VideoFullscreenManagerProxy::isVisible const): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: resetMediaState.
https://bugs.webkit.org/show_bug.cgi?id=190355
Reviewed by Jon Lee.
Remove resetMediaState since it is no longer used.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::resetMediaState): Deleted.
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::resetMediaState): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
https://bugs.webkit.org/show_bug.cgi?id=190357
Reviewed by Jon Lee.
Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::setVideoLayerGravity):
(WebKit::VideoFullscreenManagerProxy::setVideoLayerGravity):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::setVideoLayerGravityEnum):
2018-10-08 Alex Christensen <achristensen@webkit.org>
Remove WKBundleFileHandleRef
https://bugs.webkit.org/show_bug.cgi?id=190360
Reviewed by Tim Horton.
WKBundleFrameGetJavaScriptWrapperForFileForWorld and WKBundleFileHandleCreateWithPath were only used in Mail
and were removed in rdar://problem/44955158
I need to remove them for rdar://problem/24576194
* Shared/API/APIObject.h:
* Shared/API/c/WKDeprecated.h:
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKBundleFrameGetJavaScriptWrapperForFileForWorld):
(WKBundleFileHandleCreateWithPath):
* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Removed.
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetJavaScriptWrapperForFileForWorld): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Removed.
* WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Removed.
* WebProcess/WebPage/WebFrame.cpp:
* WebProcess/WebPage/WebFrame.h:
2018-10-08 Konstantin Tokarev <annulen@yandex.ru>
Validation in Connection::readBytesFromSocket() is too aggressive
https://bugs.webkit.org/show_bug.cgi?id=190281
Reviewed by Michael Catanzaro.
Since r217206 Connection::readBytesFromSocket() validates size of
control message. However, it compares cmsg_len with attachmentMaxAmount,
while Connection::sendOutgoingMessage() computes it as
CMSG_LEN(sizeof(int) * attachmentFDBufferLength) where
attachmentFDBufferLength <= attachmentMaxAmount. This mismatch between
sender and receiver leads to possibility of assertion failure with large
number of attachments, e.g. here 62 attachments have cmsg_length == 264.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
2018-10-08 Chris Dumez <cdumez@apple.com>
Have DOMWindowProperty get is frame from its associated DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=190341
Reviewed by Alex Christensen.
* WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
(WebKit::InjectedBundleDOMWindowExtension::InjectedBundleDOMWindowExtension):
2018-10-07 Dan Bernstein <mitz@apple.com>
Tried to fix HAVE(LINK_PREVIEW) iOS builds.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController previewActions]):
2018-10-06 Dan Bernstein <mitz@apple.com>
Tried to fix the macOS Mojave build.
* UIProcess/API/Cocoa/LegacyBundleForClass.mm:
2018-10-06 Dan Bernstein <mitz@apple.com>
WebKit part of [Xcode] Update some build settings as recommended by Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=190250
Reviewed by Andy Estes.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA,
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF, and
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED.
* WebKit.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
* UIProcess/API/Cocoa/WKConnection.mm:
* UIProcess/API/Cocoa/WKNavigationData.mm:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
* UIProcess/API/Cocoa/WKTypeRefWrapper.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
* UIProcess/API/mac/WKView.mm:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
Suppressed -Wdeprecated-implementations around some class, category and method
implementations the above files.
2018-10-05 Alex Christensen <achristensen@webkit.org>
REGRESSION(r236154) Page loads are not drawn when loaded in shipped Safari11/12
https://bugs.webkit.org/show_bug.cgi?id=190202
Reviewed by Youenn Fablet.
Safari11/12 had a WKPageLoaderClient and a WKPageNavigationClient.
It did not actually draw the page until its WKPageNavigationClient.renderingProgressDidChange was called.
r236154 made it so we only call WKPageLoaderClient.didLayout if an application has both clients.
This fixes open source WebKit running with shipped Safari.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReachLayoutMilestone):
2018-10-05 Chris Dumez <cdumez@apple.com>
[PSON] Drop snapshotting workaround introduced in r235898
https://bugs.webkit.org/show_bug.cgi?id=190314
Reviewed by Geoffrey Garen.
Drop snapshotting workaround introduced in r235898 as it is no longer needed now
that the flashing bug has been fixed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
2018-10-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaConstraints>::encode):
(IPC::ArgumentCoder<MediaConstraints>::decode):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2018-10-03 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Add a new preference to control the visibility of displayCompositedVideoFrames in the VideoPlaybackQualityObject.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setVideoQualityIncludesDisplayCompositingEnabled:]):
(-[WKPreferences _videoQualityIncludesDisplayCompositingEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2018-10-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236866.
Breaks internal builds.
Reverted changeset:
"Add support for reporting "display composited video frames"
through the VideoPlaybackQuality object."
https://bugs.webkit.org/show_bug.cgi?id=190266
https://trac.webkit.org/changeset/236866
2018-10-05 Zach Li <zachli@apple.com>
Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
https://bugs.webkit.org/show_bug.cgi?id=190302
<rdar://problem/45031469>
Reviewed by Tim Horton.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
Introduce a new property `isSelectElement`.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle isSelectElement]):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::isSelectElement const):
Check whether the node is a select element.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2018-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [WK2] Expose some more editing SPI on WKWebView
https://bugs.webkit.org/show_bug.cgi?id=190232
<rdar://problem/44963368>
Reviewed by Tim Horton.
Exposes a few additional editing commands as SPI on WKWebView, by defining a new extension on WKWebView that
also conforms to <UIResponderStandardEditActions>. This patch implements nearly all of the remaining
unimplemented methods on UIResponderStandardEditActions, and the new extension augments this set of editing
methods by adding additional editing helpers that don't currently exist on iOS (e.g. toggleStrikeThrough and
insertUnorderedList). The names of these new methods have been largely been borrowed from their counterparts on
macOS (see: `NSResponder.h`).
The new edit actions are added in this patch on iOS are:
```
- (void)alignCenter:(id)sender;
- (void)alignJustified:(id)sender;
- (void)alignLeft:(id)sender;
- (void)alignRight:(id)sender;
- (void)indent:(id)sender;
- (void)insertOrderedList:(id)sender;
- (void)insertUnorderedList:(id)sender;
- (void)outdent:(id)sender;
- (void)toggleStrikeThrough:(id)sender;
- (void)setFont:(UIFont *)font sender:(id)sender;
- (void)setFontSize:(CGFloat)fontSize sender:(id)sender;
- (void)setTextColor:(UIColor *)color sender:(id)sender;
```
Tests: WKWebViewEditActions.ListInsertion
WKWebViewEditActions.ChangeIndentation
WKWebViewEditActions.SetAlignment
WKWebViewEditActions.ToggleStrikeThrough
WKWebViewEditActions.ChangeFontSize
WKWebViewEditActions.SetTextColor
WKWebViewEditActions.SetFontFamily
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]):
Update this to handle the new editing actions. For now, we simply treat all of the new edit actions in the same
way as we currently treat bold, italic and underline: that is, they are enabled only when the user is in a
richly contenteditable element.
(-[WKWebView setFont:sender:]):
(-[WKWebView setFontSize:sender:]):
Construct and send a set of FontChanges.
(-[WKWebView setTextColor:sender:]):
Invoke "ForeColor" with the serialized color representation. This allows us to handle `rgba()` color values,
which hex format would not permit.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add the new SPI.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::changeFontAttributes):
(WebKit::WebPageProxy::changeFont):
Pull logic for applying font and font attribute style changes out of macOS-specific code, and into
platform-agnostic code in WebPage and WebPageProxy.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
Add the new supported editing commands as supported actions in WKWebView. The only new editing commands that
aren't present in this list are -setFont:sender:, -setColor:sender:, and -setFontSize:sender: which are manually
handled in places where the `FOR_EACH_WKCONTENTVIEW_ACTION` macro is otherwise used. In a followup, we could
consider augmenting `FOR_EACH_WKCONTENTVIEW_ACTION` to handle actions with multiple arguments.
* UIProcess/ios/WKContentViewInteraction.mm:
Define a new helper macro here to define boilerplate implementations of the -…ForWebView edit command
implementations that turn around and invoke `_page->executeEditCommand` with no additional arguments, and an
edit command name matching that of the WebCore edit command.
(-[WKContentView toggleStrikeThroughForWebView:]):
(-[WKContentView increaseSizeForWebView:]):
(-[WKContentView decreaseSizeForWebView:]):
(-[WKContentView setFontForWebView:sender:]):
(-[WKContentView setFontSizeForWebView:sender:]):
(-[WKContentView setTextColorForWebView:sender:]):
(-[WKContentView canPerformActionForWebView:sender:]):
Add …ForWebView plumbing for the new editing actions, so they turn around and call into WKContentView by
default, but behavior may be overridden in WKWebView.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::changeFontAttributes): Deleted.
(WebKit::WebPageProxy::changeFont): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::changeFontAttributes):
(WebKit::WebPage::changeFont):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::changeFontAttributes): Deleted.
(WebKit::WebPage::changeFont): Deleted.
2018-10-04 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Add a new preference to control the visibility of displayCompositedVideoFrames in the VideoPlaybackQualityObject.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setVideoQualityIncludesDisplayCompositingEnabled:]):
(-[WKPreferences _videoQualityIncludesDisplayCompositingEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2018-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add SPI to expose typing attributes at the current selection on WKWebView
https://bugs.webkit.org/show_bug.cgi?id=190119
<rdar://problem/44767062>
Reviewed by Tim Horton.
Add support for new WebKit2 SPI to notify the UI delegate about font attributes when the editor state changes
(e.g. due to selection changes, or executing an edit command). See below for more detail.
Test: FontAttributes.FontAttributesAfterChangingSelection
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Add a new optional `FontAttributes` member to EditorState's post-layout data. FontAttributes are computed and
sent over IPC only if the UI delegate implements the new delegate hook which requires information about font
attributes.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Add a new flag for the UI process to let a new web page know whether it should additionally compute font
attributes when computing editor state.
* UIProcess/API/APIUIClient.h:
(API::UIClient::needsFontAttributes const):
(API::UIClient::didChangeFontAttributes):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didChangeEditorState]):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didChangeFontAttributes):
Call out to the UI delegate with a font attribute dictionary, created via FontAttributes on EditorState's
post-layout data.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setUIClient):
Update whether or not the UI process needs to know about font attributes. The UI process only requires font
attribute information if the UI delegate implements `-_webView:didChangeFontAttributes:`.
(WebKit::WebPageProxy::setNeedsFontAttributes):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::editorStateChanged):
Update the cached font attributes in the UI process when receiving a new editor state update.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
(WebKit::WebPage::editorState const):
(WebKit::WebPage::setNeedsFontAttributes):
Add a new IPC hook to update whether or not the page should additionally compute font attributes. In the case
where the UI delegate changes from something that does not require font attributes to one that does, we
additionally schedule an editor state update.
(WebKit::WebPage::updateFontAttributesAfterEditorStateChange):
Private helper function to plumb FontAttributes to the UI client after an editor state change.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-04 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
(WebKit::VideoFullscreenManager::didSetupFullscreen):
(WebKit::VideoFullscreenManager::didExitFullscreen):
2018-10-04 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236730.
This caused a consistent crash in test http/tests/media/media-
stream/get-display-media-prompt.html.
Reverted changeset:
"[MediaStream] RealtimeMediaSource should be able to vend
hashed IDs"
https://bugs.webkit.org/show_bug.cgi?id=190142
https://trac.webkit.org/changeset/236730
2018-10-04 Brian Burg <bburg@apple.com>
Web Automation: clear pending callbacks when the session terminates
https://bugs.webkit.org/show_bug.cgi?id=190259
<rdar://problem/44958352>
Reviewed by Joseph Pecoraro.
WebAutomationSession::terminate() can be called at any time to nuke the session.
However, it's possible that the session is in the midst of simulating keyboard/mouse
events. While in that state, there are some CompletionHandler objects waiting
for key/mouse events to be flushed. We need to empty out callback maps with
CompletionHandler instances so that they do not assert because they were never called.
I was able to test this manually by running a test that erroneously hangs
while waiting for keyboard input. While the test was hung, I killed the NetworkProcess
manually to trigger WebAutomationSession::terminate(). From there, I saw that the
Perform Actions REST API call gets cancelled with the appropriate error code.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::terminate):
2018-10-04 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Move time out control from WebProcess to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=189642
<rdar://problem/44476765>
Reviewed by Chris Dumez.
Besides adding a time out timer in the AuthenticatorManager, this patch also adds a new
option in MockWebAuthenticationConfiguration to turn on silent failure which is the
default policy of treating authenticators' error as suggested by spec.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):
(WebKit::AuthenticatorManager::makeCredential):
(WebKit::AuthenticatorManager::getAssertion):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
(WebKit::AuthenticatorManager::requestTimeOutTimer):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2018-10-04 Yuhan Wu <yuhan_wu@apple.com>
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018
Reviewed by Youenn Fablet and Chris Dumez.
* Shared/WebPreferences.yaml:
2018-10-03 Dan Bernstein <mitz@apple.com>
Tried to fix non-Cocoa, ENABLE(ATTACHMENT_ELEMENT) builds after r236822.
* UIProcess/PageClient.h:
2018-10-03 Dan Bernstein <mitz@apple.com>
[Cocoa] Let clients specify an NSFileWrapper subclassed to be used for _WKAttachment
https://bugs.webkit.org/show_bug.cgi?id=190270
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]): Copy new _attachmentFileWrapperClass ivar.
(-[WKWebViewConfiguration _attachmentFileWrapperClass]): Added this getter.
(-[WKWebViewConfiguration _setAttachmentFileWrapperClass:]): Added this setter, which raises
an exception if the argument is not an NSFileWrapper subclass.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new property.
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::allocFileWrapperInstance): Added. Allocates an instance of
the class specified in the configuration, or NSFileWrapper if no custom class is specified.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::platformRegisterAttachment): Use PageClient::allocFileWrapperInstance
instead of allocating an NSFileWrapper instance.
* UIProcess/PageClient.h:
(WebKit::PageClient::allocFileWrapperInstance): Defined new function. The default
implementation returns nil.
2018-10-03 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2018-10-03 Zamiul Haque <zhaque@apple.com>
Search does not cancel after number of matching terms exceed set max limit
https://bugs.webkit.org/show_bug.cgi?id=190020
<rdar://problem/39585214>
Reviewed by Andy Estes.
When searching a PDF document on MobileSafari, the maximum number of matching
terms are limited to a set constant. Beyond this limit, a PDF document should not
be searched, since the UI will not be updated correspondingly. To this effect,
a new SPI was made to cancel a search when the maximum limit of matching terms
is reached. This is done without clearing the highlighting for the all the terms
that were found under the limit. This bug was a result of not having implemented
the new SPI in WKPDFView.
This will be tested in a follow-up patch, after re-enabling WKPDFView tests
on iOS 12.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView pdfHostViewController:findStringUpdate:done:]):
2018-10-03 Brian Burg <bburg@apple.com>
[Cocoa] REGRESSION: web content process paused in debugger is considered to be unresponsive if WebKit client is sandboxed
https://bugs.webkit.org/show_bug.cgi?id=190256
<rdar://problem/44957921>
Reviewed by Alexey Proskuryakov.
Instead of giving up when the client is sandboxed, check whether it has the
exception that's necessary to get process information. If it is possible,
proceed to check whether the web content process has a debugger attached.
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformIsBeingDebugged const):
Check 'process-info-pidinfo' to see if the sysctl call would be allowed.
2018-10-03 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Enable MSE by default
https://bugs.webkit.org/show_bug.cgi?id=190243
Reviewed by Xabier Rodriguez-Calvar.
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init):
2018-10-02 Alex Christensen <achristensen@webkit.org>
Deprecate WKConnection
https://bugs.webkit.org/show_bug.cgi?id=190147
Reviewed by Andy Estes.
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage):
(didClose):
* UIProcess/API/Cocoa/WKConnectionInternal.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
2018-10-01 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Reviewed by Simon Fraser.
Implement the UI-side process for triggering a GPU mux.
* Platform/Logging.h: Add a WebGL logging channel.
* SourcesCocoa.txt: Add the new files: WebSwitchingGPUClient and HighPerformanceGPUManager.
* UIProcess/Cocoa/WebProcessProxyCocoa.mm: UI process calls that use HighPerformanceGPUManager
to keep track of whether or not this process needs the high-performance GPU.
(WebKit::WebProcessProxy::requestHighPerformanceGPU):
(WebKit::WebProcessProxy::releaseHighPerformanceGPU):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy): Make sure to unregister with the HighPerformanceGPUManager
as the process disappears without manually removing itself (e.g. crashes).
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in: New messages.
* UIProcess/mac/HighPerformanceGPUManager.cpp: New class that copies most of what used
to live in GraphicsContext3DManager. It creates a CGLPixelFormat object when it sees
that at least one process needs the high-performance GPU.
(WebKit::HighPerformanceGPUManager::singleton):
(WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
(WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
(WebKit::HighPerformanceGPUManager::updateState):
* UIProcess/mac/HighPerformanceGPUManager.h: Added.
* WebKit.xcodeproj/project.pbxproj: Add new files.
* WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.cpp: Implementation of the SwitchingGPUClient for
WebCore, which sends messages to the UI process.
(WebKit::WebSwitchingGPUClient::singleton):
(WebKit::WebSwitchingGPUClient::requestHighPerformanceGPU):
(WebKit::WebSwitchingGPUClient::releaseHighPerformanceGPU):
* WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h: Added.
* WebProcess/cocoa/WebProcessCocoa.mm: Register the GPUClient.
(WebKit::WebProcess::platformInitializeProcess):
2018-10-02 Sihui Liu <sihui_liu@apple.com>
Fix a potential crash in NetworkProcess::deleteWebsiteDataForOrigins
https://bugs.webkit.org/show_bug.cgi?id=190220
Reviewed by Chris Dumez.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2018-10-02 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit2] Format > Bold and Format > Italic don't toggle between bold and italic style
https://bugs.webkit.org/show_bug.cgi?id=179787
<rdar://problem/35593389>
Reviewed by Tim Horton.
Fixes the bug by relaxing our policy in WebViewImpl::updateFontManagerIfNeeded. Instead of updating only when
the font panel is visible, update when either the font panel is visible, or the selection is in a richly
editable area. In the latter case, an up-to-date NSFontManager state is needed in order for certain font
formatting menu items, such as bold and italic, to correctly toggle state.
Test: FontManagerTests.ToggleBoldAndItalicWithMenuItems
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKWindowVisibilityObserver observeValueForKeyPath:ofObject:change:context:]):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::updateFontManagerIfNeeded):
Rename updateFontPanelIfNeeded to updateFontManagerIfNeeded, to reflect the new behavior.
(WebKit::WebViewImpl::changeFontAttributesFromSender):
(WebKit::WebViewImpl::changeFontFromFontManager):
(WebKit::WebViewImpl::updateFontPanelIfNeeded): Deleted.
2018-10-02 Alex Christensen <achristensen@webkit.org>
Remove ParsedURLString
https://bugs.webkit.org/show_bug.cgi?id=190154
Reviewed by Chris Dumez.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::streamWillSendRequest):
(WebKit::PluginControllerProxy::streamDidReceiveResponse):
(WebKit::PluginControllerProxy::manualStreamDidReceiveResponse):
* Shared/API/APIUserContentURLPattern.h:
(API::UserContentURLPattern::matchesURL const):
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::itemIsInSameDocument const):
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest):
(WebKit::RemoteInspectorProtocolHandler::targetListChanged):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::openURL):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::addProcessToOriginCacheSet):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::createShareMenuItem):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::addUserScript):
(WebKit::InjectedBundle::addUserStyleSheet):
(WebKit::InjectedBundle::removeUserScript):
(WebKit::InjectedBundle::removeUserStyleSheet):
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::Parameters::decode):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::url):
(WebKit::WebPlatformStrategies::readURLFromPasteboard):
2018-10-01 Dean Jackson <dino@apple.com>
Remove CSS Animation Triggers
https://bugs.webkit.org/show_bug.cgi?id=190175
<rdar://problem/44925626>
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2018-10-02 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r236662): Fix -Wformat warnings in CacheStorageEngineCaches.cpp
https://bugs.webkit.org/show_bug.cgi?id=190205
Reviewed by Chris Dumez.
Passing enums to %d is not kosher, at least not according to GCC's -Wformat. Avoid it.
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::readCachesFromDisk):
(WebKit::CacheStorage::Caches::writeCachesToDisk):
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236624 and r236671.
https://bugs.webkit.org/show_bug.cgi?id=190207
The change in r236624 introduced crashes on the bots
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236624
"Unify implementation in VideoFullscreenInterfaceAVKit"
https://bugs.webkit.org/show_bug.cgi?id=190091
https://trac.webkit.org/changeset/236671
2018-10-02 Antti Koivisto <antti@apple.com>
WebPageProxy::reattachToWebProcess cleanups
https://bugs.webkit.org/show_bug.cgi?id=189881
Reviewed by Chris Dumez.
Change the factoring to separate swap and crash code paths into different functions.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::swapToWebProcess):
Separate function for the swap case.
(WebKit::WebPageProxy::finishAttachingToWebProcess):
Factor the common parts here.
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
2018-10-02 Adrian Perez de Castro <aperez@igalia.com>
[GTK] Theming of authentication dialog breaks with themes other than Adwaita
https://bugs.webkit.org/show_bug.cgi?id=190117
Reviewed by Michael Catanzaro.
Adds the missing GTK_STYLE_CLASS_BACKGROUND to the WebKitWebViewDialog
widget, which was missing for GTK+ 3.20 or newer, and set the widget
as app-paintable to avoid the base class paint method to add an opaque
background.
Thanks to Benjamin Otte for the guidance to debug the theming issues.
* UIProcess/API/gtk/WebKitWebViewDialog.cpp:
(webkitWebViewDialogDraw): Remove the style context save/restore, it
is unneeded because the style classes are set at widget construction
time and not changed ever after.
(webkitWebViewDialogConstructed): Mark the widget as app-paintable to
avoid the base widget paint operation to fill the whole background,
because the dialog widget paints the translucent overlay itself; and
also add the missing GTK_STYLE_CLASS_BACKGROUND class at construction
when building against GTK+ 3.20 or newer.
2018-10-02 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaConstraints>::encode):
(IPC::ArgumentCoder<MediaConstraints>::decode):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):
* WebProcess/cocoa/UserMediaCaptureManager.h:
2018-10-02 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Implement a way for the UI process to request typing attributes at the current selection
https://bugs.webkit.org/show_bug.cgi?id=189983
<rdar://problem/44648705>
Reviewed by Ryosuke Niwa.
Implements `-[WKWebView typingAttributesWithCompletionHandler:]`, which asynchronously retrieves an NSDictionary
containing the typing attributes at the start of the current selection. This is a new asynchronous text input
client hook on macOS that is needed in order to support NSInspectorBar on WKWebView.
At a high level, this patch builds on top of refactoring done in r236445 to make it possible to send typing
attributes from the web process to the UI process, and then adds plumbing in the WebKit2 client layer to surface
typing attributes to WKWebView on macOS.
Tests: FontManagerTests.TypingAttributesAfterSubscriptAndSuperscript
FontManagerTests.ChangeTypingAttributesWithInspectorBar
FontManagerTests.ChangeAttributesWithFontEffectsBox
* Platform/spi/mac/AppKitSPI.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
Implement IPC coding support for FontAttributes.
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/ArgumentCodersMac.h:
* Shared/mac/ArgumentCodersMac.mm:
(IPC::encode):
(IPC::decode):
Add the ability to encode and decode UIFont. This allows Cocoa platforms to send `FontAttributes.font` over IPC
with a single call to IPC::encode/IPC::decode.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView typingAttributesWithCompletionHandler:]):
Add plumbing to WebViewImpl.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::selectionDidChange):
Update the NSInspectorBar on selection change, but only if it is present and visible, and WKWebView is currently
first responder.
(WebKit::WebViewImpl::typingAttributesWithCompletionHandler):
Call into WebPageProxy to retrieve FontAttributes from the web process, and invoke the callback with an
NSDictionary constructed from the retrieved FontAttributes.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
(WebKit::WebPageProxy::fontAttributesCallback):
Add plumbing to retrieve FontAttributes from the web process at the current selection. Additionally, cache the
font attributes to avoid doing extra work during subsequent requests.
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::cachedFontAttributesAtSelectionStart const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::editorStateChanged):
Invalidate cached font attributes.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestFontAttributesAtSelectionStart):
Use the currently focused frame's Editor to compute FontAttributes at the current selection, and send the
computed FontAttributes back to the UI process.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-10-01 Devin Rousso <drousso@apple.com>
Web Inspector: remove analyzer manager
https://bugs.webkit.org/show_bug.cgi?id=190162
Reviewed by Joseph Pecoraro.
* InspectorGResources.cmake:
Remove eslint.
2018-09-30 Ryosuke Niwa <rniwa@webkit.org>
Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
https://bugs.webkit.org/show_bug.cgi?id=190108
Reviewed by Wenson Hsieh.
Adopt the new variant which directly takes VisibleSelection.
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):
2018-10-01 Andy Estes <aestes@apple.com>
[watchOS] Adopt NSURLSessionCompanionProxyPreference
https://bugs.webkit.org/show_bug.cgi?id=190177
<rdar://problem/43402114>
Reviewed by Wenson Hsieh.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2018-10-01 Chris Dumez <cdumez@apple.com>
[Mac] The UIProcess should listen to memory pressure signals
https://bugs.webkit.org/show_bug.cgi?id=190166
Reviewed by Simon Fraser.
The UIProcess should listen to memory pressure signals on Mac in order to free memory, similarly to what we already
do on iOS. The memory pressure handler currently discards view snapshots and prewarmed processes.
* SourcesCocoa.txt:
* UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h: Renamed from Source/WebKit/UIProcess/ios/WebMemoryPressureHandlerIOS.h.
* UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm: Renamed from Source/WebKit/UIProcess/ios/WebMemoryPressureHandlerIOS.mm.
(WebKit::installMemoryPressureHandler):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* WebKit.xcodeproj/project.pbxproj:
2018-10-01 Sihui Liu <sihui_liu@apple.com>
Fix Internal iOS Build after r236690
https://bugs.webkit.org/show_bug.cgi?id=190171
Reviewed by Alex Christensen.
* Platform/ExtraPrivateSymbolsForTAPI.h:
2018-10-01 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add SPI to customize the input accessory view when focusing an element
https://bugs.webkit.org/show_bug.cgi?id=190152
<rdar://problem/42754975>
Reviewed by Dan Bernstein.
Adds SPI on WKFormInputSession to customize the input accessory view, alongside the input view. See below for
more details.
Test: KeyboardInputTests.CustomInputViewAndInputAccessoryView
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession customInputAccessoryView]):
(-[WKFormInputSession setCustomInputAccessoryView:]):
Reload input views when the custom input accessory view changes.
(-[WKContentView requiresAccessoryView]):
If a custom input accessory view is specified, return YES.
(-[WKContentView inputAccessoryView]):
Return the custom input accessory view if present, and fall back to the default web form accessory view.
2018-10-01 Sihui Liu <sihui_liu@apple.com>
Remove StorageProcess
https://bugs.webkit.org/show_bug.cgi?id=189975
Reviewed by Geoffrey Garen.
* CMakeLists.txt:
* Configurations/Storage-OSX-sandbox.entitlements: Removed.
* Configurations/StorageService.xcconfig: Removed.
* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/ProcessExecutablePath.h:
* Shared/Storage/StorageProcessCreationParameters.cpp: Removed.
* Shared/Storage/StorageProcessCreationParameters.h: Removed.
* Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::executablePathOfStorageProcess): Deleted.
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Removed.
* StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Removed.
* StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Removed.
* StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Removed.
* StorageProcess/StorageProcess.cpp: Removed.
* StorageProcess/StorageProcess.h: Removed.
* StorageProcess/StorageProcess.messages.in: Removed.
* StorageProcess/StorageToWebProcessConnection.cpp: Removed.
* StorageProcess/StorageToWebProcessConnection.h: Removed.
* StorageProcess/StorageToWebProcessConnection.messages.in: Removed.
* StorageProcess/glib/StorageProcessMainGLib.cpp: Removed.
* StorageProcess/ios/StorageProcessIOS.mm: Removed.
* StorageProcess/mac/StorageProcessMac.mm: Removed.
* StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Removed.
* StorageProcess/unix/StorageProcessMainUnix.h: Removed.
* StorageProcess/win/StorageProcessMainWin.cpp: Removed.
* StorageProcess/win/StorageProcessMainWin.h: Removed.
* UIProcess/API/C/WKContext.cpp:
(WKContextTerminateStorageProcess): Deleted.
(WKContextGetDatabaseProcessIdentifier): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]): Deleted.
(-[WKProcessPool _storageProcessIdentifier]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::processName):
* UIProcess/Storage/StorageProcessProxy.cpp: Removed.
* UIProcess/Storage/StorageProcessProxy.h: Removed.
* UIProcess/Storage/StorageProcessProxy.messages.in: Removed.
* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::storageProcessDidCrash): Deleted.
* UIProcess/WebContextClient.h:
* UIProcess/WebContextSupplement.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendMemoryPressureEvent):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): Deleted.
(WebKit::WebProcessPool::getStorageProcessConnection): Deleted.
(WebKit::WebProcessPool::storageProcessCrashed): Deleted.
(WebKit::WebProcessPool::storageProcessIdentifier): Deleted.
(WebKit::WebProcessPool::terminateStorageProcessForTesting): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToStorageProcess): Deleted.
(WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary): Deleted.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getStorageProcessConnection): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::~WebsiteDataStore):
(WebKit::WebsiteDataStore::storageProcessParameters): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
* WebProcess/Storage/WebToStorageProcessConnection.cpp: Removed.
* WebProcess/Storage/WebToStorageProcessConnection.h: Removed.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcess::webToStorageProcessConnectionClosed): Deleted.
(WebKit::WebProcess::ensureWebToStorageProcessConnection): Deleted.
* WebProcess/WebProcess.h:
* webkitglib-symbols.map:
2018-10-01 David Quesada <david_quesada@apple.com>
Add missing Objective-C versions of downloads SPI
https://bugs.webkit.org/show_bug.cgi?id=190149
rdar://problem/44915592
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _downloadURLRequest:]):
(-[WKProcessPool _resumeDownloadFromData:path:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload resumeData]):
* UIProcess/API/Cocoa/_WKDownloadInternal.h:
* UIProcess/Cocoa/DownloadClient.mm:
Move the DownloadProxy's WrapperTraits out of DownloadClient, and into the internal
header so it can be used from other classes (i.e. WKProcessPool here).
2018-10-01 Alex Christensen <achristensen@webkit.org>
Fix internal build after r236665
https://bugs.webkit.org/show_bug.cgi?id=189850
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h:
* WebKit.xcodeproj/project.pbxproj:
2018-10-01 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import a JS CBOR coder
https://bugs.webkit.org/show_bug.cgi?id=189877
<rdar://problem/44701124>
Reviewed by Chris Dumez.
Update MockWebAuthenticationConfiguration to have userCertificateBase64 and intermediateCACertificateBase64
as Local's memeber such that tests can pass those certificates to MockLocalConnection instead of letting it
holds some static ones.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2018-10-01 Chris Dumez <cdumez@apple.com>
Regression(r236512): http/tests/navigation/keyboard-events-during-provisional-navigation.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190052
Reviewed by Ryosuke Niwa.
* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
* Platform/IPC/Connection.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostMessageIgnoringFullySynchronousMode):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::postMessageIgnoringFullySynchronousMode):
* WebProcess/WebPage/WebPage.h:
2018-10-01 Daniel Bates <dabates@apple.com>
[iOS] Special keys are misidentified in DOM keyboard events
https://bugs.webkit.org/show_bug.cgi?id=189974
Reviewed by Wenson Hsieh.
Take the key code of WebEvent to be the key code for the new WebKeyboardEvent verbatim
now that we normalize the character strings of the WebEvent to account for the special
UIKit input strings.
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):
2018-10-01 Alex Christensen <achristensen@webkit.org>
Fix an internal build after r236665
https://bugs.webkit.org/show_bug.cgi?id=189850
* WebKit.xcodeproj/project.pbxproj:
Make WKNSURLAuthenticationChallenge.h a private header.
2018-10-01 Alex Christensen <achristensen@webkit.org>
URL should not use TextEncoding internally
https://bugs.webkit.org/show_bug.cgi?id=190111
Reviewed by Andy Estes.
* UIProcess/WebInspectorProxy.cpp:
2018-10-01 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
(WebKit::VideoFullscreenManager::didSetupFullscreen):
(WebKit::VideoFullscreenManager::didExitFullscreen):
2018-10-01 Daniel Bates <dabates@apple.com>
[iOS] Wrong key event may be sent to UIKit
https://bugs.webkit.org/show_bug.cgi?id=189992
Reviewed by Simon Fraser.
Retain a clone of a received UIEvent if it is for a hardware key event so as to ensure that we
notify the UIKit keyboard code of the correct keyboard event.
Currently the UIProcess retains the UIEvent associated with a keyboard event so as to defer
notifying the UIKit keyboard code (via -_handleKeyUIEvent) about a received keyboard event until
after the WebProcess has processed the raw key event. If this UIEvent is for a hardware keyboard
event then it is not sufficient to retain it to preserve its value because UIKit uses a singleton
UIEvent for all hardware keyboard events ;=> its value will be clobbered as each hardware keyboard
event is received. Instead we need to explicitly clone a UIEvent for a hardware key event before
retaining it.
* Platform/spi/ios/UIKitSPI.h: Forward declare SPI.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyEvent:]): Clone the UIEvent if it is for a hardware key event.
2018-10-01 Alex Christensen <achristensen@webkit.org>
Deprecate ObjC SPI in Deprecated Xcode group
https://bugs.webkit.org/show_bug.cgi?id=189850
Reviewed by Andy Estes.
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/mac/ObjCObjectGraph.mm:
(WebKit::typeFromObject):
(WebKit::ObjCObjectGraph::encode):
(WebKit::ObjCObjectGraph::decode):
* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(didStartProvisionalNavigation):
(didReceiveServerRedirectForProvisionalNavigation):
(didFailProvisionalNavigation):
(didCommitNavigation):
(didFinishNavigation):
(didFailNavigation):
(canAuthenticateAgainstProtectionSpace):
(didReceiveAuthenticationChallenge):
(processDidCrash):
(setUpPagePolicyClient):
* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h:
* UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegatePrivate.h:
* UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h:
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
* UIProcess/API/Cocoa/WKNavigationData.h:
* UIProcess/API/Cocoa/WKNavigationDataInternal.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didCreateConnection):
(getInjectedBundleInitializationUserData):
(didNavigateWithNavigationData):
(didPerformClientRedirect):
(didPerformServerRedirect):
(didUpdateHistoryTitle):
* UIProcess/API/Cocoa/WKTypeRefWrapper.h:
* UIProcess/API/Cocoa/WKView.h:
(WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::transformHandlesToObjects):
(WebKit::WebProcessProxy::transformObjectsToHandles):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
* UIProcess/ios/WKContentView.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::transformHandlesToObjects):
(WebKit::WebProcess::transformObjectsToHandles):
2018-10-01 Youenn Fablet <youenn@apple.com>
[macOS Sierra] Layout Test http/wpt/cache-storage/cache-put-keys.https.any.worker.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=184204
Reviewed by Chris Dumez.
NetworkCache::Storage by default limits the length to read to 1500 milliseconds.
This is good for the HTTP cache since networking might be faster.
It does not work for DOM cache which needs to get these resources even if it takes a long time.
Since this is disabled by a Mode::Testing option, use it for DOMCache after renaming it to Mode::AvoidRandomness.
Add a bunch of release logging to help debugging error cases.
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::writeCachesToDisk):
(WebKit::CacheStorage::Caches::readRecord):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::open):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::Storage::shrinkIfNeeded):
* NetworkProcess/cache/NetworkCacheStorage.h:
2018-10-01 Olivier Blin <olivier.blin@softathome.com>
[WPE] Remove WebKit2InspectorGResourceBundle.xml
https://bugs.webkit.org/show_bug.cgi?id=190132
Reviewed by Michael Catanzaro.
* UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Removed.
This is unused since legacy INSPECTOR_SERVER implementation has
been removed in r217924.
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up RealtimeMediaSource settings change handling
https://bugs.webkit.org/show_bug.cgi?id=189998
<rdar://problem/44797884>
Reviewed by Youenn Fablet.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::setSettings):
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Use display-specific capture factories
https://bugs.webkit.org/show_bug.cgi?id=190043
<rdar://problem/44834412>
Reviewed by Youenn Fablet.
* WebProcess/cocoa/UserMediaCaptureManager.h:
2018-09-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236631.
https://bugs.webkit.org/show_bug.cgi?id=190112
Caused various eventSender tests, including fast/css/pseudo-
active-style-sharing*, to fail (Requested by smfr on #webkit).
Reverted changeset:
"Regression(r236512): http/tests/navigation/keyboard-events-
during-provisional-navigation.html is flaky"
https://bugs.webkit.org/show_bug.cgi?id=190052
https://trac.webkit.org/changeset/236631
2018-09-29 Chris Dumez <cdumez@apple.com>
[PSON] Deal with the drawing area potentially being null in WebFrameLoaderClient::transitionToCommittedForNewPage()
https://bugs.webkit.org/show_bug.cgi?id=190084
<rdar://problem/44844561>
Reviewed by Antti Koivisto.
Deal with the drawing area potentially being null in WebFrameLoaderClient::transitionToCommittedForNewPage(), as a
result of calling WebPage::tearDownDrawingAreaForSuspend().
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2018-09-28 Wenson Hsieh <wenson_hsieh@apple.com>
No DOM API to instantiate an attachment for an img element
https://bugs.webkit.org/show_bug.cgi?id=189934
<rdar://problem/44743222>
Reviewed by Ryosuke Niwa.
Makes some adjustments to support using _WKAttachment's file wrapper to change the contents of any image element
hosting the attachment in its shadow root. To do this, we add some plumbing to allow the UI process to update an
attachment element's enclosing image with data from its file wrapper.
* UIProcess/API/APIAttachment.cpp:
(API::Attachment::isEmpty const):
(API::Attachment::enclosingImageData const):
Helper method that creates a SharedBuffer representing image data for the attachment. Only returns a non-null
value for attachment elements that are enclosed within an image.
* UIProcess/API/APIAttachment.h:
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::enclosingImageData const):
(API::Attachment::isEmpty const):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _attachmentForIdentifier:]):
Add new SPI to request a _WKAttachment for a given unique identifier. Currently, this is only used for testing.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::platformRegisterAttachment):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateAttachmentAttributes):
(WebKit::WebPageProxy::registerAttachmentIdentifier):
(WebKit::WebPageProxy::didInsertAttachmentWithIdentifier):
Plumb whether or not the attachment is enclosed by an image from the web process to the UI process.
(WebKit::WebPageProxy::didRemoveAttachmentWithIdentifier):
(WebKit::WebPageProxy::didInsertAttachment): Deleted.
(WebKit::WebPageProxy::didRemoveAttachment):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerAttachmentIdentifier):
(WebKit::WebEditorClient::didInsertAttachmentWithIdentifier):
Update attachment attributes after inserting an attachment. This ensures that an attachment that was created and
later inserted via script into the document will be synced with state in the UI process, if the client has
changed the contents of the attachment.
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateAttachmentAttributes):
Plumb attachment data from the UI process to the web process.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2018-09-28 Chris Dumez <cdumez@apple.com>
Regression(r236512): http/tests/navigation/keyboard-events-during-provisional-navigation.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190052
Reviewed by Ryosuke Niwa.
Introduce a new IPC::SendOption indicating that the IPC should always be sent asynchronously,
even if the connection is in fully synchronous mode. This is used by WebKitTestRunner for
all text outputting (e.g. console.log) is asynchronous, and thus in order.
* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
* Platform/IPC/Connection.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostMessageIgnoringFullySynchronousMode):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::postMessageIgnoringFullySynchronousMode):
* WebProcess/WebPage/WebPage.h:
2018-09-28 John Wilander <wilander@apple.com>
Skip debug assertion in ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
https://bugs.webkit.org/show_bug.cgi?id=190097
<rdar://problem/44877080>
Reviewed by Chris Dumez.
The change in https://bugs.webkit.org/show_bug.cgi?id=190055 causes a
re-classification that may trigger a debug assertion in
ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain().
We should skip the assertion for statistics model version 14 to avoid
this.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2018-09-28 Devin Rousso <drousso@apple.com>
Web Inspector: crash in InspectorNetworkAgent::didReceiveResponse when loading denied x-frame resources
https://bugs.webkit.org/show_bug.cgi?id=190046
Reviewed by Joseph Pecoraro.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
Send the sanitized `ResourceResponse` with the message so WebInspector is able to access it.
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
* WebProcess/Network/WebResourceLoader.messages.in:
(WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2018-09-28 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Polish WebAuthN auto-test environment
https://bugs.webkit.org/show_bug.cgi?id=189283
<rdar://problem/44117828>
Reviewed by Chris Dumez.
This patch changes MockWebAuthenticationConfiguration.local to optional such that tests can express
absence of local authenticators.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getUserConsent const):
(WebKit::MockLocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockLocalService.cpp:
(WebKit::MockLocalService::platformStartDiscovery const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Adopt those Ref and WeakPtr changes made in WebCore.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::addClient):
(WebKit::PlaybackSessionModelContext::removeClient):
(WebKit::PlaybackSessionModelContext::durationChanged):
(WebKit::PlaybackSessionModelContext::currentTimeChanged):
(WebKit::PlaybackSessionModelContext::bufferedTimeChanged):
(WebKit::PlaybackSessionModelContext::rateChanged):
(WebKit::PlaybackSessionModelContext::seekableRangesChanged):
(WebKit::PlaybackSessionModelContext::canPlayFastReverseChanged):
(WebKit::PlaybackSessionModelContext::audioMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionModelContext::legibleMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionModelContext::audioMediaSelectionIndexChanged):
(WebKit::PlaybackSessionModelContext::legibleMediaSelectionIndexChanged):
(WebKit::PlaybackSessionModelContext::externalPlaybackChanged):
(WebKit::PlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged):
(WebKit::PlaybackSessionModelContext::mutedChanged):
(WebKit::PlaybackSessionModelContext::volumeChanged):
(WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
(WebKit::PlaybackSessionManagerProxy::invalidate):
(WebKit::PlaybackSessionManagerProxy::createModelAndInterface):
(WebKit::PlaybackSessionManagerProxy::removeClientForContext):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::create):
(WebKit::VideoFullscreenModelContext::VideoFullscreenModelContext):
(WebKit::VideoFullscreenModelContext::addClient):
(WebKit::VideoFullscreenModelContext::removeClient):
(WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
(WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
(WebKit::VideoFullscreenManagerProxy::invalidate):
(WebKit::VideoFullscreenManagerProxy::createModelAndInterface):
(WebKit::VideoFullscreenManagerProxy::removeClientForContext):
(WebKit::VideoFullscreenModelContext::~VideoFullscreenModelContext): Deleted.
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/mac/WKFullScreenWindowController.mm:
(WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::PlaybackSessionInterfaceContext):
(WebKit::PlaybackSessionManager::~PlaybackSessionManager):
(WebKit::PlaybackSessionManager::createModelAndInterface):
(WebKit::PlaybackSessionManager::removeContext):
(WebKit::PlaybackSessionInterfaceContext::~PlaybackSessionInterfaceContext): Deleted.
* WebProcess/cocoa/VideoFullscreenManager.h:
(WebKit::VideoFullscreenInterfaceContext::create):
(WebKit::VideoFullscreenInterfaceContext::createWeakPtr):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenInterfaceContext::VideoFullscreenInterfaceContext):
(WebKit::VideoFullscreenManager::~VideoFullscreenManager):
(WebKit::VideoFullscreenManager::createModelAndInterface):
(WebKit::VideoFullscreenManager::removeContext):
2018-09-28 Chris Dumez <cdumez@apple.com>
Drop support for cross-origin-window-policy header
https://bugs.webkit.org/show_bug.cgi?id=190081
Reviewed by Ryosuke Niwa.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::frameBecameRemote):
2018-09-28 Chris Dumez <cdumez@apple.com>
Do not do automatic process prewarming while under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=190082
<rdar://problem/39771424>
Reviewed by Geoffrey Garen.
Do not do automatic process prewarming while under memory pressure and
also terminate any prewarmed process when receiving a memory warning.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::prewarmProcess):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::handleMemoryPressureWarning):
* UIProcess/WebProcessPool.h:
* UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
(WebKit::installMemoryPressureHandler):
2018-09-28 Daniel Bates <dabates@apple.com>
[iOS] Allow programmatic focus when hardware keyboard is attached
https://bugs.webkit.org/show_bug.cgi?id=190017
<rdar://problem/42270463>
Reviewed by Wenson Hsieh.
Make the experience of using iOS with a hardware keyboard more desktop-like by allowing
programmatic focusing of editable elements.
* Platform/spi/ios/UIKitSPI.h: Forward declare SPI.
* Shared/NativeWebKeyboardEvent.h:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
(WebKit::isInHardwareKeyboardMode): Returns whether we are in hardware keyboard mode. In DumpRenderTree
and WebKitTestRunner this function always returns false to keep test results deterministic.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Allow starting an input session if we are in hardware keyboard mode.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const): Send the full editor state if we are in hardware
keyboard mode regardless of whether layout has been performed so that UIProcess can update UI,
including the position of the caret, immediately.
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Rename createMarkup to serializePreservingVisualAppearance
https://bugs.webkit.org/show_bug.cgi?id=190086
Reviewed by Wenson Hsieh.
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):
2018-09-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236605.
https://bugs.webkit.org/show_bug.cgi?id=190087
caused three API test timeouts (Requested by jernoble on
#webkit).
Reverted changeset:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236605
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Adopt those Ref and WeakPtr changes made in WebCore.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::addClient):
(WebKit::PlaybackSessionModelContext::removeClient):
(WebKit::PlaybackSessionModelContext::durationChanged):
(WebKit::PlaybackSessionModelContext::currentTimeChanged):
(WebKit::PlaybackSessionModelContext::bufferedTimeChanged):
(WebKit::PlaybackSessionModelContext::rateChanged):
(WebKit::PlaybackSessionModelContext::seekableRangesChanged):
(WebKit::PlaybackSessionModelContext::canPlayFastReverseChanged):
(WebKit::PlaybackSessionModelContext::audioMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionModelContext::legibleMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionModelContext::audioMediaSelectionIndexChanged):
(WebKit::PlaybackSessionModelContext::legibleMediaSelectionIndexChanged):
(WebKit::PlaybackSessionModelContext::externalPlaybackChanged):
(WebKit::PlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged):
(WebKit::PlaybackSessionModelContext::mutedChanged):
(WebKit::PlaybackSessionModelContext::volumeChanged):
(WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
(WebKit::PlaybackSessionManagerProxy::invalidate):
(WebKit::PlaybackSessionManagerProxy::createModelAndInterface):
(WebKit::PlaybackSessionManagerProxy::removeClientForContext):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::create):
(WebKit::VideoFullscreenModelContext::VideoFullscreenModelContext):
(WebKit::VideoFullscreenModelContext::addClient):
(WebKit::VideoFullscreenModelContext::removeClient):
(WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
(WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
(WebKit::VideoFullscreenManagerProxy::invalidate):
(WebKit::VideoFullscreenManagerProxy::createModelAndInterface):
(WebKit::VideoFullscreenManagerProxy::removeClientForContext):
(WebKit::VideoFullscreenModelContext::~VideoFullscreenModelContext): Deleted.
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/mac/WKFullScreenWindowController.mm:
(WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::PlaybackSessionInterfaceContext):
(WebKit::PlaybackSessionManager::~PlaybackSessionManager):
(WebKit::PlaybackSessionManager::createModelAndInterface):
(WebKit::PlaybackSessionManager::removeContext):
(WebKit::PlaybackSessionInterfaceContext::~PlaybackSessionInterfaceContext): Deleted.
* WebProcess/cocoa/VideoFullscreenManager.h:
(WebKit::VideoFullscreenInterfaceContext::create):
(WebKit::VideoFullscreenInterfaceContext::createWeakPtr):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenInterfaceContext::VideoFullscreenInterfaceContext):
(WebKit::VideoFullscreenManager::~VideoFullscreenManager):
(WebKit::VideoFullscreenManager::createModelAndInterface):
(WebKit::VideoFullscreenManager::removeContext):
2018-09-28 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] error C2027: use of undefined type 'WTF::EnumTraits<E>' while compiling AuthenticationChallengeProxy.cpp
https://bugs.webkit.org/show_bug.cgi?id=190071
Unreviewed build fix for WinCairo port.
AuthenticationChallengeDisposition was not defined in this file.
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp: Include "AuthenticationChallengeDisposition.h".
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Use enum class in createMarkup arguments
https://bugs.webkit.org/show_bug.cgi?id=190028
Reviewed by Wenson Hsieh.
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
https://bugs.webkit.org/show_bug.cgi?id=190055
<rdar://problem/44843460>
Reviewed by Chris Dumez.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
Bumped the statisticsModelVersion to 14 to be able to
correct legacy statistics.
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
Now skips capture if it's the main frame.
2018-09-27 Brent Fulgham <bfulgham@apple.com>
[iOS] Allow access to VoiceServices features needed for accessibility
https://bugs.webkit.org/show_bug.cgi?id=190019
<rdar://problem/43621111>
Reviewed by Chris Fleizach.
Revise the sandbox to allow access to relevant WebSpeech features.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2018-09-27 Sihui Liu <sihui_liu@apple.com>
Fix IOSMAC build
https://bugs.webkit.org/show_bug.cgi?id=190021
Reviewed by Alex Christensen.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove temporary compatibility fix for auto-dismiss popups
https://bugs.webkit.org/show_bug.cgi?id=189980
<rdar://problem/44780645>
Reviewed by Alex Christensen.
The change in https://bugs.webkit.org/show_bug.cgi?id=183620 was a temporary
compatibility fix as explained in:
https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/. We should
remove it.
These changes remove the parameter isTriggeredByUserGesture since it's no longer needed.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsStore.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
2018-09-27 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236557.
Really roll out r236557 this time because it breaks internal
builds.
Reverted changeset:
"Add VP8 support to WebRTC"
https://bugs.webkit.org/show_bug.cgi?id=189976
https://trac.webkit.org/changeset/236557
2018-09-27 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2018-09-27 Chris Dumez <cdumez@apple.com>
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=184183
<rdar://problem/36800576>
Reviewed by Ryosuke Niwa.
In recent years, we have experienced re-entrancy bugs/crashes in WebCore due to the WebContent process
processing unrelated incoming synchronous IPC when waiting for a reply to one of its synchronous IPC
to another process. In order to deal with this, we introduced a DoNotProcessIncomingMessagesWhenWaitingForSyncReply
IPC::SendOption which we used on sendSync() calls where we knew re-entering would be unsafe. However,
it turns out to be needed for a lot of the WebProcess's sync IPC and it is error-prone. In order to
address the issue, we've decided to update the WebContent process behavior so that it processes all its
IPC in order (not matter if synchronous or not) and thus so that we never dispatch unrelated synchronous
IPC while waiting for a synchronous IPC reply, expect in cases where it would cause a deadlock.
As a result, this patch also drops support for the DoNotProcessIncomingMessagesWhenWaitingForSyncReply
IPC::SendOption which is no longer needed and has some code complexity.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
* Platform/IPC/Connection.cpp:
(IPC::Connection::sendSyncMessage):
(IPC::Connection::waitForSyncReply):
* Platform/IPC/Connection.h:
(IPC::Connection::sendSync):
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::WebProcessConnection):
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::StorageToWebProcessConnection):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connectionWillOpen):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::postSynchronousMessage):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
(WebKit::WebLoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
(WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::destroy):
(WebKit::PluginProxy::supportsSnapshotting const):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::rootViewToScreen):
* WebProcess/WebProcess.cpp:
(WebKit::getNetworkProcessConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2018-09-27 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations with CSS integration on
https://bugs.webkit.org/show_bug.cgi?id=184819
<rdar://problem/39597337>
Reviewed by Dean Jackson.
* Shared/WebPreferences.yaml:
2018-09-26 James Savage <james.savage@apple.com>
Allow override of viewport configuration.
https://bugs.webkit.org/show_bug.cgi?id=188772.
<rdar://problem/43538892>.
Reviewed by Simon Fraser.
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setShouldIgnoreMetaViewport:]):
(-[WKPreferences _shouldIgnoreMetaViewport]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::viewportPropertiesDidChange): If we are ignoring the
<meta> viewport, short circuit calling setViewportArguments() and do not
do any updates.
(WebKit::WebPage::didCommitLoad): Ditto.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration): Select the default
configuration based on UIProcess setting.
2018-09-26 Chris Dumez <cdumez@apple.com>
Regression(r236512): WKWebViewCandidateTests.SoftSpaceReplacementAfterCandidateInsertionWithoutReplacement API test is failing
https://bugs.webkit.org/show_bug.cgi?id=190007
Reviewed by Alex Christensen.
Drop DispatchMessageEvenWhenWaitingForSyncReply SendOption from EditorStateChanged IPC calls to restore
pre-r236512 behavior. Before r236512, this option had no effect on IPC from the WebContent to the UIProcess
because the m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag was set
on that IPC::Connection. However, after r236512, m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage
is no longer set on the connection, and the DispatchMessageEvenWhenWaitingForSyncReply SendOption was
causing this message to get processed out of order with regards to other async IPC, thus causing the
API test failure.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendEditorStateUpdate):
(WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
2018-09-26 Alex Christensen <achristensen@webkit.org>
Fix UAF after r236463
https://bugs.webkit.org/show_bug.cgi?id=190011
Reviewed by Chris Dumez.
I had removed an early return in NetworkResourceLoader::continueDidReceiveResponse.
Reading the (probably) null m_responseCompletionHandler was reading after the object had been destroyed.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueDidReceiveResponse):
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Selection should work across shadow boundary when initiated by a mouse drag
https://bugs.webkit.org/show_bug.cgi?id=151380
<rdar://problem/24363872>
Reviewed by Antti Koivisto.
Added SelectionAcrossShadowBoundariesEnabled as an internal debug feature,
and moved CSSCustomPropertiesAndValuesEnabled to where other experimental features are located.
* Shared/WebPreferences.yaml:
2018-09-26 Chris Dumez <cdumez@apple.com>
Unreviewed, apply post-landing review comments after r236512.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
2018-09-26 Chris Dumez <cdumez@apple.com>
UIProcess should process incoming sync IPC from WebProcess when waiting for a sync IPC reply from it
https://bugs.webkit.org/show_bug.cgi?id=189927
Reviewed by Geoffrey Garen.
UIProcess should process incoming sync IPC from WebProcess when waiting for a sync IPC reply from it
in order to avoid deadlocks. This is not an issue currently because the WebProcess does process
incoming sync IPC when waiting for a sync IPC reply. However, we plan to change this in the future
in order to avoid bugs caused by re-entering WebCore at unsafe times.
The reason the UIProcess previously did not do out of order sync IPC process was to avoid processing
a synchronous policy decision IPC for a frameID it did not know about yet, due to the DidCreateMainFrame /
DidCreateSubframe IPC messages being asynchronous. To address this issue, the decidePolicyForNavigationActionSync
IPC handler now calls didCreateMainFrame() / didCreateSubframe() as needed if it does not know about
the frame yet. Note that synchronous policy decisions are rare and are currently only needed by initial
about:blank and fragment navigations.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):
(WebKit::WebFrame::createSubframe):
Drop DispatchMessageEvenWhenWaitingForSyncReply SendOption when sending the
DidCreateMainFrame / DidCreateSubframe IPC. Previously, this SendOption has
no effect because the IPC::Connection would have the
m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage
flag set to true. However, now that we stop setting this flag on the IPC
connection from the WebProcess to the UIProcess, it would lead to those
IPC messages getting processed out of order with regards to the
DecidePolicyForNavigationAsync asynchronous IPC. DidCreateMainFrame would
sometimes get processed *after* the DecidePolicyForNavigationAsync IPC
and we would not know about the frameID yet.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):
2018-09-26 Antti Koivisto <antti@apple.com>
REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on iOS
https://bugs.webkit.org/show_bug.cgi?id=189695
<rdar://problem/44551146>
Reviewed by Simon Fraser.
Freeze the layers on UI process side during process swap.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillChange]):
Shared work of _processWillSwap and _processDidExit.
(-[WKWebView _processWillSwap]):
(-[WKWebView _processDidExit]):
Split into two functions. Don't reset scroll position and similar when doing navigation swap.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::detachRemoteLayerTreeHost):
Add to way to detach RemoteLayerTreeHost from the drawing area. Inert RemoteLayerTreeHost will host
the frozen layers.
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate):
(WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilAnyUpdate):
(WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
(WebKit::RemoteLayerTreeDrawingAreaProxy::hasVisibleContent const):
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::RemoteLayerTreeHost):
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::animationDidStart):
(WebKit::RemoteLayerTreeHost::animationDidEnd):
(WebKit::RemoteLayerTreeHost::detachFromDrawingArea):
Clear the DrawingArea backpointer.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::resetState):
Detach and save the current RemoteLayerTreeHost on navigation swap.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::processWillSwap):
Avoid reseting the scroll position.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
Drop the frozen layers after setting the new root layer.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
For completeness do this also on Mac (where remote layers are currently not used).
2018-09-25 Ryosuke Niwa <rniwa@webkit.org>
Make frame flattening an internal debug feature
https://bugs.webkit.org/show_bug.cgi?id=189984
Reviewed by Simon Fraser.
Made frame flattening a runtime switchable from internal debug menu.
To avoid having to enumerate three distinct values in the settings, made it a boolean flag in WKPreference.
That's what's exposd as an API anyway.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFrameFlatteningEnabled):
(WKPreferencesGetFrameFlatteningEnabled):
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_frame_flattening):
(webkit_settings_set_enable_frame_flattening):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2018-09-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mac window capture source
https://bugs.webkit.org/show_bug.cgi?id=189958
<rdar://problem/44767616>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::beginMonitoringCaptureDevices): Sync with webcore prefs before listening
to device changes so we listen on the correct devices.
2018-09-25 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236471 and r236480.
Seems to be causing some flaky crashes
Reverted changesets:
"UIProcess should process incoming sync IPC from WebProcess
when waiting for a sync IPC reply from it"
https://bugs.webkit.org/show_bug.cgi?id=189927
https://trac.webkit.org/changeset/236471
"Revert some of the changes in r236471"
https://bugs.webkit.org/show_bug.cgi?id=189973
https://trac.webkit.org/changeset/236480
2018-09-25 Conrad Shultz <conrad_shultz@apple.com>
Enable customization of the file upload panel
https://bugs.webkit.org/show_bug.cgi?id=189970
Reviewed by Wenson Hsieh.
With this change, platform implementations can override, or implement in a category,
+[WKContentView _fileUploadPanelClass] as needed.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showRunOpenPanel:resultListener:]):
2018-09-25 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236420 and r236458.
This change is not fully correct
Reverted changesets:
"Do not do early processing of incoming sync IPC unless we're
waiting for a sync IPC reply"
https://bugs.webkit.org/show_bug.cgi?id=186941
https://trac.webkit.org/changeset/236420
"Unreviewed, update bug number of http/tests/misc/blob-
size.html crash on Windows"
https://trac.webkit.org/changeset/236458
2018-09-25 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a quick fix after r236481.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration):
Add an early return, so we don't end up with setting MockWebAuthenticationConfiguration twice.
2018-09-25 John Wilander <wilander@apple.com>
Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS)
https://bugs.webkit.org/show_bug.cgi?id=189959
<rdar://problem/44767642>
Reviewed by Chris Dumez.
We no longer make use of CFNetwork's cookie partitioning so we should
change the compile-time flag to something that makes sense. This should
also make it easier/cleaner for other ports.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::networkProcessDidCrash):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::detachedFromParent2):
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2018-09-25 Philippe Normand <pnormand@igalia.com>
[WPE] Export jsc_ symbols
https://bugs.webkit.org/show_bug.cgi?id=189964
Reviewed by Michael Catanzaro.
* webkitglib-symbols.map: Keep jsc_* symbols as visible so they
can be used by applications depending on WPE.
2018-09-25 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Make AuthenticatorManager
https://bugs.webkit.org/show_bug.cgi?id=189279
<rdar://problem/44116792>
Reviewed by Chris Dumez.
This patch introduces AuthenticatorManager which is the central of WebAuthentication that 1) handles
web requests, 2) discovers authenticators, 3) manages authetnicators and 4) in the future interacts with UI.
The lifetime of the AuthenticatorManager is managed by WebsiteDataStore such that it is almost a singleton
per UI Process.
1) Requests come from WebAuthenticatorCoordinatorProxy and then cached in AuthenticatorManager which will
then distribute requests whenever a new authenticator is discovered.
2) An ABC AuthenticatorTransportService is provided as an interface for AuthenticatorManager to invoke
startDiscovery. Actual work will be done in corresponding derived classes, say, LocalService. LocalService
is the one that discover attached platform authenticators, for example, TouchID or FaceID.
Eache service is unique per AuthetnicatorManager, which means we will have at most 4 services, Local, USB,
NFC, and BLE. The latter three will be implemented soon. Also, AuthenticatorManager serves as an observer to
*Service, so the latter can inform the former whenever an authenticator is added or removed.
When a new authenticator is discovered, the corresponding service will create an Authetnicator object that
binds to the physical authenticator device through a *Connection object. There is no ABC for connection for
now as I forsee every *Connection will be quite different. The *Connection object is the one that send/receive
messages from the physicla device. So far, a LocalConnection is provided even though normally local authenticators
are attached. This class is provided solely for separating UI and network traffic from LocalAuthenticator's
request handling process. So we can override them in a mock test environment. I will talk about this in the
next section.
3) An ABC Authenticator is provided as an interface for AuthenticatorManager to distribute requests on. Requests
will then be handled by the derived classes, say, LocalAuthenticator. Each authenticator object is a FSM that
works asynchronously.
For LocalAuthenticator, it has 4 states for MakeCredential: Init => RequestReceived => UserConsented => Attested => End,
and 3 states for GetAssertion: Init => RequestReceived => UserConsented => End. In the transit from RequestReceived to
UserConsented, it will invoke LocalConnection to talk to LocalAuthentication.framework that prompt users for TouchID
or FaceID. And then the transit from UserConsented => Attested, it will invoke LocalConnection to talk to
DeviceIdentity.framework that does Apple attestation. Most of the work are from the original LocalAuthenticator
implementation, and this patch converts it to a FSM and simplify the callback and threading model.
When a respond is ready, each authenticator will notify their observer which is the AuthenticatorManager.
AuthenticatorManager will only reply to Web Process whenever there is a valid respond or a terminating error. Otherwise,
the request will time out. I will explore the time out mechanism in a more detailed manner in Bug 189642.
The above is a briefing of the AuthetnicatorManager architecture in functional. The asynchronous model is explained here:
1) Since most discovery and request handling processes are asynchronous, I enforced them to be executed asyncrhonous in
the interface of the ABC.
2) There is no dedicated secondary threads here. However, underlying framework might decide to perform works on a dedicated
thread and then execute the provided callback. Whenever such situation happens, the policy here is to wrap the actual callback
into a callback that will post the actual callback back to the main thread and pass the wrapping callback to the APIs. Hence,
weak pointers in the actual callback are guaranteed to work.
3) Callbacks are used only if it is one way, and they are CompletionHandlers.
4) Potential multi ways asynchronous operations are encapsulated in regarding Observer interfaces.
Finally, let me explain how the mock test works:
1) Mock testing is done in WebKitTestRunner instead of Internals because a considerable large portion of work is in UIProcess
instead of WebProcess, says, the AuthenticatorManager.
2) The basic idea is to override functionality of *Connection classes and then make them thin such that we can get the best
possible coverage in auto tests.
3) In order to enable layout tests to configure the Mock*Connection classes, a MockWebAuthenticationConfiguration struct is
provided. A corresponding JS dictionary will be created by each test and passed from the TestRunner to the connection object.
4) To bridge the above tunnel, a MockAuthenticatorManager is constructed. It is instrumented to return every error.
5) Also, Mock*Service classes are made to mock the discovery process as well.
6) Noted, every mock overrided methods are made thin.
* CMakeLists.txt:
* Configurations/WebKit.xcconfig:
* Platform/spi/Cocoa/DeviceIdentitySPI.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
* SourcesCocoa.txt:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebAuthentication/Authenticator.cpp: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
(WebKit::Authenticator::handleRequest):
(WebKit::Authenticator::receiveRespond const):
* UIProcess/WebAuthentication/Authenticator.h: Renamed from Source/WebCore/Modules/webauthn/cocoa/LocalAuthenticator.h.
(WebKit::Authenticator::setObserver):
(WebKit::Authenticator::observer const):
(WebKit::Authenticator::requestData const):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp: Added.
(WebKit::AuthenticatorManagerInternal::collectTransports):
(WebKit::AuthenticatorManager::makeCredential):
(WebKit::AuthenticatorManager::getAssertion):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::authenticatorAdded):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::createService const):
(WebKit::AuthenticatorManager::respondReceivedInternal):
(WebKit::AuthenticatorManager::startDiscovery):
* UIProcess/WebAuthentication/AuthenticatorManager.h: Added.
(WebKit::AuthenticatorManager::pendingCompletionHandler):
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: Copied from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
(WebKit::AuthenticatorTransportService::create):
(WebKit::AuthenticatorTransportService::createMock):
(WebKit::AuthenticatorTransportService::AuthenticatorTransportService):
(WebKit::AuthenticatorTransportService::startDiscovery const):
* UIProcess/WebAuthentication/AuthenticatorTransportService.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
(WebKit::AuthenticatorTransportService::observer const):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: Added.
(WebKit::LocalAuthenticatorInternal::buildAuthData):
(WebKit::LocalAuthenticatorInternal::transportsContain):
(WebKit::LocalAuthenticatorInternal::produceHashSet):
(WebKit::LocalAuthenticatorInternal::toVector):
(WebKit::LocalAuthenticator::LocalAuthenticator):
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: Added.
(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Cocoa/LocalService.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/Cocoa/LocalService.mm: Renamed from Source/WebCore/PAL/pal/spi/cocoa/DeviceIdentitySPI.h.
(WebKit::LocalService::LocalService):
(WebKit::LocalService::isAvailable):
(WebKit::LocalService::startDiscoveryInternal const):
(WebKit::LocalService::platformStartDiscovery const):
(WebKit::LocalService::createLocalConnection const):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
(WebKit::MockAuthenticatorManager::MockAuthenticatorManager):
(WebKit::MockAuthenticatorManager::createService const):
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/Mock/MockLocalConnection.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: Added.
(WebKit::MockLocalConnection::MockLocalConnection):
(WebKit::MockLocalConnection::getUserConsent const):
(WebKit::MockLocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockLocalService.cpp: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
(WebKit::MockLocalService::MockLocalService):
(WebKit::MockLocalService::platformStartDiscovery const):
(WebKit::MockLocalService::createLocalConnection const):
* UIProcess/WebAuthentication/Mock/MockLocalService.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/WebAuthenticationRequestData.h: Renamed from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
(WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
(WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
(WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
(WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable):
(WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailableReply): Deleted.
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::authenticatorManager):
* WebKit.xcodeproj/project.pbxproj:
2018-09-25 Chris Dumez <cdumez@apple.com>
Revert some of the changes in r236471
https://bugs.webkit.org/show_bug.cgi?id=189973
Reviewed by Alex Christensen.
Revert some of the changes in r236471 as they should not be needed. In particular,
it should not be possible for the DecidePolicyForNavigationActionSync IPC to get
processed *before* the DidCreateMainFrame / DidCreateSubframe ones because those
use IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply. They are thus
processed early when necessary, the same way as synchronous IPC messages.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):
(WebKit::WebFrame::createSubframe):
2018-09-25 Sihui Liu <sihui_liu@apple.com>
Move Service Worker Management from Storage Process to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189422
Reviewed by Youenn Fablet.
After r236035, this is another piece to move functionality of storage process to network process. When
we enable Service Workers, network process instead of storage process will be launched.
This patch will not change the behavior of Service Worker.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::unregisterSWConnections):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::connectionToContextProcessFromIPCConnection):
(WebKit::NetworkProcess::connectionToContextProcessWasClosed):
(WebKit::NetworkProcess::needsServerToContextConnectionForOrigin const):
(WebKit::NetworkProcess::swServerForSession):
(WebKit::NetworkProcess::swOriginStoreForSession):
(WebKit::NetworkProcess::existingSWOriginStoreForSession const):
(WebKit::NetworkProcess::serverToContextConnectionForOrigin):
(WebKit::NetworkProcess::createServerToContextConnection):
(WebKit::NetworkProcess::didFailFetch):
(WebKit::NetworkProcess::didNotHandleFetch):
(WebKit::NetworkProcess::didReceiveFetchResponse):
(WebKit::NetworkProcess::didReceiveFetchData):
(WebKit::NetworkProcess::didReceiveFetchFormData):
(WebKit::NetworkProcess::didFinishFetch):
(WebKit::NetworkProcess::postMessageToServiceWorkerClient):
(WebKit::NetworkProcess::postMessageToServiceWorker):
(WebKit::NetworkProcess::registerSWServerConnection):
(WebKit::NetworkProcess::unregisterSWServerConnection):
(WebKit::NetworkProcess::swContextConnectionMayNoLongerBeNeeded):
(WebKit::NetworkProcess::disableServiceWorkerProcessTerminationDelay):
(WebKit::NetworkProcess::addServiceWorkerSession):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/ServiceWorker/WebSWOriginStore.cpp: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWOriginStore.cpp.
(WebKit::WebSWOriginStore::WebSWOriginStore):
(WebKit::WebSWOriginStore::addToStore):
(WebKit::WebSWOriginStore::removeFromStore):
(WebKit::WebSWOriginStore::clearStore):
(WebKit::WebSWOriginStore::importComplete):
(WebKit::WebSWOriginStore::registerSWServerConnection):
(WebKit::WebSWOriginStore::unregisterSWServerConnection):
(WebKit::WebSWOriginStore::sendStoreHandle):
(WebKit::WebSWOriginStore::didInvalidateSharedMemory):
* NetworkProcess/ServiceWorker/WebSWOriginStore.h: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWOriginStore.h.
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp.
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::~WebSWServerConnection):
(WebKit::WebSWServerConnection::rejectJobInClient):
(WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
(WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
(WebKit::WebSWServerConnection::startScriptFetchInClient):
(WebKit::WebSWServerConnection::updateRegistrationStateInClient):
(WebKit::WebSWServerConnection::fireUpdateFoundEvent):
(WebKit::WebSWServerConnection::setRegistrationLastUpdateTime):
(WebKit::WebSWServerConnection::setRegistrationUpdateViaCache):
(WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
(WebKit::WebSWServerConnection::updateWorkerStateInClient):
(WebKit::WebSWServerConnection::cancelFetch):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didReceiveFetchFormData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::didFailFetch):
(WebKit::WebSWServerConnection::didNotHandleFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
(WebKit::WebSWServerConnection::matchRegistration):
(WebKit::WebSWServerConnection::registrationReady):
(WebKit::WebSWServerConnection::getRegistrations):
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
(WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
(WebKit::WebSWServerConnection::sendToContextProcess):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h.
(WebKit::WebSWServerConnection::ipcConnection const):
(WebKit::WebSWServerConnection::sessionID const):
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp.
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::messageSenderConnection):
(WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
(WebKit::WebSWServerToContextConnection::connectionClosed):
(WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
(WebKit::WebSWServerToContextConnection::fireInstallEvent):
(WebKit::WebSWServerToContextConnection::fireActivateEvent):
(WebKit::WebSWServerToContextConnection::terminateWorker):
(WebKit::WebSWServerToContextConnection::syncTerminateWorker):
(WebKit::WebSWServerToContextConnection::findClientByIdentifierCompleted):
(WebKit::WebSWServerToContextConnection::matchAllCompleted):
(WebKit::WebSWServerToContextConnection::claimCompleted):
(WebKit::WebSWServerToContextConnection::didFinishSkipWaiting):
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
(WebKit::WebSWServerToContextConnection::terminate):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerToContextConnection.h.
(WebKit::WebSWServerToContextConnection::create):
(WebKit::WebSWServerToContextConnection::ipcConnection const):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Renamed from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in.
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
(): Deleted.
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didReceiveMessage):
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::destroySession):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::connectionToContextProcessFromIPCConnection): Deleted.
(WebKit::StorageProcess::connectionToContextProcessWasClosed): Deleted.
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const): Deleted.
(WebKit::StorageProcess::swServerForSession): Deleted.
(WebKit::StorageProcess::swOriginStoreForSession): Deleted.
(WebKit::StorageProcess::existingSWOriginStoreForSession const): Deleted.
(WebKit::StorageProcess::serverToContextConnectionForOrigin): Deleted.
(WebKit::StorageProcess::createServerToContextConnection): Deleted.
(WebKit::StorageProcess::didFailFetch): Deleted.
(WebKit::StorageProcess::didNotHandleFetch): Deleted.
(WebKit::StorageProcess::didReceiveFetchResponse): Deleted.
(WebKit::StorageProcess::didReceiveFetchData): Deleted.
(WebKit::StorageProcess::didReceiveFetchFormData): Deleted.
(WebKit::StorageProcess::didFinishFetch): Deleted.
(WebKit::StorageProcess::postMessageToServiceWorkerClient): Deleted.
(WebKit::StorageProcess::postMessageToServiceWorker): Deleted.
(WebKit::StorageProcess::registerSWServerConnection): Deleted.
(WebKit::StorageProcess::unregisterSWServerConnection): Deleted.
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded): Deleted.
(WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Deleted.
(): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::StorageToWebProcessConnection::unregisterSWConnections): Deleted.
(WebKit::StorageToWebProcessConnection::establishSWServerConnection): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* StorageProcess/ios/StorageProcessIOS.mm:
(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Deleted.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::networkProcessCrashed):
(WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
(WebKit::NetworkProcessProxy::didFinishLaunching):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcessForExplicitSession):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
(WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): Deleted.
(WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::networkProcessCrashed):
(WebKit::WebProcessPool::getNetworkProcessConnection):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
(WebKit::WebProcessPool::postMessageToServiceWorkerClient):
(WebKit::WebProcessPool::postMessageToServiceWorker):
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getNetworkProcessConnection):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didReceiveSyncMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingServiceWorkerConnectionForSession):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::didFinishInstall):
(WebKit::WebSWContextManagerConnection::didFinishActivation):
(WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
(WebKit::WebSWContextManagerConnection::skipWaiting):
(WebKit::WebSWContextManagerConnection::setScriptResource):
(WebKit::WebSWContextManagerConnection::workerTerminated):
(WebKit::WebSWContextManagerConnection::findClientByIdentifier):
(WebKit::WebSWContextManagerConnection::matchAll):
(WebKit::WebSWContextManagerConnection::claim):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didReceiveSyncMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): Deleted.
* WebProcess/WebProcess.h:
(WebKit::WebProcess::existingNetworkProcessConnection):
(WebKit::WebProcess::existingWebToStorageProcessConnection): Deleted.
* WebProcess/WebProcess.messages.in:
2018-09-25 Chris Dumez <cdumez@apple.com>
UIProcess should process incoming sync IPC from WebProcess when waiting for a sync IPC reply from it
https://bugs.webkit.org/show_bug.cgi?id=189927
Reviewed by Alex Christensen.
UIProcess should process incoming sync IPC from WebProcess when waiting for a sync IPC reply from it
in order to avoid deadlocks. This is not an issue currently because the WebProcess does process
incoming sync IPC when waiting for a sync IPC reply. However, we plan to change this in the future
in order to avoid bugs caused by re-entering WebCore at unsafe times.
The reason the UIProcess previously did not do out of order sync IPC process was to avoid processing
a synchronous policy decision IPC for a frameID it did not know about yet, due to the DidCreateMainFrame /
DidCreateSubframe IPC messages being asynchronous. To address this issue, the decidePolicyForNavigationActionSync
IPC handler now calls didCreateMainFrame() / didCreateSubframe() as needed if it does not know about
the frame yet. Note that synchronous policy decisions are rare and are currently only needed by initial
about:blank and fragment navigations.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):
2018-09-25 Chris Dumez <cdumez@apple.com>
Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer
https://bugs.webkit.org/show_bug.cgi?id=189851
<rdar://problem/44696263>
Reviewed by Alex Christensen.
Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer:
- NetworkProcessProxy::m_processPool
- StorageProcessProxy::m_processPool
Those data members are C++ references because it is expected that the WebProcessPool owns the NetworkProcessProxy and
StorageProcessProxy. However, since NetworkProcessProxy / StorageProcessProxy are refcounted, it has happened that code
extends the lifetime of those past their process pool, leading to stale prrocess pool usage. The fix for these crashes
so far as been to ref the WebProcessPool instead of the NetworkProcessProxy / StorageProcessProxy. However, it is very
tempting for people to simply ref the NetworkProcessProxy / StorageProcessProxy given that they are refcounted.
For this reason, this patch updates NetworkProcessProxy / StorageProcessProxy so that they are no longer RefCounted
and so that the WebProcessPool truly owns them via std::unique_ptr<>.
* UIProcess/ChildProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::networkProcessCrashed):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::create): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
(WebKit::NetworkProcessProxy::throttler): Deleted.
(WebKit::NetworkProcessProxy::processPool): Deleted.
* UIProcess/Plugins/PluginProcessProxy.h:
(WebKit::PluginProcessProxy::pluginProcessAttributes const): Deleted.
(WebKit::PluginProcessProxy::pluginProcessToken const): Deleted.
(WebKit::PluginProcessProxy::isValid const): Deleted.
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::create): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
2018-09-25 Alex Christensen <achristensen@webkit.org>
NetworkLoad::didReceiveResponse should pass its completion handler to its client
https://bugs.webkit.org/show_bug.cgi?id=188701
Reviewed by Michael Catanzaro.
Right now we have a confusing enum ShouldContinueDidReceiveResponse and a complicated flow
that involves many objects and implicitly using NetworkLoad's destructor as part of the
loading flow. This makes the responsibilities of the objects clear.
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::didReceiveResponse):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
(WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): Deleted.
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::convertTaskToDownload):
(WebKit::NetworkLoad::didReceiveResponse):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::continueDidReceiveResponse): Deleted.
(WebKit::NetworkLoad::didReceiveResponseNetworkSession): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
(WebKit::NetworkResourceLoader::continueDidReceiveResponse):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveResponse):
(WebKit::PingLoad::didReceiveResponseNetworkSession): Deleted.
* NetworkProcess/PingLoad.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::didReceiveResponse):
* NetworkProcess/PreconnectTask.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/capture/NetworkDataTaskReplay.cpp:
(WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
2018-09-24 Alex Christensen <achristensen@webkit.org>
Build fix.
https://bugs.webkit.org/show_bug.cgi?id=189929
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
2018-09-24 Alex Christensen <achristensen@webkit.org>
Prepare to replace WKBundleFileHandleCreateWithPath with a version that takes a WKBundlePageRef
https://bugs.webkit.org/show_bug.cgi?id=189929
Reviewed by Andy Estes.
This will be needed for rdar://problem/24576194
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp:
(WKBundleFileHandleCreateWithPathForPage):
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
2018-09-24 Alex Christensen <achristensen@webkit.org>
Begin deprecating C API
https://bugs.webkit.org/show_bug.cgi?id=189810
Reviewed by Andy Estes.
* Shared/API/c/WKDeprecated.h: Added.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(setUpPagePolicyClient):
(-[WKBrowsingContextController setPolicyDelegate:]):
* WebKit.xcodeproj/project.pbxproj:
2018-09-24 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236368.
Caused WebKit.NetworkProcessCrashWithPendingConnection API
test to crash (Bug 189926)
Reverted changeset:
"Extending the lifetime of a NetworkProcessProxy /
StorageProcessProxy may cause it to have a stale
WebProcessPool pointer"
https://bugs.webkit.org/show_bug.cgi?id=189851
https://trac.webkit.org/changeset/236368
2018-09-21 Simon Fraser <simon.fraser@apple.com>
Remove the old "AcceleratedCompositingForOverflowScroll" code
https://bugs.webkit.org/show_bug.cgi?id=189870
Reviewed by Zalan Bujtas.
The "AcceleratedCompositingForOverflowScroll" code was added to allow overflow:scroll to use
composited scrolling if an overflow:scroll could be made a stacking context without affecting
z-order. We need overflow:scroll to be accelerated always, so a different approach is needed.
Remove this old code (unused by any platform?) to make working on new code easier.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAcceleratedCompositingForOverflowScrollEnabled): Deleted.
(WKPreferencesGetAcceleratedCompositingForOverflowScrollEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2018-09-24 Chris Dumez <cdumez@apple.com>
Do not do early processing of incoming sync IPC unless we're waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=186941
Reviewed by Alex Christensen.
The comment was claiming we were processing incoming sync messages while waiting for a
sync IPC reply to prevent deadlocks. However, the code was failing to check if we were
waiting for a sync IPC reply. As a result, incoming sync IPC messages would get processed
early no matter what, jumping the line. This was the source of the flakiness in the blob
tests since the IPC to register the blob in the network process was async and the follow-up
IPC to ask the network process for the blob size was sync. The sync message to get the blob
size would jump the line and get processed before the async message to register the blob.
As a result, the network process would not know about the blob yet and return size 0. Of
course, this could happen if the network process was sending sync IPC at the time. However,
the network process never sends any sync IPC and therefore, should never process incoming
IPC messages out of order.
* Platform/IPC/Connection.cpp:
(IPC::Connection::processIncomingMessage):
2018-09-24 Daniel Bates <dabates@apple.com>
[iOS] Key code is 0 for many hardware keyboard keys
https://bugs.webkit.org/show_bug.cgi?id=189604
Reviewed by Wenson Hsieh.
For a hardware keyboard-generated event (an event with a non-nill event._hidEvent) pass
the key code for the event. Otherwise, do what we do now and pass 0 as the event is likely
a software keyboard-generated event.
* Platform/spi/ios/UIKitSPI.h: Add some more SPI.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyEvent:]):
2018-09-24 Brian Burg <bburg@apple.com>
Web Inspector: topContentInset is not accounted for when inspecting a WKWebView and docked to side
https://bugs.webkit.org/show_bug.cgi?id=189859
Reviewed by Joseph Pecoraro.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
Add special cases for inspecting a WKWebView. We already special-case for WKView.
2018-09-24 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Compositing indicators are not working
https://bugs.webkit.org/show_bug.cgi?id=189915
Reviewed by Žan Doberšek.
Pass the debugBorder and repaintCount parameters to the TextureMapperLayer when required.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateSceneState):
2018-09-21 Dean Jackson <dino@apple.com>
Add PointerEvent, plus feature flag, plus Web Platform Tests
https://bugs.webkit.org/show_bug.cgi?id=189867
<rdar://problem/44697384>
Reviewed by Simon Fraser.
Add PointerEvents as an experimental feature.
* Shared/WebPreferences.yaml:
2018-09-21 Brian Burg <bburg@apple.com>
Web Inspector: dock buttons disappear if Web Inspector goes fullscreen
https://bugs.webkit.org/show_bug.cgi?id=189865
<rdar://problem/42600534>
Reviewed by Matt Baker.
When a fullscreen Safari tab has a docked Inspector, and the "detach" button
is clicked, Inspector goes into its own fullscreen window. In that window,
there are no buttons for docking to side or bottom.
It turns out that we always send setDockingUnavailable(true) if the inspector
window is fullscreen. This eventually causes the inspector to reflect that
by hiding the docking-related buttons.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCanAttach):
This early exit does not seem to serve any purpose, so remove it.
2018-09-21 Chris Dumez <cdumez@apple.com>
Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer
https://bugs.webkit.org/show_bug.cgi?id=189851
Reviewed by Alex Christensen.
Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer:
- NetworkProcessProxy::m_processPool
- StorageProcessProxy::m_processPool
Those data members are C++ references because it is expected that the WebProcessPool owns the NetworkProcessProxy and
StorageProcessProxy. However, since NetworkProcessProxy / StorageProcessProxy are refcounted, it has happened that code
extends the lifetime of those past their process pool, leading to stale prrocess pool usage. The fix for these crashes
so far as been to ref the WebProcessPool instead of the NetworkProcessProxy / StorageProcessProxy. However, given how
error-prone this is, this patch updates NetworkProcessProxy / StorageProcessProxy so that they forward their refcounting
to the WebProcessPool.
* UIProcess/ChildProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::ref):
(WebKit::NetworkProcessProxy::deref):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::create): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::ref):
(WebKit::StorageProcessProxy::deref):
(WebKit::StorageProcessProxy::create): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
2018-09-21 Alex Christensen <achristensen@webkit.org>
Use a Variant for FormDataElement
https://bugs.webkit.org/show_bug.cgi?id=189777
Reviewed by Chris Dumez.
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* NetworkProcess/NetworkResourceLoader.cpp:
* Shared/SessionState.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toHTTPBody):
2018-09-21 Alex Christensen <achristensen@webkit.org>
Simply authentication code even more!
https://bugs.webkit.org/show_bug.cgi?id=189719
Reviewed by Andy Estes.
Just when you thought it couldn't get simpler and more elegant, it can!
* NetworkProcess/Downloads/Download.cpp:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
* NetworkProcess/NetworkLoad.cpp:
* NetworkProcess/PingLoad.cpp:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* Shared/Authentication/AuthenticationChallengeDisposition.h: Added.
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::completeAuthenticationChallenge):
(WebKit::AuthenticationManager::useCredentialForChallenge): Deleted.
(WebKit::AuthenticationManager::useCredentialForSingleChallenge): Deleted.
(WebKit::AuthenticationManager::continueWithoutCredentialForChallenge): Deleted.
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): Deleted.
(WebKit::AuthenticationManager::cancelChallenge): Deleted.
(WebKit::AuthenticationManager::cancelSingleChallenge): Deleted.
(WebKit::AuthenticationManager::performDefaultHandling): Deleted.
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): Deleted.
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): Deleted.
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): Deleted.
* Shared/Authentication/AuthenticationManager.h:
* Shared/Authentication/AuthenticationManager.messages.in:
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection):
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
(WKAuthenticationDecisionListenerUseCredential):
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
* UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
(webkit_authentication_request_authenticate):
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
* UIProcess/Authentication/AuthenticationDecisionListener.cpp:
(WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::useCredential):
(WebKit::AuthenticationDecisionListener::cancel):
(WebKit::AuthenticationDecisionListener::performDefaultHandling):
(WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
* UIProcess/Authentication/AuthenticationDecisionListener.h:
(WebKit::AuthenticationDecisionListener::create):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* WebKit.xcodeproj/project.pbxproj:
2018-09-21 Chris Dumez <cdumez@apple.com>
Regression(Mojave): Resuming a WK2 download crashes
https://bugs.webkit.org/show_bug.cgi?id=189838
<rdar://problem/44618538>
Reviewed by Alex Christensen.
Update our workaround to tweak the download resume data to include the actual download path so that
it works on macOS Mojave and up. Unfortunately, the resume data internal representation has changed,
causing our previous workaround to fail.
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
2018-09-21 Youenn Fablet <youenn@apple.com>
Whitelist two additional plugins
https://bugs.webkit.org/show_bug.cgi?id=189832
<rdar://problem/44628127>
Reviewed by Brent Fulgham.
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
2018-09-21 Woodrow Wang <woodrow_wang@apple.com>
Clear persistent storage between tests for resourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=189684
<rdar://problem/44540099>
Reviewed by Chris Dumez.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
Remove function only called in testing for resetting statistics to consistent
state.
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
2018-09-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236289.
Caused 8 TestWebKitAPI.ContentFiltering test failures.
Reverted changeset:
"InjectedBundle parameters often need initialization function
called before unarchiving"
https://bugs.webkit.org/show_bug.cgi?id=189709
https://trac.webkit.org/changeset/236289
2018-09-20 Youenn Fablet <youenn@apple.com>
Allow additional plug-ins to run unsandboxed
https://bugs.webkit.org/show_bug.cgi?id=189791
<rdar://problem/44628127>
Reviewed by Brent Fulgham.
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
2018-09-20 Brent Fulgham <bfulgham@apple.com>
InjectedBundle parameters often need initialization function called before unarchiving
https://bugs.webkit.org/show_bug.cgi?id=189709
<rdar://problem/44573653>
Reviewed by Chris Dumez.
Handle the case where the InjectedBundle parameters do not successfully decode because they contain
an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
after the bundle initialiation function runs, which gives the embedding program the opportunity to
register additional classes that are safe for serialization.
Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
This new method returns 'true' if the serialization was successful, otherwise it returns false.
Revise 'initialize' to call this new method and check the return value. If it fails, try decoding the
bundle parameters after the bundle's initialization function is called.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Use the new method.
(WebKit::InjectedBundle::decodeBundleParameters): Added.
(WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
'classesForCoder' method to unarchive the passed bundle parameters, rather than the
NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
NSDictionary object may itself hold other kinds of objects.
2018-09-20 Jer Noble <jer.noble@apple.com>
Enable Modern EME by default
https://bugs.webkit.org/show_bug.cgi?id=189794
Reviewed by Jon Lee.
* Shared/WebPreferences.yaml:
2018-09-20 Thibault Saunier <tsaunier@igalia.com>
[GTK][WPE] Make sure MediaDeviceEnabled and PeerConnectionEnabled are always synced with enable-media-stream
https://bugs.webkit.org/show_bug.cgi?id=188704
By default m_isMediaDevicesEnabled and m_isScreenCaptureEnabled are false but
m_isMediaStreamEnabled is true meaning that in the WPE minibrowser getUserMedia
was disabled even if we explicitly set `"enable-media-stream", TRUE`.
Reviewed by Michael Catanzaro.
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
2018-09-20 Justin Michaud <justin_michaud@apple.com>
Implement CSS Custom Properties and Values Skeleton
https://bugs.webkit.org/show_bug.cgi?id=189694
Reviewed by Simon Fraser.
Add feature flag for CSS custom properties and values api
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2018-09-19 Dean Jackson <dino@apple.com>
Temporarily move fullscreen back to experimental features
https://bugs.webkit.org/show_bug.cgi?id=189770
<rdar://problem/44619282>
Revert this change now that there is a commit to cherry-pick.
* Shared/WebPreferences.yaml:
2018-09-20 Chris Dumez <cdumez@apple.com>
Unreviewed crash fix after r236226.
We need to protect |this| in WebProcessProxy::requestTermination().
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
2018-09-20 Antti Koivisto <antti@apple.com>
REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=189663
<rdar://problem/44184955>
Reviewed by Geoff Garen and Chris Dumez.
We need to keep the layer tree of the previous page alive and visible until we have something
to render on the new page. With PSON on Mac this means that we should keep displaying the
layer tree from the previus process.
This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
the layer tree is not deleted too early on process swap and that it still eventually gets deleted.
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::attachInWebProcess):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::messageNamesToIgnoreWhileSuspended):
(WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
message for it.
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCompletePageTransition):
Attach the drawing area if appropriate.
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Call PageClien::processWillSwap instead of processDidExit when appropriate.
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
This is called when we have switched to the new layer tree.
Tear down the drawing area in the previus process.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::processWillSwap):
On iOS this just call processDidExit for now.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::processWillSwap):
(WebKit::PageClientImpl::processDidExit):
Add processWillSwap separately from processDidExit. They are currently the same
except processWillSwap doesn't clear the root layer.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):
Send a message to the web process to attach the drawing area.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach):
(WebKit::DrawingArea::attachDrawingArea): Deleted.
Rename to be less redundant.
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
Don't attach drawing area automatically. It will be done by a message from UI process.
(WebKit::WebPage::setLayerTreeStateIsFrozen):
Layer tree is always frozen in a suspended process (if it exists).
(WebKit::WebPage::didReceivePolicyDecision):
Suspend immediately when receiving policy decision to avoid flash on 'about:blank' loading.
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):
Notify UI process of transition completion.
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::tearDownDrawingAreaForSuspend):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Don't attach drawing area automatically. It will be done by a message from UI process.
(WebKit::TiledCoreAnimationDrawingArea::attach):
(WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.
2018-09-20 Tomas Popela <tpopela@redhat.com>
[GTK] Always prints in portrait when landscape is requested
https://bugs.webkit.org/show_bug.cgi?id=189543
Reviewed by Michael Catanzaro.
We have to change the surface size based on the requested orientation.
Otherwise only portrait will be printed as it's hardcoded.
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2018-09-19 Dean Jackson <dino@grorg.org>
Temporarily move fullscreen back to experimental features
https://bugs.webkit.org/show_bug.cgi?id=189770
<rdar://problem/44619282>
Reviewed by Simon Fraser.
Make fullscreen an experimental feature again.
* Shared/WebPreferences.yaml:
2018-09-19 Dawei Fenton <realdawei@apple.com>
Unreviewed, rolling out r236229.
caused API timouts on mac and ios
Reverted changeset:
"Clear persistent storage between tests for
resourceLoadStatistics"
https://bugs.webkit.org/show_bug.cgi?id=189684
https://trac.webkit.org/changeset/236229
2018-09-19 Alex Christensen <achristensen@webkit.org>
REGRESSION(236154) C API clients not using WKPageSetPageNavigationClient couldn't complete HTTPS requests
https://bugs.webkit.org/show_bug.cgi?id=189771
Reviewed by Tim Horton.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didReceiveAuthenticationChallenge):
Perform default behavior if there's an authentication challenge but we're using the default navigation client.
I wish we had infrastructure to test this but WebKitTestRunner uses WKPageSetNavigationClient
and we don't have the ability to do networking from API tests. This is a growing problem I intend to solve.
2018-09-19 Woodrow Wang <woodrow_wang@apple.com>
Clear persistent storage between tests for resourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=189684
<rdar://problem/44540099>
Reviewed by Chris Dumez.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
Remove function only called in testing for resetting statistics to consistent
state.
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted.
2018-09-19 Chris Dumez <cdumez@apple.com>
Crash under WebPageProxy::decidePolicyForNavigationAction()
https://bugs.webkit.org/show_bug.cgi?id=189763
<rdar://problem/44597111>
Reviewed by Alex Christensen.
Update WebNavigationState::navigation() / WebNavigationState::takeNavigation()
to return a pointer instead of a reference as we have evidence that they can
return null. I kept the debug assertions to try and catch the cases where we
return null but at least we stop crashing in release builds.
* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::navigation):
(WebKit::WebNavigationState::takeNavigation):
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
2018-09-19 Chris Dumez <cdumez@apple.com>
Crash under WebProcessProxy::suspendedPageWasDestroyed(WebKit::SuspendedPageProxy&)
https://bugs.webkit.org/show_bug.cgi?id=189721
<rdar://problem/44359788>
Reviewed by Geoffrey Garen.
Fix crash when destroying a SuspendedPageProxy whose WebProcessProxy was already
destroyed.
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::process const):
Update SuspendedPageProxy::m_process to be a RefPtr<> instead of a raw pointer, similarly
to what we do in WebPageProxy. Relying on the WebProcessProxy to not get destroyed is
risky as this crash demonstrates.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
When a WebProcessProxy is terminated (by client or WebKit due to memory / cpu usage), call
webProcessDidClose() on all SuspendedPages, similarly to what we do in case of a crash in
processDidTerminateOrFailedToLaunch(). Failing to do so means that the SuspendedPageProxy
may still have a pointer to this WebProcessProxy, even though WebProcessProxy::shutDown()
has been called (which may destroy the WebProcessProxy).
2018-09-19 John Wilander <wilander@apple.com>
Resource Load Statistics: Add optional cap on partitioned cache max age
https://bugs.webkit.org/show_bug.cgi?id=189711
<rdar://problem/39246837>
Reviewed by Antti Koivisto and Chris Dumez.
These changes add the capability to set a max age cap for prevalent resources
and consults it when retrieving cache entries. If an entry is capped and found
to be too old, it will not be used but instead removed from the cache.
This functionality is off by default because no cap is set by default.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
Infrastructure for testing.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
Now sends in the session ID in the retrieve call.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap):
Static convenience function.
(WebKit::NetworkCache::makeUseDecision):
Now receives an optional maxAge parameter and checks
hasReachedPrevalentResourceAgeCap() first.
(WebKit::NetworkCache::Cache::retrieve):
Now takes a session ID.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
Added UseDecision::NoDueToPrevalentResourceAgeCap which causes a
return of WebCore::DiagnosticLoggingKeys::otherKey().
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
Infrastructure for testing.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
Now supports a user default ResourceLoadStatisticsCacheMaxAgeCap.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
(WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources):
(WebKit::nextRequestStorageAccessContextId): Deleted.
Deleted this to make all code use the generic generateCallbackID().
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
Used to transfer the setting from the UI process to the network process.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
* UIProcess/WebsiteData/WebsiteDataStore.h:
2018-09-18 Brent Fulgham <bfulgham@apple.com>
[iOS] Allow WebContent process to check the "Protocol Characteristics" of files to which it has access
https://bugs.webkit.org/show_bug.cgi?id=189712
<rdar://problem/44386429>
Reviewed by Alex Christensen.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2018-09-18 Chris Dumez <cdumez@apple.com>
[iOS] Crash under WebPageProxy::navigationGestureSnapshotWasRemoved()
https://bugs.webkit.org/show_bug.cgi?id=189714
<rdar://problem/32839498>
Reviewed by Tim Horton.
The ViewGestureController::removeSwipeSnapshot() implementation for iOS calls
navigationGestureSnapshotWasRemoved() on m_webPageProxyForBackForwardListForCurrentSwipe.
m_webPageProxyForBackForwardListForCurrentSwipe can differ from m_webPageProxy, and
is a RefPtr<>. This means that this WebPageProxy's WKWebView might have been deallocated,
in which case we'll crash when trying to use the pageClient in
WebPageProxy::navigationGestureSnapshotWasRemoved(). To address the issue, we now return
early in WebPageProxy::navigationGestureSnapshotWasRemoved() if m_isClosed is true,
after resetting m_isShowingNavigationGestureSnapshot to false but *before* trying to use
the pageClient. When a WKWebView is deallocated, it calls WebPageProxy::close(), which
sets m_isClosed to true.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
2018-09-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Limit capturing extra metrics for Web Inspector when not required.
https://bugs.webkit.org/show_bug.cgi?id=189520
Reviewed by Alex Christensen.
Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
time when they are not needed.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::createCurlRequest):
2018-09-18 Alex Christensen <achristensen@webkit.org>
Make WebPageProxy always have a API::NavigationClient instead of always having a API::LoaderClient and API::PolicyClient
https://bugs.webkit.org/show_bug.cgi?id=189012
Reviewed by Andy Estes.
When WebKit2 was being developed, we initially made the C API WKPageSetPagePolicyClient and WKPageSetPageLoaderClient.
When we released WKWebView, it was using WKNavigationDelegate, equivalent to WKPageSetPageNavigationClient.
To support one or the other, we would use the navigation client if it was present, but if not we would fall back to the
loader or policy client. Since the loader and policy clients are now being minimally supported only until legacy
software migrates to the navigation client, we are adding new functionality to the navigation client.
Making the navigation client the default and using the loader or policy client only if they are present supports
the legacy software and makes us have fewer forgotten null checks when adding new functionality to the navigation client.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setNavigationClient):
(WebKit::WebPageProxy::setLoaderClient):
(WebKit::WebPageProxy::setPolicyClient):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didChangeBackForwardList):
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReachLayoutMilestone):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::contentRuleListNotification):
(WebKit::WebPageProxy::webGLPolicyForURL):
(WebKit::WebPageProxy::resolveWebGLPolicyForURL):
(WebKit::WebPageProxy::processDidBecomeUnresponsive):
(WebKit::WebPageProxy::processDidBecomeResponsive):
(WebKit::WebPageProxy::dispatchProcessDidTerminate):
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
(WebKit::WebPageProxy::navigationGestureDidBegin):
(WebKit::WebPageProxy::navigationGestureWillEnd):
(WebKit::WebPageProxy::navigationGestureDidEnd):
(WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
* UIProcess/WebPageProxy.h:
2018-09-18 Alex Christensen <achristensen@webkit.org>
Clean up AuthenticationChallengeProxy
https://bugs.webkit.org/show_bug.cgi?id=189668
Reviewed by Youenn Fablet.
At its core, it's a CompletionHandler with some information.
Make it more elegant and simple with no change in behavior and reduce the complexity of this security-sensitive object.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionAuthChallengeDisposition):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/C/WKAuthenticationChallenge.cpp:
(WKAuthenticationChallengeGetDecisionListener):
(WKAuthenticationChallengeGetProtectionSpace):
(WKAuthenticationChallengeGetProposedCredential):
(WKAuthenticationChallengeGetPreviousFailureCount):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
(WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): Deleted.
(WebKit::AuthenticationChallengeProxy::useCredential): Deleted.
(WebKit::AuthenticationChallengeProxy::cancel): Deleted.
(WebKit::AuthenticationChallengeProxy::performDefaultHandling): Deleted.
(WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Deleted.
(WebKit::AuthenticationChallengeProxy::proposedCredential const): Deleted.
(WebKit::AuthenticationChallengeProxy::protectionSpace const): Deleted.
(WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore): Deleted.
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
(WebKit::AuthenticationChallengeProxy::create):
(WebKit::AuthenticationChallengeProxy::listener const):
(WebKit::AuthenticationChallengeProxy::previousFailureCount const): Deleted.
* UIProcess/Authentication/AuthenticationDecisionListener.cpp:
(WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::useCredential):
(WebKit::AuthenticationDecisionListener::cancel):
(WebKit::AuthenticationDecisionListener::performDefaultHandling):
(WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
(WebKit::AuthenticationDecisionListener::detachChallenge): Deleted.
* UIProcess/Authentication/AuthenticationDecisionListener.h:
(WebKit::AuthenticationDecisionListener::create):
* UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const): Deleted.
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::secKeyProxyStore):
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
* UIProcess/WebPageProxy.h:
2018-09-18 Ben Richards <benton_richards@apple.com>
Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
https://bugs.webkit.org/show_bug.cgi?id=188601
Reviewed by Dan Bernstein.
Added a script to the process entitlements build phase of the WebContent service that copies resource
files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
be used by clients who would like to make a custom WebContent service.
* Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/API/Cocoa/WKWebProcess.h: Drive-by fix to make this header compileable alone.
2018-09-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236138.
Caused API test and layout test failures on iOS.
Reverted changeset:
"REGRESSION (PSON): White or Black flash occurs when process
swapping on navigation on Mac"
https://bugs.webkit.org/show_bug.cgi?id=189663
https://trac.webkit.org/changeset/236138
2018-09-18 Eric Carlson <eric.carlson@apple.com>
Always log when granting/revoking capture sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=189701
<rdar://problem/44564029>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
(WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.
2018-09-18 Youenn Fablet <youenn@apple.com>
Enable Unified Plan by default
https://bugs.webkit.org/show_bug.cgi?id=189675
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2018-09-18 Antti Koivisto <antti@apple.com>
REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=189663
<rdar://problem/44184955>
Reviewed by Geoff Garen.
We need to keep the layer tree of the previous page alive and visible until we have something
to render on the new page. With PSON on Mac this means that we should keep displaying the
layer tree from the previus process.
This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
the layer tree is not deleted too early on process swap and that it still eventually gets deleted.
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::attachInWebProcess):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::messageNamesToIgnoreWhileSuspended):
(WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
message for it.
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
Only call didRelaunchProcess when process actually relaunched (not navigation process launch) to
match not calling processDidExit in resetStateAfterProcessExited.
(WebKit::WebPageProxy::didCompletePageTransition):
Attach the drawing area if appropriate.
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
Send suspend message to WebPage immediately instead waiting for the runloop callback. This is needed so we
can avoid flashing the initial empty document load when the new Page object is created.
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Don't call processDidExit when suspending, not exiting the process (this function needs a new name or rafactoring).
This avoids clearing the drawing area and flashing to black.
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
This is called when we have switched to the new layer tree.
Tear down the drawing area in the previus process.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):
Send a message to the web process to attach the drawing area.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach):
(WebKit::DrawingArea::attachDrawingArea): Deleted.
Rename to be less redundant.
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
Don't attach drawing area automatically. It will be done by a message from UI process.
(WebKit::WebPage::setLayerTreeStateIsFrozen):
Layer tree is always frozen in a suspended process (if it exists).
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):
Notify UI process of transition completion.
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::tearDownDrawingAreaForSuspend):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Don't attach drawing area automatically. It will be done by a message from UI process.
(WebKit::TiledCoreAnimationDrawingArea::attach):
(WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.
2018-09-18 Claudio Saavedra <csaavedra@igalia.com>
[WPE] Implement mouse event modifiers
https://bugs.webkit.org/show_bug.cgi?id=189697
Reviewed by Carlos Garcia Campos.
Only "CapsLocks" is missing, as WPE doesn't support that modifier.
* Shared/wpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::modifiersForEvent): Deleted.
2018-09-17 Zan Dobersek <zdobersek@igalia.com>
Unreviewed build fix after r236101.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
Correct a BinarySemaphore::wait() call which now accepts no arguments.
2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=185339
Reviewed by Mark Lam.
* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::wait):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
Use BinarySemaphore.
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::applicationWillTerminate):
* UIProcess/ios/WKActionSheetAssistant.mm:
(appLinkForURL):
Use BinarySemaphore to wait for async completion handler. We also fix memory leak
since the old code does not call dispatch_release for the used semaphore.
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Many modern media control tests leak documents in testing
https://bugs.webkit.org/show_bug.cgi?id=189437
Reviewed by Darin Adler.
In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
to run again after that timer has fired.
This should fix most of the spurious leak reports involving SVGImage documents.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCallAfterTasksAndTimers):
(WKBundlePagePostTask): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2018-09-17 Dan Bernstein <mitz@apple.com>
Try to fix Apple internal builds with the iOS 12.0 SDK.
* Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 12.0.
2018-09-17 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236092 because it breaks internal builds. Also, remove stray '+' character from ChangeLog file.
* Scripts/copy-webcontent-resources-to-private-headers.sh: Removed.
* WebKit.xcodeproj/project.pbxproj:
2018-08-17 Ben Richards <benton_richards@apple.com>
Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
https://bugs.webkit.org/show_bug.cgi?id=188601
Reviewed by Dan Bernstein.
Added a script to the process entitlements build phase of the WebContent service that copies resource
files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
be used by clients who would like to make a custom WebContent service.
* Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Add more Fullscreen logging
https://bugs.webkit.org/show_bug.cgi?id=189656
Reviewed by Jer Noble.
Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
the fullscreen element.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::WebFullScreenManager):
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):
(WebKit::WebFullScreenManager::setPIPStandbyElement):
(WebKit::WebFullScreenManager::enterFullScreenForElement):
(WebKit::WebFullScreenManager::exitFullScreenForElement):
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
(WebKit::WebFullScreenManager::didExitFullScreen):
(WebKit::WebFullScreenManager::close):
* WebProcess/FullScreen/WebFullScreenManager.h:
2018-09-17 Tim Horton <timothy_horton@apple.com>
Swipe snapshot can get stuck if swiping is disabled while it is visible
https://bugs.webkit.org/show_bug.cgi?id=189667
<rdar://problem/40367780>
Reviewed by Simon Fraser.
If navigation gestures are disabled while a swipe snapshot is visible,
WKWebView will tear down the ViewGestureController, which means that
the SnapshotRemovalTracker will no longer be around to ever remove
the snapshot.
It's currently very hard to write a test for this because we have
yet to come up with a good mechanism for testing swiping on iOS.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
Instead of tearing down the ViewGestureController when navigation
gestures are disabled, just set a bit on it that disables gestures.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::canSwipeInDirection const):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::setSwipeGestureEnabled):
(WebKit::ViewGestureController::isSwipeGestureEnabled):
Add a bit to ViewGestureController that makes starting new gestures
always fail, but allows e.g. snapshots from existing swipes to continue
their usual behavior.
2018-09-17 Alex Christensen <achristensen@webkit.org>
Expose WKWebProcess.h as a private header
https://bugs.webkit.org/show_bug.cgi?id=189636
* WebKit.xcodeproj/project.pbxproj:
2018-09-17 Alex Christensen <achristensen@webkit.org>
Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
https://bugs.webkit.org/show_bug.cgi?id=189636
Reviewed by Dan Bernstein.
Fix a few build failures along the way.
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::windowAndViewFramesChanged):
(WebKit::PluginControllerProxy::updateLayerHostingContext):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
(WebKit::PluginProcess::platformInitializeProcess):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
(main):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(+[WKProcessPool _webContentProcessXPCMain]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/API: Added.
* WebProcess/API/Cocoa: Added.
* WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
(WKWebProcessMain):
* WebProcess/API/Cocoa/WKWebProcess.h: Added.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2018-09-17 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Respond with requested authentication scheme for authentication challenge.
https://bugs.webkit.org/show_bug.cgi?id=189318
Reviewed by Alex Christensen.
Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
mode, the round-trip communication between the client and the server is handled by libcurl
internally. That's okay for many cases. But when initial request has a credentials
(i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
the returned response is not 401.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2018-09-17 Woodrow Wang <woodrow_wang@apple.com>
Clear pending resource load statistics' writes after tests
https://bugs.webkit.org/show_bug.cgi?id=189632
<rdar://problem/44469275>
Reviewed by Chris Dumez.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
2018-09-17 Chris Dumez <cdumez@apple.com>
PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
https://bugs.webkit.org/show_bug.cgi?id=189602
<rdar://problem/44430549>
Reviewed by Geoff Garen.
The following fixes were made to our process swap on navigation logic:
- Browsing contexts opened via window.open() with 'noopener' option now only same if
they are cross-site, instead of doing a stricter cross-origin check.
- Support process swapping when opening a new window via <a target="_blank" rel="noopener">
that is cross-site.
In order to support this, the following changes were made:
- Stop passing a 'isCrossOriginWindowOpenNavigation' flag to the UIProcess when navigating because:
- This is specific to window.open() and does not apply to other windows opened by DOM
- This forces the origin check to happens on WebContent process side instead of relying on the
one in WebProcessPool in the UIProcess
- Pass the origin of the requester to the UIProcess when navigating, so that the WebProcessPool
can use the requester's host for the cross-site check for the initial navigation in a new window
created by DOM.
- Add 2 flags to WebPageProxy which indicate if the page was created by the DOM and if any provisional
loads have been committed. The WebProcessPool uses theses flags to recognize initial loads in
new windows created by the DOM, so that it uses the requester's origin for the cross-site check.
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::setRequesterOrigin):
(API::Navigation::requesterOrigin const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setOpenedByDOM):
(WebKit::WebPageProxy::openedByDOM const):
(WebKit::WebPageProxy::hasCommittedAnyProvisionalLoads const):
* UIProcess/WebProcessPool.cpp:
(WebKit::shouldUseSameProcessBasedOnURLs):
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2018-09-17 Alexey Proskuryakov <ap@apple.com>
Revert https://trac.webkit.org/r235910, because the new test times out.
Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
https://bugs.webkit.org/show_bug.cgi?id=188008
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
2018-09-17 Alex Christensen <achristensen@webkit.org>
Refactoring related to Safe Browsing
https://bugs.webkit.org/show_bug.cgi?id=189631
Reviewed by Tim Horton.
Make SafeBrowsingResult RefCounted.
Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
(WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
(WebKit::WebPageProxy::startDrag): Deleted.
(WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
(WebKit::WebPageProxy::setDragCaretRect): Deleted.
(WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
(WebKit::WebPageProxy::platformCloneAttachment): Deleted.
* UIProcess/SafeBrowsingResult.h:
(WebKit::SafeBrowsingResult::create):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
2018-09-17 Darin Adler <darin@apple.com>
Use OpaqueJSString rather than JSRetainPtr inside WebKit
https://bugs.webkit.org/show_bug.cgi?id=189652
Reviewed by Saam Barati.
* Shared/API/c/WKString.cpp: Removed unneeded include of JSStringRef.h.
* WebProcess/Automation/WebAutomationSessionProxy.cpp: Removed unneeded
include of JSRetainPtr.
(WebKit::toJSString): Deleted.
(WebKit::toJSValue): Use OpaqueJSString::create.
(WebKit::callPropertyFunction): Ditto.
(WebKit::evaluate): Use adoptRef.
(WebKit::evaluateJavaScriptCallback): Ditto.
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
Use OpaqueJSString::create.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use
String rather than JSStringRef.
* WebProcess/Plugins/PDF/PDFPlugin.mm: Removed unneeded includes.
(WebKit::PDFPlugin::runScriptsInPDFDocument): Use OpaqueJSString::create.
2018-09-17 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix incorrect WPE build fix made in r236009
This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
type is not actually used anywhere in this header. Actually, the problematic function is no
longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
so remove it.
* UIProcess/API/wpe/WebKitScriptDialog.h:
* UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
(webkitScriptDialogRun): Deleted.
2018-09-17 Sihui Liu <sihui_liu@apple.com>
Move IndexedDB to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189415
<rdar://problem/44396973>
Reviewed by Chris Dumez.
We are going to eliminate storage process and move its functionality to network process.
The reasons why we want to do this:
1. Lower resource usage of having an additional process for storage operations, especially
memory. Single storage process takes about 5MB memory on macOS.
2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
regression in app launch. The launch time of storage process is partly attributed to this:
Service Workers delay page loading until receiving response from storage process.
3. We choose network process because UI process may have broader access in file system
that we don't want the storage operations to have.
This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
to corresponding components of network process. Moving of Service Worker and stopping to
launch storage process will be done in following patches.
We expect to see the higher cpu and memory usage of network process as it is taking more work,
but the overall gain in memory and latency after we completely remove storage process should be
positive.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::didCloseFromServer):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
Code moved from StorageToWebProcessConnection::didReceiveMessage.
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
Network process receives and stores sandbox extension of temporary files for later indexedDB
use.
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::ensurePathExists):
(WebKit::NetworkProcess::postStorageTask):
(WebKit::NetworkProcess::performNextStorageTask):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
Instead of asking UI process to grant sandbox extension to storage process, now network
process just asks for sandbox extension fot itself.
(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::idbServer): Deleted.
(WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
(WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
(WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
(WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
(WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::queue): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::generateIDBConnectionToServerIdentifier): Deleted.
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
(WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
2018-09-08 Darin Adler <darin@apple.com>
Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=189455
Reviewed by Keith Miller.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSString): Use adopt function instead of adopt construuctor.
(WebKit::evaluate): Ditto.
(WebKit::evaluateJavaScriptCallback): Ditto.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.
2018-09-14 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236020.
This caused an api failure on High Sierra
Reverted changeset:
"Refactoring related to Safe Browsing"
https://bugs.webkit.org/show_bug.cgi?id=189631
https://trac.webkit.org/changeset/236020
2018-09-14 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
https://bugs.webkit.org/show_bug.cgi?id=189530
Reviewed by Alex Christensen.
Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2018-09-14 Alex Christensen <achristensen@webkit.org>
Refactoring related to Safe Browsing
https://bugs.webkit.org/show_bug.cgi?id=189631
Reviewed by Tim Horton.
Make SafeBrowsingResult RefCounted.
Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
(WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
(WebKit::WebPageProxy::startDrag): Deleted.
(WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
(WebKit::WebPageProxy::setDragCaretRect): Deleted.
(WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
(WebKit::WebPageProxy::platformCloneAttachment): Deleted.
* UIProcess/SafeBrowsingResult.h:
(WebKit::SafeBrowsingResult::create):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
2018-09-14 Geoffrey Garen <ggaren@apple.com>
Clarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
https://bugs.webkit.org/show_bug.cgi?id=189634
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKUIDelegate.h:
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
Added some helper functions to null out a RefPtr<GraphicsLayer> after removing from the tree,
clearing the client. GraphicsLayer.m_client becomes a pointer, so it can be set to point to a singleton
empty client when a GraphicsLayer gets detached from its owner. More explicit layer unparenting,
and removed some unnecessary parent checks, and redundant unparenting.
Other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):
(WebKit::WebInspectorClient::showPaintRect):
(WebKit::WebInspectorClient::animationEndedForLayer):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::createGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2018-09-14 Eric Carlson <eric.carlson@apple.com>
Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=178109
<rdar://problem/35083128>
Reviewed by Youenn Fablet.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
2018-09-14 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl][WebKit] Bug fix for continuously retrying with empty credentials.
https://bugs.webkit.org/show_bug.cgi?id=189601
Reviewed by Alex Christensen.
Added stop condition for empty credentials passed by client.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
2018-09-14 Jer Noble <jer.noble@apple.com>
Turn SourceBufferChangeTypeEnabled on by default
https://bugs.webkit.org/show_bug.cgi?id=189527
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2018-09-14 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, speculative WPE build fix after r236004
https://bugs.webkit.org/show_bug.cgi?id=189545
* UIProcess/API/wpe/WebKitScriptDialog.h:
2018-09-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Make script dialogs modal to the current web view only
https://bugs.webkit.org/show_bug.cgi?id=189545
Reviewed by Michael Catanzaro.
Change the default implementation of script dialogs to use an embedded window, like the HTTP auth dialog,
instead of a GtkMessageDialog. This patch adds a base class WebKitWebViewDialog shared by
WebKitAuthenticationDialog and the new WebKitScriptDialogImpl.
* SourcesGTK.txt: Add new files to compilation.
* UIProcess/API/glib/WebKitScriptDialogPrivate.h:
* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
(webkitAuthenticationDialogInitialize): Do not use a frame and use a better styled title.
(webkit_authentication_dialog_class_init): Remove implementation of vfuncs that are now implemented by the
parent.
* UIProcess/API/gtk/WebKitAuthenticationDialog.h:
* UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
(webkitScriptDialogAccept): Use WebKitScriptDialogImpl API.
(webkitScriptDialogDismiss): Ditto.
(webkitScriptDialogSetUserInput): Ditto.
* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: Added.
(webkitScriptDialogImplClose):
(webkitScriptDialogImplKeyPressEvent):
(webkitScriptDialogImplMap):
(webkitScriptDialogImplConstructed):
(webkitScriptDialogImplDispose):
(webkit_script_dialog_impl_class_init):
(webkitScriptDialogImplAddButton):
(webkitScriptDialogImplNew):
(webkitScriptDialogImplCancel):
(webkitScriptDialogImplConfirm):
(webkitScriptDialogImplSetEntryText):
* UIProcess/API/gtk/WebKitScriptDialogImpl.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewChildIsInternalWidget): Rename authenticationDialog as just dialog.
(webkitWebViewBaseAddDialog): Ditto.
(webkitWebViewBaseContainerRemove): Ditto.
(webkitWebViewBaseContainerForall): Ditto.
(webkitWebViewBaseConstructed): Ditto.
(webkitWebViewBaseSizeAllocate): Ditto.
(webkitWebViewBaseKeyPressEvent): Ditto.
(webkitWebViewBaseHandleMouseEvent): Ditto.
(webkitWebViewBaseButtonPressEvent): Ditto.
(webkitWebViewBaseButtonReleaseEvent): Ditto.
(webkitWebViewBaseHandleWheelEvent): Ditto.
(webkitWebViewBaseScrollEvent): Ditto.
(webkitWebViewBaseMotionNotifyEvent): Ditto.
(webkitWebViewBaseCrossingNotifyEvent): Ditto.
(webkitWebViewBaseTouchEvent): Ditto.
(webkitWebViewBaseFocus): Ditto.
(webkitWebViewBaseDestroy): Ditto.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewDialog.cpp: Added.
(webkitWebViewDialogDraw):
(webkitWebViewDialogSizeAllocate):
(webkitWebViewDialogConstructed):
(webkit_web_view_dialog_class_init):
* UIProcess/API/gtk/WebKitWebViewDialog.h: Added.
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewAuthenticate):
(webkitWebViewScriptDialog):
2018-09-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235954.
Breaks the watchOS build.
Reverted changeset:
"Move IndexedDB to Network Process"
https://bugs.webkit.org/show_bug.cgi?id=189415
https://trac.webkit.org/changeset/235954
2018-09-13 Chris Dumez <cdumez@apple.com>
Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
https://bugs.webkit.org/show_bug.cgi?id=189590
<rdar://problem/44422725>
Reviewed by Geoffrey Garen.
If script calls window.open() without 'noopener' and the newly navigated window gets navigated cross-site,
we are currently unable to process-swap because the opener has a WindowProxy handle to this new Window and
may interact with it (which we currently do not support cross-process). We were dealing with this by not
process-swapping if window.opener is not null. This works most of the time but is not sufficient because the
opener may get nulled out, while the opener still has a valid WindowProxy handle to its openee.
Therefore, we now also check for a flag indicating if the frame was opened via window.open() without
'nooopener'. We still need to check if the browsing context has an opener for browsing context created
via <a target="_blank"> for example (the opener does not have a handle to the new window but the openee
has access to its opener).
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::openedViaWindowOpenWithOpener const):
(API::Navigation::setOpenedViaWindowOpenWithOpener):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2018-09-13 Dean Jackson <dino@grorg.org>
Generate warnings for Preferences files
https://bugs.webkit.org/show_bug.cgi?id=189573
Reviewed by Sam Weinig.
Generate the "DO NOT EDIT" warnings, rather than have
them in the template (which was confusing).
While here, simplify some of the templating generation code
to avoid duplication.
* Scripts/GeneratePreferences.rb:
* Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
2018-09-13 Keith Rollin <krollin@apple.com>
WebPageProxy::reportPageLoadResult can crash on some code paths
https://bugs.webkit.org/show_bug.cgi?id=189568
Reviewed by Chris Dumez.
WebPageProxy::reportPageLoadResult (which is called from
WebPageProxy::didFinishLoadForFrame) can sometimes crash when
accessing m_pageLoadStart (a std::optional) in its unloaded state.
Normally, m_pageLoadStart is initialized in
WebPageProxy::didStartProvisionalLoadForFrame, which one would expect
would be called before WebPageProxy::didFinishLoadForFrame. But that
turns out to not always be the case. It's not apparent under what
conditions didStartProvisionalLoadForFrame will not be called, but
it's happening in the wild, leading to crashes now that std::optional
asserts in release builds on bad accesses (see
https://bugs.webkit.org/show_bug.cgi?id=189568).
Fix this by checking m_pageLoadState on entry to reportPageLoadResult.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::reportPageLoadResult):
2018-09-13 Chris Dumez <cdumez@apple.com>
ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame()
https://bugs.webkit.org/show_bug.cgi?id=189599
Reviewed by Geoffrey Garen.
The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case
of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the
process we're reattaching to already has a WebPage (with a main frame), in which case
WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame.
The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we
detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess).
It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history
navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process.
For example, no SuspendedPageProxy may be available for the history navigation because the history
was restored to a new view from disk, or because the WebBackForwardListItem no longer has a
SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem).
Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations
is incorrect and we should instead check if we're reattaching to a SuspendedPage's process.
Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and
existing Back/Forward PSON API tests which are still passing.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
2018-09-13 Chris Dumez <cdumez@apple.com>
Add release logging to help debug PSON issues
https://bugs.webkit.org/show_bug.cgi?id=189562
Reviewed by Ryosuke Niwa.
Add release logging to help debug issues related to process swap on navigation.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
2018-09-13 Chris Dumez <cdumez@apple.com>
Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
https://bugs.webkit.org/show_bug.cgi?id=189587
Reviewed by Geoffrey Garen.
Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
as this is causing crashes on the bots.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
2018-09-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235953.
Caused layout test crashes under GuardMalloc.
Reverted changeset:
"Make GraphicsLayers ref-counted, so their tree can persist
when disconnected from RenderLayerBackings"
https://bugs.webkit.org/show_bug.cgi?id=189521
https://trac.webkit.org/changeset/235953
2018-09-13 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Allow to run script dialogs asynchronously in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189544
Reviewed by Michael Catanzaro.
Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
changes are backwards compatible.
* UIProcess/API/glib/WebKitScriptDialog.cpp:
(webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
(webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
a competion handler pending.
(webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
(webkit_script_dialog_unref): Ditto.
(webkit_script_dialog_close): New method to notify that we are done with the dialog.
* UIProcess/API/glib/WebKitScriptDialogPrivate.h:
(_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
* UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewDispose): Close the current script dialog if there's any.
(webkit_web_view_class_init): Document how to handle dialogs asynchronously.
(webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
webkitScriptDialogCreate() passing the completion handler.
(webkitWebViewRunJavaScriptConfirm): Ditto.
(webkitWebViewRunJavaScriptPrompt): Ditto.
(webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitScriptDialog.h:
* UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
(scriptDialogResponseCallback): Hnadle the response callback.
(webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
2018-09-12 Dan Bernstein <mitz@apple.com>
Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
https://bugs.webkit.org/show_bug.cgi?id=189561
Reviewed by Tim Horton.
Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
appear in the GM seed SDKs.
* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationDelegate.h:
* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/API/Cocoa/_WKLinkIconParameters.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2018-09-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Complete support for Paste as Quotation
https://bugs.webkit.org/show_bug.cgi?id=189504
Reviewed by Wenson Hsieh.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
category. If we add more actions in the category, it could make sense to fold them into
a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
(-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
(-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
PasteAsQuotation command.
* UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
* UIProcess/ios/WKContentViewInteraction.mm:
Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
behavior.
(-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.
2018-09-12 Sihui Liu <sihui_liu@apple.com>
Move IndexedDB to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189415
Reviewed by Geoffrey Garen.
We are going to eliminate storage process and move its functionality to network process.
The reasons why we want to do this:
1. Lower resource usage of having an additional process for storage operations, especially
memory. Single storage process takes about 5MB memory on macOS.
2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
regression in app launch. The launch time of storage process is partly attributed to this:
Service Workers delay page loading until receiving response from storage process.
3. We choose network process because UI process may have broader access in file system
that we don't want the storage operations to have.
This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
to corresponding components of network process. Moving of Service Worker and stopping to
launch storage process will be done in following patches.
We expect to see the higher cpu and memory usage of network process as it is taking more work,
but the overall gain in memory and latency after we completely remove storage process should be
positive.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::didCloseFromServer):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
Code moved from StorageToWebProcessConnection::didReceiveMessage.
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
Network process receives and stores sandbox extension of temporary files for later indexedDB
use.
(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::ensurePathExists):
(WebKit::NetworkProcess::postStorageTask):
(WebKit::NetworkProcess::performNextStorageTask):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
Instead of asking UI process to grant sandbox extension to storage process, now network
process just asks for sandbox extension fot itself.
(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::queue):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::idbServer): Deleted.
(WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
(WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
(WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
(WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
(WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::queue): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::generateIDBConnectionToServerIdentifier): Deleted.
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
(WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
Code moved from WebToStorageProcessConnection::didReceiveMessage.
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
All the other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):
(WebKit::WebInspectorClient::showPaintRect):
(WebKit::WebInspectorClient::animationEndedForLayer):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::createGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2018-09-12 Chris Dumez <cdumez@apple.com>
PSON: No process swap on back navigation after URL bar navigation
https://bugs.webkit.org/show_bug.cgi?id=189557
<rdar://problem/44353108>
Reviewed by Alex Christensen.
Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
WebBackForwardList::currentItem() as source item of the navigation, instead of
using Navigation::fromItem(). In case of back navigation, by the time
processForNavigation() is called, the WebBackForwardList's currentItem has already
been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
the source and target items would be the same in the following check:
` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`
This would cause us to reuse the same process incorrectly. Our existing API test coverage
did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
2018-09-12 Alex Christensen <achristensen@webkit.org>
Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
https://bugs.webkit.org/show_bug.cgi?id=189519
Reviewed by Chris Dumez.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::bufferingTimerFired):
(WebKit::NetworkResourceLoader::sendBuffer):
* Platform/IPC/DataReference.cpp:
(IPC::SharedBufferDataReference::encode const): Deleted.
* Platform/IPC/DataReference.h:
(IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
* Platform/IPC/HandleMessage.h:
* Platform/IPC/SharedBufferDataReference.h: Added.
(IPC::SharedBufferDataReference::SharedBufferDataReference):
(IPC::SharedBufferDataReference::encode const):
* Scripts/webkit/messages.py:
* Shared/API/APIData.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::didReceiveData):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
* WebProcess/Network/WebResourceLoader.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerAttachmentIdentifier):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getContentsAsMHTMLData):
(WebKit::WebPage::getSelectionAsWebArchiveData):
(WebKit::WebPage::getMainResourceDataOfFrame):
(WebKit::WebPage::getResourceDataFromFrame):
(WebKit::WebPage::getWebArchiveOfFrame):
(WebKit::WebPage::drawPagesToPDF):
* WebProcess/WebPage/WebPage.messages.in:
2018-09-11 Dean Jackson <dino@apple.com>
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>
Reviewed by Tim Horton.
Provide key-based (string) access to experimental and internal features.
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetExperimentalFeatureForKey):
(WKPreferencesResetAllInternalDebugFeatures):
(WKPreferencesSetInternalDebugFeatureForKey):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/WebPreferences.h:
2018-09-10 Matt Rajca <mrajca@apple.com>
Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
https://bugs.webkit.org/show_bug.cgi?id=189478
<rdar://problem/44312650>
Reviewed by Eric Carlson.
This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
I also increased the size of the video element in the test page so it gets picked up by the
main content heuristics.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
(-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
(-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
(-[WKWebView _canTogglePictureInPicture]): Renamed from...
(-[WKWebView _canTogglePictureInPictureForTesting]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
(WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
(WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
controls manager even when there is no Touch Bar present.
(WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
(WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
(WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
https://bugs.webkit.org/show_bug.cgi?id=189542
Reviewed by Alex Christensen.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast.
2018-09-12 Chris Dumez <cdumez@apple.com>
Clean up SuspendedPageProxy
https://bugs.webkit.org/show_bug.cgi?id=189517
Reviewed by Alex Christensen.
Clean up SuspendedPageProxy:
1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
do not want it to outlive its WebPageProxy.
2. The SuspendedPageProxy destructor does not need to be virtual.
3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
This is safer and avoid having to explicitly clear the pointer.
4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::setSuspendedPage):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::didFinishLoad):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::process const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeCreateSuspendedPage):
(WebKit::WebPageProxy::reattachToWebProcess):
* UIProcess/WebPageProxy.h:
2018-09-12 Guillaume Emont <guijemont@igalia.com>
Add IGNORE_WARNING_.* macros
https://bugs.webkit.org/show_bug.cgi?id=188996
Reviewed by Michael Catanzaro.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSyncAllCookies):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::beginModal):
* PluginProcess/mac/PluginProcessShim.mm:
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):
* Shared/mac/ChildProcessMac.mm:
(WebKit::compileAndApplySandboxSlowCase):
* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::decode):
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _web_superAccessibilityAttributeValue:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewRunAsModal):
* UIProcess/API/mac/WKView.mm:
(-[WKView _web_superAccessibilityAttributeValue:]):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
* UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
(-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKTextListTouchBarViewController initWithWebViewImpl:]):
(WebKit::WebViewImpl::updateWindowAndViewFrames):
(WebKit::WebViewImpl::sendDragEndToPage):
(WebKit::WebViewImpl::startDrag):
(WebKit::WebViewImpl::characterIndexForPoint):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
(WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
(WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
(WebKit::PluginProcessProxy::exitFullscreen):
* UIProcess/ios/SmartMagnificationController.mm:
* UIProcess/ios/WKGeolocationProviderIOS.mm:
* UIProcess/ios/WKLegacyPDFView.mm:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
(-[WKPDFPageNumberIndicator _makeRoundedCorners]):
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
* UIProcess/ios/forms/WKFormColorControl.mm:
(-[WKColorPopover initWithView:]):
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePopover initWithView:datePickerMode:]):
* UIProcess/ios/forms/WKFormPopover.h:
* UIProcess/ios/forms/WKFormPopover.mm:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
(-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
(-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _setAutodisplay:]):
(-[WKPrintingView _drawPDFDocument:page:atPoint:]):
(-[WKPrintingView _drawPreview:]):
(-[WKPrintingView drawRect:]):
* UIProcess/mac/WKTextInputWindowController.mm:
(-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
(-[WKTextInputPanel _hasMarkedText]):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::initializeEventRecord):
(WebKit::NetscapePlugin::sendComplexTextInput):
(WebKit::makeCGLPresentLayerOpaque):
(WebKit::NetscapePlugin::nullEventTimerFired):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
(-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
(WebKit::PDFPlugin::handleEditingCommand):
(WebKit::PDFPlugin::setActiveAnnotation):
(WebKit:: const):
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
(WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::PDFPluginTextAnnotation::createAnnotationElement):
* WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::drawPDFPage):
2018-09-11 Olivia Barnett <obarnett@apple.com>
Implement the Web Share API for mac
https://bugs.webkit.org/show_bug.cgi?id=189443
Reviewed by Tim Horton.
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView shareSheetDidDismiss:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView shareSheetDidDismiss:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showShareSheet):
(WebKit::WebViewImpl::shareSheetDidDismiss):
Implemented function for WKShareSheetDelegate.
* UIProcess/Cocoa/WKShareSheet.h:
* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet initWithView:initWithView:]):
(-[WKShareSheet presentWithParameters:completionHandler:]):
(-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
(-[WKShareSheet _cancel]):
(-[WKShareSheet dismiss]):
(-[WKShareSheet _dismissDisplayAnimated:]):
(-[WKShareSheet invokeShareSheetWithResolution:]):
(-[WKShareSheet initWithView:]): Deleted.
Added mac platform checks and share sheet functionality.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showShareSheet):
Allows macos to invoke the system share sheet.
2018-09-07 Dean Jackson <dino@apple.com>
Add and expose Internal features from WebKit
https://bugs.webkit.org/show_bug.cgi?id=189442
<rdar://problem/44243404>
Reviewed by Simon Fraser.
Experimental features have become a mess. People are using them for
anything that they want to be easily toggled from a host app (e.g.
Safari), which means the user-facing menu has become large and
confusing.
Introduce the idea of Internal features, that will be exposed in a way
that end-users are not expected to ever see (unless they really want
to).
* CMakeLists.txt: Add new files.
* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* DerivedSources.make: Add new generated files.
* Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features.
* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added.
* Shared/API/APIObject.h: New API object for InternalDebugFeature.
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal".
* UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature.
(API::InternalDebugFeature::create):
(API::InternalDebugFeature::InternalDebugFeature):
(API::InternalDebugFeature::~InternalDebugFeature):
* UIProcess/API/APIInternalDebugFeature.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it
won't clash with internal debug features. We can remove the old API once Safari has adopted.
(+[WKPreferences _internalDebugFeatures]):
(-[WKPreferences _isEnabledForInternalDebugFeature:]):
(-[WKPreferences _setEnabled:forInternalDebugFeature:]):
(-[WKPreferences _isEnabledForFeature:]):
(-[WKPreferences _setEnabled:forFeature:]):
(-[WKPreferences _isEnabledForExperimentalFeature:]):
(-[WKPreferences _setEnabled:forExperimentalFeature:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature.
* UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
(-[_WKInternalDebugFeature dealloc]):
(-[_WKInternalDebugFeature description]):
(-[_WKInternalDebugFeature name]):
(-[_WKInternalDebugFeature key]):
(-[_WKInternalDebugFeature details]):
(-[_WKInternalDebugFeature defaultValue]):
(-[_WKInternalDebugFeature isHidden]):
(-[_WKInternalDebugFeature _apiObject]):
* UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h:
* UIProcess/WebPreferences.cpp: Add support for Internal Debug features.
(WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
(WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
* UIProcess/WebPreferences.h:
* UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature.
(WebKit::WebProcessPool::createWebPage):
2018-09-11 Eric Carlson <eric.carlson@apple.com>
WebPage::close should clear UserMediaPermissionRequestManager
https://bugs.webkit.org/show_bug.cgi?id=189369
<rdar://problem/44196724>
Reviewed by Youenn Fablet.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager.
2018-09-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK2] Support changing foreground colors via color panel
https://bugs.webkit.org/show_bug.cgi?id=189382
<rdar://problem/44227311>
Reviewed by Ryosuke Niwa.
Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for
more detail, as well as the WebCore ChangeLog.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView changeColor:]):
Implement this selector; AppKit calls into this when changing font color using NSColorPanel.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::changeFontColorFromSender):
Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender
object for its -color.
* WebProcess/WebPage/mac/WebPageMac.mm:
Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying
EditAction::ChangeAttributes.
(WebKit::WebPage::changeFontAttributes):
2018-09-11 Myles C. Maxfield <mmaxfield@apple.com>
Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
https://bugs.webkit.org/show_bug.cgi?id=188008
Reviewed by Alex Christensen.
This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
2018-09-11 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] API documentation is unclear about how to modify requests before sending them
https://bugs.webkit.org/show_bug.cgi?id=189505
Reviewed by Michael Catanzaro.
Add notes to the API documentation to make explicit where modification
of WebKitURIRequest instances affects the request data sent over the
network.
* UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
modifications to the associated WebKitURIRequest do not affect the
actual request. Point to WebKitPage::send-request instead.
* UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init): Ditto for the description of the
WebKitWebView::decide-policy signal. Also fix the syntax of example.
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init): Indicate that modifications to the
WebKitURIRequest will change the actual network request data.
2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, attempt to fix Apple builds after r235903
https://bugs.webkit.org/show_bug.cgi?id=188872
If it really needs to be inlined, it will need to move to the header....
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageClient const):
2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix build after r235903
https://bugs.webkit.org/show_bug.cgi?id=188872
This broke all ports except GTK. Need to add a missing header.
* UIProcess/PageClient.h:
2018-09-11 Pablo Saavedra <psaavedra@igalia.com>
Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp
https://bugs.webkit.org/show_bug.cgi?id=189506
Reviewed by Tim Horton.
m_pipStandbyElement is only defined in
WebKit/WebProcess/FullScreen/WebFullScreenManager.h
only when ENABLE(VIDEO) (see
https://bugs.webkit.org/show_bug.cgi?id=181338)
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::setPIPStandbyElement):
2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com>
WebPageProxy should hold a WeakPtr to its PageClient
https://bugs.webkit.org/show_bug.cgi?id=188872
Reviewed by Ryosuke Niwa.
This ensures the PageClient reference is always valid when used.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::startDrag):
(WebKit::WebPageProxy::setDragCaretRect):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::PageClientProtector::PageClientProtector):
(WebKit::PageClientProtector::~PageClientProtector):
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::pageClient const):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didChangeBackForwardList):
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
(WebKit::WebPageProxy::setViewNeedsDisplay):
(WebKit::WebPageProxy::requestScroll):
(WebKit::WebPageProxy::viewScrollPosition const):
(WebKit::WebPageProxy::updateActivityState):
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::viewDidEnterWindow):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::layerHostingModeDidChange):
(WebKit::WebPageProxy::viewSize const):
(WebKit::WebPageProxy::startDrag):
(WebKit::WebPageProxy::didPerformDragOperation):
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::preferencesDidChange):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didStartProgress):
(WebKit::WebPageProxy::didChangeProgress):
(WebKit::WebPageProxy::didFinishProgress):
(WebKit::WebPageProxy::didDestroyNavigation):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didReachLayoutMilestone):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::closePage):
(WebKit::WebPageProxy::setWindowFrame):
(WebKit::WebPageProxy::getWindowFrame):
(WebKit::WebPageProxy::getWindowFrameWithCallback):
(WebKit::WebPageProxy::screenToRootView):
(WebKit::WebPageProxy::rootViewToScreen):
(WebKit::WebPageProxy::syncRootViewToScreen):
(WebKit::WebPageProxy::accessibilityScreenToRootView):
(WebKit::WebPageProxy::rootViewToAccessibilityScreen):
(WebKit::WebPageProxy::didChangeViewportProperties):
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::showShareSheet):
(WebKit::WebPageProxy::handleDownloadRequest):
(WebKit::WebPageProxy::didChangeContentSize):
(WebKit::WebPageProxy::showColorPicker):
(WebKit::WebPageProxy::showDataListSuggestions):
(WebKit::WebPageProxy::compositionWasCanceled):
(WebKit::WebPageProxy::registerInsertionUndoGrouping):
(WebKit::WebPageProxy::canUndoRedo):
(WebKit::WebPageProxy::executeUndoRedo):
(WebKit::WebPageProxy::clearAllEditCommands):
(WebKit::WebPageProxy::setTextIndicator):
(WebKit::WebPageProxy::clearTextIndicator):
(WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
(WebKit::WebPageProxy::showPopupMenu):
(WebKit::WebPageProxy::showContextMenu):
(WebKit::WebPageProxy::registerEditCommand):
(WebKit::WebPageProxy::canUndo):
(WebKit::WebPageProxy::canRedo):
(WebKit::WebPageProxy::setToolTip):
(WebKit::WebPageProxy::setCursor):
(WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
(WebKit::WebPageProxy::exitAcceleratedCompositingMode):
(WebKit::WebPageProxy::updateAcceleratedCompositingMode):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
(WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
(WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
(WebKit::WebPageProxy::updateBackingStoreDiscardableState):
(WebKit::WebPageProxy::showCorrectionPanel):
(WebKit::WebPageProxy::dismissCorrectionPanel):
(WebKit::WebPageProxy::dismissCorrectionPanelSoon):
(WebKit::WebPageProxy::recordAutocorrectionResponse):
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::showDictationAlternativeUI):
(WebKit::WebPageProxy::removeDictationAlternatives):
(WebKit::WebPageProxy::dictationAlternatives):
(WebKit::WebPageProxy::setEditableElementIsFocused):
(WebKit::WebPageProxy::takeViewSnapshot):
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
(WebKit::WebPageProxy::navigationGestureDidBegin):
(WebKit::WebPageProxy::navigationGestureWillEnd):
(WebKit::WebPageProxy::navigationGestureDidEnd):
(WebKit::WebPageProxy::willRecordNavigationSnapshot):
(WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::videoControlsManagerDidChange):
(WebKit::WebPageProxy::handleControlledElementIDResponse const):
(WebKit::WebPageProxy::didPerformImmediateActionHitTest):
(WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
(WebKit::WebPageProxy::didHandleAcceptedCandidate):
(WebKit::WebPageProxy::addPlaybackTargetPickerClient):
(WebKit::WebPageProxy::removePlaybackTargetPickerClient):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
(WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled):
(WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState):
(WebKit::WebPageProxy::didChangeBackgroundColor):
(WebKit::WebPageProxy::didRestoreScrollPosition):
(WebKit::WebPageProxy::userInterfaceLayoutDirection):
(WebKit::WebPageProxy::didInsertAttachment):
(WebKit::WebPageProxy::didRemoveAttachment):
* UIProcess/WebPageProxy.h:
* UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
(WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::viewWidget):
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
(WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
(WebKit::WebPageProxy::overflowScrollViewDidScroll):
(WebKit::WebPageProxy::overflowScrollWillStartScroll):
(WebKit::WebPageProxy::overflowScrollDidEndScroll):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::layerTreeCommitComplete):
(WebKit::WebPageProxy::didReceivePositionInformation):
(WebKit::WebPageProxy::saveImageToLibrary):
(WebKit::WebPageProxy::interpretKeyEvent):
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::couldNotRestorePageState):
(WebKit::WebPageProxy::restorePageState):
(WebKit::WebPageProxy::restorePageCenterAndScale):
(WebKit::WebPageProxy::didGetTapHighlightGeometries):
(WebKit::WebPageProxy::startAssistingNode):
(WebKit::WebPageProxy::stopAssistingNode):
(WebKit::WebPageProxy::showInspectorHighlight):
(WebKit::WebPageProxy::hideInspectorHighlight):
(WebKit::WebPageProxy::showInspectorIndication):
(WebKit::WebPageProxy::hideInspectorIndication):
(WebKit::WebPageProxy::enableInspectorNodeSearch):
(WebKit::WebPageProxy::disableInspectorNodeSearch):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::commitPotentialTapFailed):
(WebKit::WebPageProxy::didNotHandleTapAsClick):
(WebKit::WebPageProxy::didCompleteSyntheticClick):
(WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
(WebKit::WebPageProxy::editorStateChanged):
(WebKit::WebPageProxy::showValidationMessage):
(WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
(WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
(WebKit::WebPageProxy::didConcludeEditDataInteraction):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::windowAndViewFramesChanged):
(WebKit::WebPageProxy::insertDictatedTextAsync):
(WebKit::WebPageProxy::setPromisedDataForImage):
(WebKit::WebPageProxy::didPerformDictionaryLookup):
(WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
(WebKit::WebPageProxy::makeFirstResponder):
(WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
(WebKit::WebPageProxy::colorSpace):
(WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged):
(WebKit::WebPageProxy::setPluginComplexTextInputState):
(WebKit::WebPageProxy::executeSavedCommandBySelector):
(WebKit::WebPageProxy::intrinsicContentSizeDidChange):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
(WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
(WebKit::WebPageProxy::showPDFContextMenu):
(WebKit::WebPageProxy::showTelephoneNumberMenu):
(WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const):
(WebKit::WebPageProxy::editorStateChanged):
(WebKit::WebPageProxy::startWindowDrag):
(WebKit::WebPageProxy::platformWindow):
(WebKit::WebPageProxy::rootViewToWindow):
(WebKit::WebPageProxy::showValidationMessage):
(WebKit::WebPageProxy::inspectorAttachmentView):
(WebKit::WebPageProxy::remoteObjectRegistry):
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::viewWidget):
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::viewBackend):
2018-09-11 Chris Dumez <cdumez@apple.com>
Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
https://bugs.webkit.org/show_bug.cgi?id=189482
<rdar://problem/44317222>
Reviewed by Geoffrey Garen.
The issue was that when we swap process on navigation, we:
1. Call processDidTerminate() which calls resetState() and clears the displayed content
2. Reattach the WebPageProxy to a new WebProcess
3. Trigger the navigation
4. Take the navigation snapshot
When the navigation snapshot occurs at step 4, the view is already blank in the case of
process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
processDidTerminate() and we suppress the next navigation snapshot as it would be blank.
At some point, we will likely want to display the previous' WebProcess content longer,
until the new WebProcess has something interesting to display. Once this is implemented,
we'll likely be able to drop the early snapshotting logic.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):
2018-09-11 Woodrow Wang <woodrow_wang@apple.com>
Add Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=187773
<rdar://problem/44155162>
Reviewed by Brent Fulgham.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
== Rolled over to ChangeLog-2018-09-11 ==