WebKit-https.git
3 years ago[Extra zoom mode] Add plumbing for next and previous focusable element rects
wenson_hsieh@apple.com [Mon, 26 Mar 2018 19:09:33 +0000 (19:09 +0000)]
[Extra zoom mode] Add plumbing for next and previous focusable element rects
https://bugs.webkit.org/show_bug.cgi?id=184016
Work towards <rdar://problem/38758727>

Reviewed by Tim Horton.

When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
as well as flags indicating whether or not there are next or previous focusable elements. For
<rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):

IPC support for nextNodeRect and previousNodeRect.

* Shared/AssistedNodeInformation.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::elementRectInRootViewCoordinates):

Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
current focused element as well as those of the next and previous elements, if any.

(WebKit::WebPage::getAssistedNodeInformation):
(WebKit::hasAssistableElement): Deleted.

Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229982 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Web Animations] Correctly handle timing functions specified by CSS Animations and...
graouts@webkit.org [Mon, 26 Mar 2018 19:08:01 +0000 (19:08 +0000)]
[Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
https://bugs.webkit.org/show_bug.cgi?id=183935

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-computed-timing-expected.txt:
* css-transitions/test_animation-computed-timing-expected.txt:
* css-transitions/test_keyframeeffect-getkeyframes-expected.txt:

Source/WebCore:

We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.

In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
Transition, the transition-timing-function property set on the element's style serves as the timing function of the
from keyframe.

To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
LinearTimingFunction object.

As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
timing function.

* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
not be reflected on the effect's timing object.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
value for the "to" keyframe of a CSS Transition.
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
* animation/KeyframeEffectReadOnly.h:

LayoutTests:

We now pass 2 additional Mozilla tests completely, so they no longer need to be marked as flaky failures or timeouts.
We also update tests that we wrote ourselves and which incorrectly assumed that the effect's timing would reflect
the timing function set by CSS.

* TestExpectations:
* webanimations/css-animations-expected.txt:
* webanimations/css-animations.html:
* webanimations/css-transitions-expected.txt:
* webanimations/css-transitions.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229981 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMake VCP encoder usage conditional on using internal SDK
commit-queue@webkit.org [Mon, 26 Mar 2018 18:36:37 +0000 (18:36 +0000)]
Make VCP encoder usage conditional on using internal SDK
https://bugs.webkit.org/show_bug.cgi?id=184009

Patch by Youenn Fablet <youennf@gmail.com> on 2018-03-26
Reviewed by Eric Carlson.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse SecurityOriginData more consistently in Service Worker code
cdumez@apple.com [Mon, 26 Mar 2018 18:03:40 +0000 (18:03 +0000)]
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969

Reviewed by Darin Adler.

Source/WebCore:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().

No new tests, no Web-facing behavior change.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCopyDatabaseIdentifier):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::addToStore):
(WebKit::WebSWOriginStore::removeFromStore):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::serverToContextConnectionForOrigin):
(WebKit::StorageProcess::createServerToContextConnection):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
* StorageProcess/StorageProcess.h:
* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyOriginsWithApplicationCache):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::securityOrigin const):
* WebProcess/WebStorage/StorageAreaImpl.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

Source/WebKitLegacy:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::diskUsageForOrigin):

Source/WebKitLegacy/mac:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager databasesWithOrigin:]):
(-[WebDatabaseManager deleteOrigin:]):
(-[WebDatabaseManager deleteDatabase:withOrigin:]):
* Storage/WebDatabaseQuotaManager.mm:
(-[WebDatabaseQuotaManager usage]):
(-[WebDatabaseQuotaManager quota]):
(-[WebDatabaseQuotaManager setQuota:]):
* Storage/WebStorageManager.mm:
(-[WebStorageManager deleteOrigin:]):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin databaseIdentifier]):
(-[WebSecurityOrigin usage]):
(-[WebSecurityOrigin quota]):
(-[WebSecurityOrigin setQuota:]):

Source/WebKitLegacy/win:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* WebDatabaseManager.cpp:
(WebDatabaseManager::databasesWithOrigin):
(WebDatabaseManager::deleteOrigin):
(WebDatabaseManager::deleteDatabase):
(WebDatabaseManager::setQuota):
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWarn against cookie access in the WebContent process using ProcessPrivilege assertions
bfulgham@apple.com [Mon, 26 Mar 2018 17:55:45 +0000 (17:55 +0000)]
Warn against cookie access in the WebContent process using ProcessPrivilege assertions
https://bugs.webkit.org/show_bug.cgi?id=183911
<rdar://problem/38762306>

Reviewed by Youenn Fablet.

Source/WebCore:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

Add a new static flag to NetworkStorageSession that indicates if the current process has
permission to interact with the Cookie API.

No new tests since there is no change in behavior.

* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
(WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
the appropriate flag to the ProcessPrivileges data for the current process.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
the current process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
(WebCore::NetworkStorageSession::ensureSession): Ditto.
(WebCore::NetworkStorageSession::cookieStorage const): Ditto.
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
(WebCore::CookieStorageObserver::startObserving): Ditto.
(WebCore::CookieStorageObserver::stopObserving): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookie):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::nsCookiesToCookieVector):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
(WebCore::NetworkStorageSession::flushCookieStore):
(WebCore::NetworkStorageSession::nsCookieStorage const):
(WebCore::createPrivateStorageSession):
* platform/network/mac/CookieJarMac.mm:
(WebCore::httpCookies):
(WebCore::deleteHTTPCookie):
(WebCore::httpCookiesForURL):
(WebCore::filterCookies):
(WebCore::applyPartitionToCookies):
(WebCore::cookiesInPartitionForURL):
(WebCore::cookiesForSession):
(WebCore::setHTTPCookiesForURL):
(WebCore::deleteAllHTTPCookies):
(WebCore::setCookiesFromDOM):
(WebCore::httpCookieAcceptPolicy):
(WebCore::deleteCookie):
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteAllCookiesModifiedSince):

Source/WebKit:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::setSharedHTTPCookieStorage):
(WebKit::NetworkProcess::syncAllCookies):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::initializeProcess):
* Shared/cf/CookieStorageUtilsCF.mm:
(WebKit::cookieStorageFromIdentifyingData):
(WebKit::identifyingDataFromCookieStorage):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::privateBrowsingSession):
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/mac/WebCookieManagerProxyMac.mm:
(WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createNetworkingContext):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
(WebKit::WebFrameNetworkingContext::storageSession const):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):

Source/WebKitLegacy/mac:

Initialize the ProcessPrivilege and Cookie API access levels for single-process use.

* WebView/WebView.mm:
(+[WebView initialize]):

Source/WebKitLegacy/win:

Initialize the ProcessPrivilege and Cookie API access levels for single-process use.

* WebView.cpp:
(WebView::WebView):

Source/WTF:

Extend the ProcessPrivilege API with the ability to add and remove individual
privileges.

* wtf/ProcessPrivilege.cpp:
(WTF::addProcessPrivilege):
(WTF::removeProcessPrivilege):
* wtf/ProcessPrivilege.h:

Tools:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

* DumpRenderTree/mac/DumpRenderTree.mm:
(DumpRenderTreeMain):
* TestWebKitAPI/TestsController.cpp:
(TestWebKitAPI::TestsController::TestsController):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMerge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCac...
achristensen@apple.com [Mon, 26 Mar 2018 17:38:49 +0000 (17:38 +0000)]
Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
https://bugs.webkit.org/show_bug.cgi?id=183965

Reviewed by Chris Dumez.

Source/WebCore:

It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
path and it executes the logic in ResourceHandleClient::willCacheResponse.

* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponseAsync):
(WebCore::SubresourceLoader::willCacheResponse): Deleted.
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponseAsync):
(WebCore::ResourceLoader::willCacheResponse): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponseAsync):
(WebCore::ResourceHandleClient::shouldCacheResponse):
(WebCore::ResourceHandleClient::willCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::willCacheResponse const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::willCacheResponse const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMark imported/mozilla/css-animations/test_animation-cancel.html as flaky.
ryanhaddad@apple.com [Mon, 26 Mar 2018 17:18:56 +0000 (17:18 +0000)]
Mark imported/mozilla/css-animations/test_animation-cancel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184011

Unreviewed test gardening.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[LayoutReloaded] Add InlineText DOM interface and dependencies
zalan@apple.com [Mon, 26 Mar 2018 17:03:53 +0000 (17:03 +0000)]
[LayoutReloaded] Add InlineText DOM interface and dependencies
https://bugs.webkit.org/show_bug.cgi?id=184010

Reviewed by Antti Koivisto.

to help inline text layout.

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229975 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
magomez@igalia.com [Mon, 26 Mar 2018 14:30:08 +0000 (14:30 +0000)]
[GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
https://bugs.webkit.org/show_bug.cgi?id=184004

Reviewed by Žan Doberšek.

Do not upload the original buffer. Upload the result of creating a subImage buffer
if it was required.

Covered by existent tests.

* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229974 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK][WPE] Add API to convert between DOM and JSCValue
carlosgc@webkit.org [Mon, 26 Mar 2018 08:44:13 +0000 (08:44 +0000)]
[GTK][WPE] Add API to convert between DOM and JSCValue
https://bugs.webkit.org/show_bug.cgi?id=183448

Reviewed by Michael Catanzaro.

.:

Define FORWARDING_HEADERS_WPE_DOM_DIR.

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
* WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapDocument):
(webkit_dom_document_class_init):
(webkit_dom_document_init):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapElement):
(webkit_dom_element_class_init):
(webkit_dom_element_init):
(webkit_dom_element_html_input_element_is_user_edited):
(webkit_dom_element_html_input_element_get_auto_filled):
(webkit_dom_element_html_input_element_set_auto_filled):
(webkit_dom_element_html_input_element_set_editing_value):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
(_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
(WebKit::kit):
(WebKit::core):
(WebKit::wrapNode):
(webkitDOMNodeConstructor):
(webkitDOMNodeFinalize):
(webkit_dom_node_init):
(webkit_dom_node_class_init):
(webkitDOMNodeSetCoreObject):
(webkitDOMNodeGetCoreObject):
(webkit_dom_node_for_js_value):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
(webkitDOMObjectSetProperty):
(webkit_dom_object_class_init):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
(WebKit::wrap):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
(webkit_frame_get_js_value_for_dom_object):
(webkit_frame_get_js_value_for_dom_object_in_script_world):
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init):
(webkitWebPageCreate):
(webkit_web_page_get_dom_document):
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
(WebKit::GObjectEventListener::handleEvent):
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
(webkitDOMDocumentDOMEventTargetInit):
(webkitDOMDocumentInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
(webkitDOMElementDOMEventTargetInit):
(webkitDOMElementInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
(webkitDOMNodeDOMEventTargetInit):
(webkitDOMNodeInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
(WebKit::wrapNodeGtk):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
* WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
* WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
* WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:

Tools:

Add unit tests for non-deprecated DOM API and switch existing tests to use non-deprecated API except for the
ones that test the deprecated API.

* TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp: Added.
(DOMElementTest::create):
(DOMElementTest::testAutoFill):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp: Added.
(WebKitWebEditorTest::create):
(WebKitWebEditorTest::selectionChangedCallback):
(WebKitWebEditorTest::testSelectionchanged):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp:
(WebKitFrameTest::testJavaScriptValues):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
(testWebKitDOMElementAutoFill):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebKitGtk/TestEditor.cpp.
* TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp:
(testWebKitFrameJavaScriptValues):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(inputElementIsUserEdited):
(testWebExtensionInputElementIsUserEdited):
(testWebExtensionFormSubmissionSteps):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(documentLoadedCallback):
(serializeNode):
(contextMenuCallback):
(consoleMessageSentCallback):
(formControlsAssociatedCallback):
(willSubmitFormCallback):
(pageCreatedCallback):
(methodCallCallback):
* TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp:
(checkLeaks):
(webProcessTestRunnerFinalize):
(checkLeaksAtExit):
* TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp:
(AutocleanupsTest::testWebProcessAutocleanups):
* TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/EditorTest.cpp: Removed.
* TestWebKitAPI/glib/CMakeLists.txt:
* TestWebKitAPI/glib/PlatformGTK.cmake:
* TestWebKitAPI/glib/PlatformWPE.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229973 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
zandobersek@gmail.com [Mon, 26 Mar 2018 07:37:23 +0000 (07:37 +0000)]
[CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
https://bugs.webkit.org/show_bug.cgi?id=184002

Reviewed by Carlos Garcia Campos.

Move the CoordinatedGraphicsScene constant-expression initializations
from constructor to the point of declaration.

Default the CoordinatedGraphicsScene destructor.

The m_scrollPosition member variable is unused in this class, while the
similarly-named m_renderedContentsScrollPosition tracks scroll position
of the scene. Remove the latter and use m_scrollPosition in its place.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
(WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
(WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229972 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
mcatanzaro@igalia.com [Mon, 26 Mar 2018 06:58:14 +0000 (06:58 +0000)]
[GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
https://bugs.webkit.org/show_bug.cgi?id=183998

Reviewed by Carlos Garcia Campos.

* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229971 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK] Unresolved type warnings when generating gir
carlosgc@webkit.org [Mon, 26 Mar 2018 06:48:49 +0000 (06:48 +0000)]
[GTK] Unresolved type warnings when generating gir
https://bugs.webkit.org/show_bug.cgi?id=183926

Reviewed by Michael Catanzaro.

Skip deprecated functions using JSC C API from introspection.

* UIProcess/API/glib/WebKitJavascriptResult.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229970 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix typo in JSC option name
sbarati@apple.com [Mon, 26 Mar 2018 06:38:44 +0000 (06:38 +0000)]
Fix typo in JSC option name
https://bugs.webkit.org/show_bug.cgi?id=184001

Reviewed by Mark Lam.

enableJITDebugAssetions => enableJITDebugAssertions.

* assembler/MacroAssembler.cpp:
(JSC::MacroAssembler::jitAssert):
* runtime/Options.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229969 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
zandobersek@gmail.com [Mon, 26 Mar 2018 06:21:32 +0000 (06:21 +0000)]
[TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
https://bugs.webkit.org/show_bug.cgi?id=183985

Reviewed by Michael Catanzaro.

Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
headers and implementation files. Remove dubious whitespace, use #pragma
once, clean up constructors, destructors, method definitions and remove
unnecessary includes in favor of forward declarations where possible.

The TextureMapperPlatformLayer::swapBuffers() method is removed as it
wasn't called or overridden anywhere.

No new tests -- no change in functionality.

* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
(WebCore::TextureMapperBackingStore::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperPlatformLayer.h:
(WebCore::TextureMapperPlatformLayer::setClient):
(WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
(WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229968 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
mitz@apple.com [Mon, 26 Mar 2018 05:56:45 +0000 (05:56 +0000)]
[Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
https://bugs.webkit.org/show_bug.cgi?id=183999

Reviewed by Sam Weinig.

* Configurations/WebCore.xcconfig: Removed build settings.
* Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
  frameworks search path.
* Configurations/WebKitLegacyStub.iOS.tbd: Removed.
* WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229967 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r229954.
commit-queue@webkit.org [Mon, 26 Mar 2018 05:00:03 +0000 (05:00 +0000)]
Unreviewed, rolling out r229954.
https://bugs.webkit.org/show_bug.cgi?id=184000

Caused many layout tests to crash on Apple High Sierra,
Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
by dydz on #webkit).

Reverted changeset:

"Use SecurityOriginData more consistently in Service Worker
code"
https://bugs.webkit.org/show_bug.cgi?id=183969
https://trac.webkit.org/changeset/229954

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229966 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWebProcess memory monitor: use %zu format specifier for size_t
clopez@igalia.com [Mon, 26 Mar 2018 00:54:22 +0000 (00:54 +0000)]
WebProcess memory monitor: use %zu format specifier for size_t
https://bugs.webkit.org/show_bug.cgi?id=183997

Reviewed by Michael Catanzaro.

usse %zu format specifier for size_t instead of %lu.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::shrinkOrDie):
(WTF::MemoryPressureHandler::measurementTimerFired):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229965 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Automation: remove unnecessary member variable WebAutomationSession
bburg@apple.com [Sun, 25 Mar 2018 20:22:36 +0000 (20:22 +0000)]
Web Automation: remove unnecessary member variable WebAutomationSession
https://bugs.webkit.org/show_bug.cgi?id=183971

Reviewed by Timothy Hatcher.

The concept of the "active" browsing context is something in the WebDriver
specification, but we were a bit too literal when first implementing this.
There's no actual need for this on the browser side since most commands
require implicitly switching to the target window passed in with the
Automation command. The driver, however, still needs to track the current
browsing context and current top-level browsing context.

For returning whether a browsing context is active,  we can just look at
the page's activity state to know whether the page is active or not. For
a normal browser, only one page is going to be visible and focused at a time.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::buildBrowsingContextForPage):
Consult the page's activity state to determine whether it's active.

(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::handleRunOpenPanel):
Stop reading and writing the current browsing context handle.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isViewFocused const):
(WebKit::WebPageProxy::isViewWindowActive const):
Add new accessor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDisable geolocation prompt in minimal simulator mode
timothy_horton@apple.com [Sun, 25 Mar 2018 20:22:18 +0000 (20:22 +0000)]
Disable geolocation prompt in minimal simulator mode
https://bugs.webkit.org/show_bug.cgi?id=183991
<rdar://problem/38845774>

Reviewed by Dan Bernstein.

* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):
* Misc/WebGeolocationProviderIOS.mm:
(-[WebGeolocationProviderIOS registerWebView:]):
(-[WebGeolocationProviderIOS initializeGeolocationForWebView:listener:]):
Also clean up some unnecessary nested #ifs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agor228149 accidentally removed code that resets m_emptyCursor at the end of a GC
sbarati@apple.com [Sun, 25 Mar 2018 18:26:32 +0000 (18:26 +0000)]
r228149 accidentally removed code that resets m_emptyCursor at the end of a GC
https://bugs.webkit.org/show_bug.cgi?id=183995

Reviewed by Filip Pizlo.

The removal of this line of code was unintended and happened during some
refactoring Fil was doing. The consequence of removing this line of code
is that the m_emptyCursor became a monotonically increasing integer, leading
the cursor to usually being out of bounds of the block range (depending on
what the program is doing). This made the functionality of finding an empty
block to steal almost always fail.

* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::prepareForAllocation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229962 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd and adopt ENABLE(AIRPLAY_PICKER)
timothy_horton@apple.com [Sun, 25 Mar 2018 17:09:00 +0000 (17:09 +0000)]
Add and adopt ENABLE(AIRPLAY_PICKER)
https://bugs.webkit.org/show_bug.cgi?id=183992

Reviewed by Daniel Bates.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showPlaybackTargetPicker:fromRect:]):
* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

Source/WTF:

* wtf/FeatureDefines.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229961 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMove WKAnimationDelegate to its own header
timothy_horton@apple.com [Sun, 25 Mar 2018 17:08:14 +0000 (17:08 +0000)]
Move WKAnimationDelegate to its own header
https://bugs.webkit.org/show_bug.cgi?id=183976
<rdar://problem/38822299>

Reviewed by Dan Bernstein.

* Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
so we're just getting lucky that an -invalidate method exists on
some other object. Instead, move WKAnimationDelegate to its own
header, and include it in the places we use it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229960 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpa...
achristensen@apple.com [Sun, 25 Mar 2018 06:19:02 +0000 (06:19 +0000)]
Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
https://bugs.webkit.org/show_bug.cgi?id=183966

Reviewed by Chris Dumez.

No change in behavior.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* loader/ResourceLoader.h:
* platform/network/BlobResourceHandle.cpp:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229959 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdopt WK_PLATFORM_NAME in WebKit
timothy_horton@apple.com [Sun, 25 Mar 2018 04:32:40 +0000 (04:32 +0000)]
Adopt WK_PLATFORM_NAME in WebKit
https://bugs.webkit.org/show_bug.cgi?id=183978

Reviewed by Dan Bernstein.

* Configurations/WebKit.xcconfig:
* WebKit.xcodeproj/project.pbxproj:
* mac/MigrateHeadersFromWebKitLegacy.make:
* mac/postprocess-framework-headers.sh:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229958 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[DFG] Introduces fused compare and jump
utatane.tea@gmail.com [Sat, 24 Mar 2018 21:43:22 +0000 (21:43 +0000)]
[DFG] Introduces fused compare and jump
https://bugs.webkit.org/show_bug.cgi?id=177100

Reviewed by Mark Lam.

JSTests:

* stress/fused-jeq-slow.js: Added.
(shouldBe):
(testJEQ):
(testJNEQB):
(testJEQB):
(testJNEQF):
(testJEQF):
* stress/fused-jeq.js: Added.
(shouldBe):
(testJEQ):
(testJNEQB):
(testJEQB):
(testJNEQF):
(testJEQF):
* stress/fused-jstricteq-slow.js: Added.
(shouldBe):
(testJSTRICTEQ):
(testJNSTRICTEQB):
(testJSTRICTEQB):
(testJNSTRICTEQF):
(testJSTRICTEQF):
* stress/fused-jstricteq.js: Added.
(shouldBe):
(testJSTRICTEQ):
(testJNSTRICTEQB):
(testJSTRICTEQB):
(testJNSTRICTEQF):
(testJSTRICTEQF):

Source/JavaScriptCore:

This patch introduces op_jeq, op_jneq, op_jstricteq, and op_jnstricteq.
It offers 3 benefit.

1. They are introduced due to the similar purpose to op_jless etc. It aligns
op_eq families to op_jless families.

2. It reduces the size of bytecode to represent the typical code sequence.

3. It offers the way to fuse check and jump in DFG code generation. Since
we have MovHint between Branch and CompareEq/CompareStrictEq previously,
we cannot do this optimization. It reduces the machine code size in DFG too.

It slightly improves Octane/boyer.

    boyer  6.18038+-0.05002    ^     6.06990+-0.04176       ^ definitely 1.0182x faster

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/Opcode.h:
(JSC::isBranch):
* bytecode/PreciseJumpTargetsInlines.h:
(JSC::extractStoredJumpTargetsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStrictEq):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_stricteq):
(JSC::JIT::emit_op_nstricteq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_jstricteq):
(JSC::JIT::emit_op_jnstricteq):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emitSlow_op_jneq):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::compileOpEqJumpSlow):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_stricteq):
(JSC::JIT::emit_op_nstricteq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_jstricteq):
(JSC::JIT::emit_op_jnstricteq):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229957 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoIgnore sandbox_init_with_parameters deprecation warnings
timothy_horton@apple.com [Sat, 24 Mar 2018 21:23:07 +0000 (21:23 +0000)]
Ignore sandbox_init_with_parameters deprecation warnings
https://bugs.webkit.org/show_bug.cgi?id=183979

Reviewed by Dan Bernstein.

* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agowebkitpy: Unrecognized mac versions always use WebKitTestRunner
jbedard@apple.com [Sat, 24 Mar 2018 20:46:46 +0000 (20:46 +0000)]
webkitpy: Unrecognized mac versions always use WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=183681
<rdar://problem/38509162>

Reviewed by Daniel Bates.

When an unrecognized version is used, we were unconditionally adding '-wk2'
to the mac version name. This would mean that the port object would always
use WebKitTestRunner as the driver, even if DumpRenderTree was explicitly
requested.

* Scripts/webkitpy/port/apple.py:
(ApplePort.determine_full_port_name): Only add wk2 to port names if
WebKitTestRunner is specified.
* Scripts/webkitpy/port/mac.py:
(MacPort.__init__): Compare length of split string, and do not treat wk2 as a
version name.
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest):
(MacTest.test_factory_with_future_version): Confirm that future versions correctly
assign the driver and have undefined version names.
(MacTest.test_factory_with_portname_version): Confirm that general versions correctly assign
the driver and have defined versions.
(MacTest.test_factory_with_portname_wk2): Ensure that mac ports ending in 'wk2' set
the driver to be WebKitTestRunner even if webkit_test_runner=False.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229955 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse SecurityOriginData more consistently in Service Worker code
cdumez@apple.com [Sat, 24 Mar 2018 19:54:42 +0000 (19:54 +0000)]
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969

Reviewed by Darin Adler.

Source/WebCore:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().

No new tests, no Web-facing behavior change.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCopyDatabaseIdentifier):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::addToStore):
(WebKit::WebSWOriginStore::removeFromStore):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::serverToContextConnectionForOrigin):
(WebKit::StorageProcess::createServerToContextConnection):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
* StorageProcess/StorageProcess.h:
* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyOriginsWithApplicationCache):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::securityOrigin const):
* WebProcess/WebStorage/StorageAreaImpl.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

Source/WebKitLegacy:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::diskUsageForOrigin):

Source/WebKitLegacy/mac:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager databasesWithOrigin:]):
(-[WebDatabaseManager deleteOrigin:]):
(-[WebDatabaseManager deleteDatabase:withOrigin:]):
* Storage/WebDatabaseQuotaManager.mm:
(-[WebDatabaseQuotaManager usage]):
(-[WebDatabaseQuotaManager quota]):
(-[WebDatabaseQuotaManager setQuota:]):
* Storage/WebStorageManager.mm:
(-[WebStorageManager deleteOrigin:]):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin databaseIdentifier]):
(-[WebSecurityOrigin usage]):
(-[WebSecurityOrigin quota]):
(-[WebSecurityOrigin setQuota:]):

Source/WebKitLegacy/win:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* WebDatabaseManager.cpp:
(WebDatabaseManager::databasesWithOrigin):
(WebDatabaseManager::deleteOrigin):
(WebDatabaseManager::deleteDatabase):
(WebDatabaseManager::setQuota):
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229954 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[JSC] Improve constants and add comments for CodeBlockHash
utatane.tea@gmail.com [Sat, 24 Mar 2018 19:29:03 +0000 (19:29 +0000)]
[JSC] Improve constants and add comments for CodeBlockHash
https://bugs.webkit.org/show_bug.cgi?id=183982

Rubber-stamped by Mark Lam.

* bytecode/CodeBlockHash.cpp:
(JSC::CodeBlockHash::CodeBlockHash):
* bytecode/ParseHash.cpp:
(JSC::ParseHash::ParseHash):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[JSC] Add options to report parsing and bytecode compiling times
utatane.tea@gmail.com [Sat, 24 Mar 2018 19:04:18 +0000 (19:04 +0000)]
[JSC] Add options to report parsing and bytecode compiling times
https://bugs.webkit.org/show_bug.cgi?id=183982

Reviewed by Mark Lam.

This patch adds reportParseTimes and reportBytecodeCompileTimes options.
When they are enabled, JSC reports times consumed for parsing and bytecode
compiling.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/ParseHash.cpp: Added.
(JSC::ParseHash::ParseHash):
* bytecode/ParseHash.h: Added.
(JSC::ParseHash::hashForCall const):
(JSC::ParseHash::hashForConstruct const):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::generate):
* parser/Parser.h:
(JSC::parse):
* runtime/CodeCache.h:
(JSC::generateUnlinkedCodeBlock):
* runtime/Options.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229952 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[JIT] Drop ENABLE_JIT_VERBOSE flag
utatane.tea@gmail.com [Sat, 24 Mar 2018 17:10:23 +0000 (17:10 +0000)]
[JIT] Drop ENABLE_JIT_VERBOSE flag
https://bugs.webkit.org/show_bug.cgi?id=183983

Reviewed by Mark Lam.

Just use JITInternal::verbose value.

* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::link):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229951 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the !ENABLE(MEDIA_STREAM) build
timothy_horton@apple.com [Sat, 24 Mar 2018 09:55:35 +0000 (09:55 +0000)]
Fix the !ENABLE(MEDIA_STREAM) build
https://bugs.webkit.org/show_bug.cgi?id=183977

Reviewed by Wenson Hsieh.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229950 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWKFileUploadPanel shouldn't depend on WebKitLegacy
timothy_horton@apple.com [Sat, 24 Mar 2018 09:45:57 +0000 (09:45 +0000)]
WKFileUploadPanel shouldn't depend on WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183981

Reviewed by Wenson Hsieh.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
Just use the underlying WebCore function instead of the
unnecessary NSFileManager category method.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229949 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r229792.
commit-queue@webkit.org [Sat, 24 Mar 2018 09:10:19 +0000 (09:10 +0000)]
Unreviewed, rolling out r229792.
https://bugs.webkit.org/show_bug.cgi?id=183980

not actually necessary (Requested by thorton on #webkit).

Reverted changeset:

"Fix the build"
https://trac.webkit.org/changeset/229792

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229948 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the build
timothy_horton@apple.com [Sat, 24 Mar 2018 08:16:58 +0000 (08:16 +0000)]
Fix the build

* WebView/WebView.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229947 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the run-benchmark script, properly specifying the plan directory
zandobersek@gmail.com [Sat, 24 Mar 2018 07:06:23 +0000 (07:06 +0000)]
Fix the run-benchmark script, properly specifying the plan directory
where the Skipped file is located.

Rubber-stamped by Carlos Alberto Lopez Perez.

* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the geolocation build
timothy_horton@apple.com [Sat, 24 Mar 2018 06:27:38 +0000 (06:27 +0000)]
Fix the geolocation build
https://bugs.webkit.org/show_bug.cgi?id=183975

* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229945 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the !HAVE(APP_LINKS) build
timothy_horton@apple.com [Sat, 24 Mar 2018 06:26:21 +0000 (06:26 +0000)]
Fix the !HAVE(APP_LINKS) build
https://bugs.webkit.org/show_bug.cgi?id=183974

Reviewed by Dan Bernstein.

* pal/spi/cocoa/LaunchServicesSPI.h:
This header is not very !HAVE(APP_LINKS) friendly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229944 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the build with no pasteboard
timothy_horton@apple.com [Sat, 24 Mar 2018 05:56:49 +0000 (05:56 +0000)]
Fix the build with no pasteboard
https://bugs.webkit.org/show_bug.cgi?id=183973

Reviewed by Dan Bernstein.

* .../Configurations/FeatureDefines.xcconfig:
* WebView/WebView.mm:
(-[WebView _requestStartDataInteraction:globalPosition:]):
(-[WebView _getDataInteractionData]):
(-[WebView _dataOperationTextIndicator]):
(-[WebView _dragSourceAction]):
(-[WebView _draggedLinkTitle]):
(-[WebView _draggedLinkURL]):
(-[WebView _draggedElementBounds]):
(-[WebView _enteredDataInteraction:client:global:operation:]):
(-[WebView _updatedDataInteraction:client:global:operation:]):
(-[WebView _exitedDataInteraction:client:global:operation:]):
(-[WebView _performDataInteraction:client:global:operation:]):
(-[WebView _tryToPerformDataInteraction:client:global:operation:]):
(-[WebView _endedDataInteraction:global:]):
(-[WebView _dataInteractionCaretRect]):
* WebView/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229943 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKitLegacy and update install name
timothy_horton@apple.com [Sat, 24 Mar 2018 02:30:15 +0000 (02:30 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKitLegacy and update install name
https://bugs.webkit.org/show_bug.cgi?id=183960
<rdar://problem/38812356>

Reviewed by Dan Bernstein.

* Configurations/WebKitLegacy.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: Styles: don't show checkboxes for invalid properties
nvasilyev@apple.com [Sat, 24 Mar 2018 01:26:05 +0000 (01:26 +0000)]
Web Inspector: Styles: don't show checkboxes for invalid properties
https://bugs.webkit.org/show_bug.cgi?id=183951
<rdar://problem/38807602>

Reviewed by Matt Baker.

Since toggling of invalid properties isn't supported by the backend, don't show checkboxes for invalid properties.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-css-declaration:matches(:hover, :focus) .property:not(:matches(.invalid-name, .invalid-value)) .property-toggle,):
(.spreadsheet-css-declaration:matches(:hover, :focus) .property-toggle,): Deleted.
Don't show checkboxes for invalid properties but still show them for duplicate properties.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229941 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoEnable unified text selection in select cases for gradual testing
megan_gardner@apple.com [Sat, 24 Mar 2018 01:17:07 +0000 (01:17 +0000)]
Enable unified text selection in select cases for gradual testing
https://bugs.webkit.org/show_bug.cgi?id=183967
<rdar://problem/38815328>

Reviewed by Tim Horton.

Enable in select places for a more gradual switch, as this is a big change and we want to make sure
it works before switching completely.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView useSelectionAssistantWithGranularity:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Extra zoom mode] Fix some localizable strings after r229878
wenson_hsieh@apple.com [Sat, 24 Mar 2018 00:33:52 +0000 (00:33 +0000)]
[Extra zoom mode] Fix some localizable strings after r229878
https://bugs.webkit.org/show_bug.cgi?id=183963

Reviewed by Tim Horton.

The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
use WEB_UI_STRING_KEY instead.

Additionally, remove now-unused localizable strings for the text input view controller.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229939 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoIntroduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
timothy_horton@apple.com [Sat, 24 Mar 2018 00:00:32 +0000 (00:00 +0000)]
Introduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
https://bugs.webkit.org/show_bug.cgi?id=183954
<rdar://problem/38808858>

Reviewed by Dan Bernstein.

* wtf/Platform.h:

* WebView/WebPreferences.mm:
(-[WebPreferences setAudioSessionCategoryOverride:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229938 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUpdate WPT tools to a1ec330
youenn@apple.com [Fri, 23 Mar 2018 23:49:58 +0000 (23:49 +0000)]
Update WPT tools to a1ec330
https://bugs.webkit.org/show_bug.cgi?id=183934

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/config.json:
* resources/import-expectations.json:
* web-platform-tests/config.default.json:
* web-platform-tests/tools/: Refreshed.

Tools:

Update script to run WPT server  according updated WPT tools.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
(main):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_http_url):
(base_https_url):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229937 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoResource Load Statistics: Pick up ITP debug mode flag from defaults
wilander@apple.com [Fri, 23 Mar 2018 23:48:23 +0000 (23:48 +0000)]
Resource Load Statistics: Pick up ITP debug mode flag from defaults
https://bugs.webkit.org/show_bug.cgi?id=183956
<rdar://problem/38559574>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoNetworkStateNotifier::updateStateWithoutNotifying() is inefficient
cdumez@apple.com [Fri, 23 Mar 2018 23:46:50 +0000 (23:46 +0000)]
NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
https://bugs.webkit.org/show_bug.cgi?id=183760
<rdar://problem/37093299>

Reviewed by Ryosuke Niwa.

Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
expects its key parameter to be a regular expression and it can match several
keys. It is also unnecessary in our case since we already have an exact key.
We now call the more efficient SCDynamicStoreCopyValue() instead, which is
the right thing to call when we have an exact key.

This change was suggested by the SC team.

This was tested manually as there is no easy way to write an automated test
for this.

In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
to avoid calling it once per WebProcess.

* platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229935 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed attempt to fix Windows build after r229926.
cdumez@apple.com [Fri, 23 Mar 2018 23:41:59 +0000 (23:41 +0000)]
Unreviewed attempt to fix Windows build after r229926.

* WebView.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229934 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r229868.
dbates@webkit.org [Fri, 23 Mar 2018 23:37:13 +0000 (23:37 +0000)]
Unreviewed, rolling out r229868.

Caused media controls tests to timeout. Will investigate
offline.

Reverted changeset:

"CSS mask images should be retrieved using potentially CORS-
enabled fetch"
https://bugs.webkit.org/show_bug.cgi?id=179983
https://trac.webkit.org/changeset/229868

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: add WebKitAdditions hooks for WebInspectorUI
bburg@apple.com [Fri, 23 Mar 2018 23:35:03 +0000 (23:35 +0000)]
Web Inspector: add WebKitAdditions hooks for WebInspectorUI
https://bugs.webkit.org/show_bug.cgi?id=183940
<rdar://problem/38796310>

Reviewed by Timothy Hatcher.

* Scripts/combine-resources.pl:
(debugLog): Added. Leave in the logging I used to debug this.

(concatenateIncludedFilesMatchingPattern):
(stripIncludedFilesMatchingPattern):
(concatenateFiles): Deleted.
This function tried to do too many things. Split it into
two functions, one for stripping includes and one for concatenating
files referenced by includes.

Lastly, add a negative lookahead clause for 'WebKitAdditions' so includes
containing that string are not combined when no input directory is passed
to the script.

* Scripts/copy-user-interface-resources.pl:
WebKitAdditions is computed either from BUILT_PRODUCTS_DIR or SDKROOT,
depending on the build style. Just try them in order and use the first
one that exists. WebInspectorUI files are in their own directory, so
we can assume there are files to process if that directory exists.

Copy Main.html to derived sources before doing any processing on it.
This makes all combining phases have the same --input-html argument.

(debugLog): Added. Leave in the logging I used to debug this.

(combineOrStripResourcesForWebKitAdditions):
(stripResourcesForWebKitAdditions):
(combineResourcesForWebKitAdditions):
Determine if WebKitAdditions exists and whether there are any
resources for WebInspectorUI present that need to be processed.

* UserInterface/Main.html:
Add stub .js and .css WebKitAdditions files. We can add more later
if it makes sense but this is good enough to validate the build machinery.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd pointer profiling hooks to the CSS JIT.
mark.lam@apple.com [Fri, 23 Mar 2018 23:28:05 +0000 (23:28 +0000)]
Add pointer profiling hooks to the CSS JIT.
https://bugs.webkit.org/show_bug.cgi?id=183947
<rdar://problem/38803593>

Reviewed by JF Bastien.

No new tests needed.  Covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().

* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
(WebCore::SelectorDataList::execute const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229931 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdopt WK_PLATFORM_NAME in WebKitLegacy
timothy_horton@apple.com [Fri, 23 Mar 2018 22:47:48 +0000 (22:47 +0000)]
Adopt WK_PLATFORM_NAME in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183948
<rdar://problem/38803908>

Reviewed by Dan Bernstein.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
* MigrateHeaders.make:
* postprocess-headers.sh:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoLocal storage getItem() for an empty string returned UNDEFINED value.
commit-queue@webkit.org [Fri, 23 Mar 2018 22:41:40 +0000 (22:41 +0000)]
Local storage getItem() for an empty string returned UNDEFINED value.
https://bugs.webkit.org/show_bug.cgi?id=69138
<rdar://problem/13410974>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-03-23
Reviewed by Brady Eidson.

Source/WebCore:

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsString):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: Added.
(-[LocalStorageMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/localstorage-empty-string-value.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229929 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Extra zoom mode] Adopt list view controller UI for select menus
wenson_hsieh@apple.com [Fri, 23 Mar 2018 22:35:38 +0000 (22:35 +0000)]
[Extra zoom mode] Adopt list view controller UI for select menus
https://bugs.webkit.org/show_bug.cgi?id=183944
<rdar://problem/38799062>

Reviewed by Tim Horton.

Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.

* UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
* UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229928 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoPromptly terminate service worker processes when they are no longer needed
cdumez@apple.com [Fri, 23 Mar 2018 22:16:25 +0000 (22:16 +0000)]
Promptly terminate service worker processes when they are no longer needed
https://bugs.webkit.org/show_bug.cgi?id=183873
<rdar://problem/38676995>

Reviewed by Youenn Fablet.

Source/WebCore:

The StorageProcess now keeps track of service worker clients for each security
origin. When there is no longer any clients for a given security origin, the
StorageProcess asks the service worker process for the given origin to terminate
and severs its connection to it.

Change is covered by API test.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
Pass the security origin since this is called when a service worker process
crashes. When a service worker process for origin A crashes, we only want
to mark service workers in origin A as terminated, not ALL of them.

(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
Tweak logic so that we only relaunch a service worker process if we still
have clients for its security origin.

* workers/service/server/SWServer.h:
(WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
Add a way to disable the service worker termination delay to facilitate
testing.

* workers/service/server/SWServerToContextConnection.h:

Source/WebKit:

The StorageProcess now keeps track of service worker clients for each security
origin. When there is no longer any clients for a given security origin, the
StorageProcess asks the service worker process for the given origin to terminate
and severs its connection to it.

* Shared/Storage/StorageProcessCreationParameters.h:
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
(WebKit::WebSWServerToContextConnection::terminate):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::swServerForSession):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
(WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
* UIProcess/WebProcessPool.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateProcess):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229927 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoGo to back/forward list items after a process-swapped navigation.
beidson@apple.com [Fri, 23 Mar 2018 22:15:23 +0000 (22:15 +0000)]
Go to back/forward list items after a process-swapped navigation.
<rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920

Reviewed by Andy Estes.

Source/WebCore:

Covered by new API test.

Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
do a policy check or not.

* WebCore.xcodeproj/project.pbxproj:

* history/BackForwardController.cpp:
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):

* history/HistoryItem.cpp:
(WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
  This was a long standing bug that made it difficult to effectively test this change.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:

* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::setDefersLoading):
(WebCore::HistoryController::recursiveGoToItem):
* loader/HistoryController.h:

* loader/NavigationPolicyCheck.h:

* page/Page.cpp:
(WebCore::Page::goToItem):
* page/Page.h:

Source/WebKit:

This takes the initial work of "process swap a normal navigation" and extends it to
process swapping for back/forward item navigations.

* Scripts/webkit/messages.py:

Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
they will be lost in process-swap scenarios:
* Shared/SessionState.cpp:
(WebKit::PageState::encode const):
(WebKit::PageState::decode):
* Shared/SessionState.h:

Make a new variant of APINavigation specifically for back/forward list items.
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
(API::Navigation::loggingURL const):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
(API::Navigation::backForwardListItem):
(API::Navigation::backForwardFrameLoadType const):

* UIProcess/API/C/WKPage.cpp:
(WKPageGoToBackForwardListItem):

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController goToBackForwardListItem:]):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView goToBackForwardListItem:]):

* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadRequestNavigation):
(WebKit::WebNavigationState::createBackForwardNavigation):
* UIProcess/WebNavigationState.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::goForward):
(WebKit::WebPageProxy::goBack):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
(WebKit::WebPageProxy::restoreFromSessionState):
* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
(WebKit::WebProcessProxy::addBackForwardItem): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):

* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toPageState):
(WebKit::toHistoryItem):

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::updateBackForwardItem):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
  passing the appropriate FrameLoadType around as needed to remember the specific type.
(WebKit::WebPage::goForward): Deleted.
(WebKit::WebPage::goBack): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _loadBackForwardListFromOtherView:]):
(-[WebView goToBackForwardItem:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::goToBackForwardItem):
(WebView::loadBackForwardListFromOtherView):

Tools:

Add a new API test that does some process-swapping navigations (including a back navigation)
and verifies the state of the engine afterwards.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONMessageHandler userContentController:didReceiveScriptMessage:]):
(-[PSONScheme initWithBytes:]):
(-[PSONScheme webView:startURLSchemeTask:]):
(log):
(function):
(TEST): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMark accessibility/row-with-aria-role-in-native-table.html as failing on Windows.
pvollan@apple.com [Fri, 23 Mar 2018 22:07:01 +0000 (22:07 +0000)]
Mark accessibility/row-with-aria-role-in-native-table.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183955

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMark some CSS animations tests as failing on Windows.
pvollan@apple.com [Fri, 23 Mar 2018 22:02:53 +0000 (22:02 +0000)]
Mark some CSS animations tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183953

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229924 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agofix
youenn@apple.com [Fri, 23 Mar 2018 22:01:43 +0000 (22:01 +0000)]
fix

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229923 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: Styles Redesign: flashing when switching between nodes
nvasilyev@apple.com [Fri, 23 Mar 2018 21:35:34 +0000 (21:35 +0000)]
Web Inspector: Styles Redesign: flashing when switching between nodes
https://bugs.webkit.org/show_bug.cgi?id=179291
<rdar://problem/35352660>

Reviewed by Matt Baker.

Flashing was happening because the layout was a two-step process:
1. Append empty sections.
2. Layout everything inside of the section on requestAnimationFrame.

SpreadsheetRulesStyleDetailsPanel was converted to use layout method,
so both steps happen on requestAnimationFrame.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.refresh):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
The removed lines from the refresh method moved to the layout method without any changes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229922 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoLint web-platform-tests changes with the wpt linter before exporting
commit-queue@webkit.org [Fri, 23 Mar 2018 21:19:37 +0000 (21:19 +0000)]
Lint web-platform-tests changes with the wpt linter before exporting
https://bugs.webkit.org/show_bug.cgi?id=183796

Patch by Brendan McLoughlin <brendan@bocoup.com> on 2018-03-23
Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_exporter.py:
(TestExporter.__init__):
(TestExporter.do_export):
* Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.MockWPTLinter):
(TestExporterTest.MockWPTLinter.__init__):
(TestExporterTest.MockWPTLinter.lint):
(TestExporterTest.test_export):
(TestExporterTest.test_export_with_specific_branch):
* Scripts/webkitpy/w3c/wpt_linter.py: Added.
(WPTLinter):
(WPTLinter.__init__):
(WPTLinter.lint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd support for VCP encoder on MacOS and iOS
youenn@apple.com [Fri, 23 Mar 2018 21:18:56 +0000 (21:18 +0000)]
Add support for VCP encoder on MacOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=183924

Reviewed by Eric Carlson.

Soft-Link VideoProcessing functions and use them in H264 encoder.
This is conditional on recent MacOS and iOS platforms.

* Source/webrtc/sdk/WebKit/EncoderUtilities.h: Added.
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp: Added.
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Added.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
(webrtc::createVideoToolboxEncoderFactory):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(-[RTCVideoEncoderH264 destroyCompressionSession]):
* WebKit/0001-Using-VCP.patch: Added.
* libwebrtc.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229920 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoResource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
wilander@apple.com [Fri, 23 Mar 2018 21:03:36 +0000 (21:03 +0000)]
Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
https://bugs.webkit.org/show_bug.cgi?id=183950
<rdar://problem/38806275>

Reviewed by Brent Fulgham.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
    Now isVeryPrevalentResource is decoded to the correct field.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDon't use the presence of a textSelectionAssistant as a proxy for if we are in conten...
megan_gardner@apple.com [Fri, 23 Mar 2018 21:00:02 +0000 (21:00 +0000)]
Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
https://bugs.webkit.org/show_bug.cgi?id=183804

Reviewed by Tim Horton.

We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to
be more direct in checking what we actually need to know i.e. are we selecting in a content editable.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(hasAssistedNode):
(-[WKContentView inputView]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRects]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _autofillContext]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229918 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWebProcessPool should not ask to register all clients for each service worker process...
youenn@apple.com [Fri, 23 Mar 2018 20:53:01 +0000 (20:53 +0000)]
WebProcessPool should not ask to register all clients for each service worker process creation
https://bugs.webkit.org/show_bug.cgi?id=183941

Reviewed by Chris Dumez.

Source/WebCore:

Covered by existing unit tests.
Register all Documents of a process no matter its session ID when asked to.
Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
by calling setMayHaveRegisteredServiceWorkers().
This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
will actually register all its future clients.

Add some assertions to ensure that a client is not registered twice.

* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):

Source/WebKit:

Call registerServiceWorkerClients when there is no service worker process.
Update service worker clients to register all of them no matter the session ID.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::registerServiceWorkerClients):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Extra zoom mode] Adopt list view controller UI for select menus
wenson_hsieh@apple.com [Fri, 23 Mar 2018 20:47:19 +0000 (20:47 +0000)]
[Extra zoom mode] Adopt list view controller UI for select menus
https://bugs.webkit.org/show_bug.cgi?id=183944
<rdar://problem/38799062>

Reviewed by Andy Estes.

Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
WebKitAdditions harness files. See corresponding changes for more details.

* UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
* UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentSelectMenuViewController:]):
(-[WKContentView dismissSelectMenuViewController:]):
(-[WKContentView selectMenu:didSelectItemAtIndex:]):
(-[WKContentView numberOfItemsInSelectMenu:]):
(-[WKContentView selectMenu:displayTextForItemAtIndex:]):
(-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
(-[WKContentView selectMenuUsesMultipleSelection:]):
(-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
(-[WKContentView _wheelChangedWithEvent:]):

Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
handling for select menus here.

(-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
(-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
(-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
(-[WKContentView startingIndexForSelectMenu:]): Deleted.

The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
just remove this delegate hook altogether.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229916 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoHTMLElement factory doesn't need to call MediaPlayer::isAvailable
eric.carlson@apple.com [Fri, 23 Mar 2018 20:11:52 +0000 (20:11 +0000)]
HTMLElement factory doesn't need to call MediaPlayer::isAvailable
https://bugs.webkit.org/show_bug.cgi?id=183946
<rdar://problem/38802687>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: media/media-disabled.html

* dom/make_names.pl:
(printConstructorInterior):
* page/Settings.yaml:
* page/SettingsDefaultValues.h:

LayoutTests:

* media/media-disabled-expected.txt: Added.
* media/media-disabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229915 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoCacheStorage::Caches should clear m_caches when clearing its representation even...
youenn@apple.com [Fri, 23 Mar 2018 19:54:01 +0000 (19:54 +0000)]
CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
https://bugs.webkit.org/show_bug.cgi?id=183945

Reviewed by Chris Dumez.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clearMemoryRepresentation):
In case we clear Caches in the middle of the initialization, m_caches might not be empty
but m_isInitialized is not yet set to true since we are computing the Caches size.
Update the assertion and clear m_caches in that case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229914 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoStop using dispatch_set_target_queue()
ddkilzer@apple.com [Fri, 23 Mar 2018 19:06:35 +0000 (19:06 +0000)]
Stop using dispatch_set_target_queue()
<https://webkit.org/b/183908>
<rdar://problem/33553533>

Reviewed by Daniel Bates.

Source/ThirdParty/libwebrtc:

* Source/webrtc/rtc_base/task_queue_gcd.cc: Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().
* WebKit/0009-Remove-dispatch_set_target_queue.patch: Add patch.
Filed this to track upstreaming the change:
<https://bugs.chromium.org/p/webrtc/issues/detail?id=9055>
* WebKit/patch-libwebrtc: Delete empty patch file.

Source/WebCore:

No new tests since no change in behavior.

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::globaVideoCaptureSerialQueue): Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().

Source/WebKit:

* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
dispatch_set_target_queue() since this is handled in the
dispatch_io_create() call above.

Source/WTF:

* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::platformInitialize): Remove !HAVE(QOS_CLASSES)
code path since it's never used now that HAVE(QOS_CLASSES) is
equivalent to PLATFORM(COCOA) in <wtf/Platform.h>.

Tools:

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add check for use of
dispatch_set_target_queue().
(CppChecker): Add 'runtime/dispatch_set_target_queue' category.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest): Add test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoLLInt TypeArray pointer poisoning should not pick its poison dynamically.
mark.lam@apple.com [Fri, 23 Mar 2018 18:55:26 +0000 (18:55 +0000)]
LLInt TypeArray pointer poisoning should not pick its poison dynamically.
https://bugs.webkit.org/show_bug.cgi?id=183942
<rdar://problem/38798018>

Reviewed by JF Bastien.

1. Move the LLInt TypedArray unpoisoning to just before the array access after
   all the branches.
2. Renamed FirstArrayType to FirstTypedArrayType to match the symbol in C++ code.
3. Remove a useless instruction in the implementation of emitX86Lea for a global
   label.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/x86.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229912 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd more support for pointer profiling.
mark.lam@apple.com [Fri, 23 Mar 2018 18:44:17 +0000 (18:44 +0000)]
Add more support for pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=183943
<rdar://problem/38799068>

Reviewed by JF Bastien.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::linkJumpOrCall):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall):
(JSC::AbstractMacroAssembler::tagReturnAddress):
(JSC::AbstractMacroAssembler::untagReturnAddress):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229911 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoOnly enable LayoutTest fast/css/apple-system-control-colors.html on macOS.
ryanhaddad@apple.com [Fri, 23 Mar 2018 18:34:50 +0000 (18:34 +0000)]
Only enable LayoutTest fast/css/apple-system-control-colors.html on macOS.

Unreviewed test gardening.

* TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229910 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed WPE gardening.
aperez@igalia.com [Fri, 23 Mar 2018 18:32:20 +0000 (18:32 +0000)]
Unreviewed WPE gardening.

Removed imported/mathml-in-html5 from WPE test expectations, as the
path does not exit anymore after r229601

* platform/wpe/TestExpectations: Removd imported/mathml-in-html5

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse libwebrtc ObjectiveC H264 encoder and decoder
youenn@apple.com [Fri, 23 Mar 2018 18:20:47 +0000 (18:20 +0000)]
Use libwebrtc ObjectiveC H264 encoder and decoder
https://bugs.webkit.org/show_bug.cgi?id=183912

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Add utilities inside libwebrtc to be used by WebKit:
- Create ObjectiveC encoder/decoder factories
- Notify of application status to invalidate encoders/decoders when in background
Implement RTCUIApplicationStatusObserver as a simple boolean that is set by WebCore.
This allows limiting the changes made to libwebrtc codec implementations.

Minor modifications done to libwebrtc to fix compilation.
Add Block_copy/Block_release to codec callbacks.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/WebKit/WebKitUtilities.h: Added.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm: Added.
(+[RTCUIApplicationStatusObserver sharedInstance]):
(+[RTCUIApplicationStatusObserver prepareForUse]):
(-[RTCUIApplicationStatusObserver setActive]):
(-[RTCUIApplicationStatusObserver setInactive]):
(-[RTCUIApplicationStatusObserver isApplicationActive]):
(webrtc::setApplicationStatus):
(webrtc::createVideoToolboxEncoderFactory):
(webrtc::createVideoToolboxDecoderFactory):
(webrtc::setH264HardwareEncoderAllowed):
(webrtc::isH264HardwareEncoderAllowed):
(webrtc::pixelBufferFromFrame):
* Source/webrtc/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm:
(-[RTCCVPixelBuffer dealloc]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm:
(-[RTCVideoDecoderH264 dealloc]):
(-[RTCVideoDecoderH264 setCallback:]):
(-[RTCVideoDecoderH264 releaseDecoder]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 dealloc]):
(-[RTCVideoEncoderH264 setCallback:]):
(-[RTCVideoEncoderH264 releaseEncoder]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* WebKit/0001-Adapting-libwebrtc-H264-codec.patch: Added.
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

No observable change of behavior.
Made use of libwebrtc WebKit utilities.
Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.

* Configurations/WebCore.xcconfig:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* testing/Internals.cpp: Removed commented out include.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229908 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDocumentThreadableLoader should send credentials after redirections and preflight...
youenn@apple.com [Fri, 23 Mar 2018 18:06:34 +0000 (18:06 +0000)]
DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
https://bugs.webkit.org/show_bug.cgi?id=183928

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.js: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html: Added.
* web-platform-tests/fetch/api/resources/inspect-headers.py:
* web-platform-tests/fetch/api/resources/redirect.py:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
       imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html

In case mode is include, keep sending credentials even after redirection with preflight.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229907 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix the build after r229858
timothy_horton@apple.com [Fri, 23 Mar 2018 18:06:08 +0000 (18:06 +0000)]
Fix the build after r229858

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229906 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAllow fully whitelisted plug-ins to match non HTTP URLs
youenn@apple.com [Fri, 23 Mar 2018 18:04:00 +0000 (18:04 +0000)]
Allow fully whitelisted plug-ins to match non HTTP URLs
https://bugs.webkit.org/show_bug.cgi?id=183938
rdar://problem/38534312

Reviewed by Chris Dumez.

Source/WebCore:

Covered by manual testing and unit testing.

* platform/URL.cpp:
(WebCore::URL::isMatchingDomain const):

Tools:

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoCacheStorage::Engine should not ref itself when hopping to a background thread
youenn@apple.com [Fri, 23 Mar 2018 18:02:30 +0000 (18:02 +0000)]
CacheStorage::Engine should not ref itself when hopping to a background thread
https://bugs.webkit.org/show_bug.cgi?id=183925
<rdar://problem/38580483>

Reviewed by Chris Dumez.

Add support for weak pointers to CacheStorage Engine.
Use weak pointer when hopping to background threads.
Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
Made some callbacks CompletionHandler as a bonus.

Made sure to use just one Engine for all private sessions.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::~Engine):
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::initialize):
(WebKit::CacheStorage::Engine::writeFile):
(WebKit::CacheStorage::Engine::readFile):
* NetworkProcess/cache/CacheStorageEngine.h:
(WebKit::CacheStorage::Engine::weakPtrFactory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229904 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoActiveDOMObject should assert that they are destroyed in the thread they are created
youenn@apple.com [Fri, 23 Mar 2018 17:48:46 +0000 (17:48 +0000)]
ActiveDOMObject should assert that they are destroyed in the thread they are created
https://bugs.webkit.org/show_bug.cgi?id=183671

Reviewed by Chris Dumez.

No change of behavior.
Moved MessagePort assertion to ActiveDOMObject.

* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::~ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
* dom/MessagePort.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agodump-class-layout is just wrong
jfbastien@apple.com [Fri, 23 Mar 2018 17:07:47 +0000 (17:07 +0000)]
dump-class-layout is just wrong
https://bugs.webkit.org/show_bug.cgi?id=183939

Reviewed by Yusuke Suzuki.

Looks like r229291 contained a half-renamed variable in it, so it
just doesn't work.

* Scripts/dump-class-layout:
(verify_type):
(verify_type_recursive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSafari WebKitWebRTCAudioModule crash during <video> tag update when audio track prese...
youenn@apple.com [Fri, 23 Mar 2018 16:55:10 +0000 (16:55 +0000)]
Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
https://bugs.webkit.org/show_bug.cgi?id=181180
<rdar://problem/36302375>

Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/video-update-often.html

AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
We can still ref it on a background thread but we always deref it on the main thread.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):

LayoutTests:

* webrtc/video-update-often-expected.txt: Added.
* webrtc/video-update-often.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[css-grid] Fix auto repeat tracks computation with definite min sizes
svillar@igalia.com [Fri, 23 Mar 2018 16:44:27 +0000 (16:44 +0000)]
[css-grid] Fix auto repeat tracks computation with definite min sizes
https://bugs.webkit.org/show_bug.cgi?id=183933

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

The relevant test for this change is just grid-inline-auto-repeat-001.html. The other ones
were pulled in by the import. The unique change in those tests is the location of a
stylesheet. Since we're using it in the new test it seems sensible to use this same commit
to import those changes too. There is one important change in testing-utils.js which is
also required by the new test.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/grid-definition/grid-change-fit-content-argument-001.html:
* web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001-expected.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-rows-fit-content-001-expected.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-rows-fit-content-001.html:
* web-platform-tests/css/css-grid/grid-definition/support/grid.css: Added.
(.grid):
(.inline-grid):
(.firstRowFirstColumn):
(.onlyFirstRowOnlyFirstColumn):
(.firstRowSecondColumn):
(.onlyFirstRowOnlySecondColumn):
(.secondRowFirstColumn):
(.onlySecondRowOnlyFirstColumn):
(.secondRowSecondColumn):
(.onlySecondRowOnlySecondColumn):
(.endSecondRowEndSecondColumn):
(.thirdRowSecondColumn):
(.firstRowThirdColumn):
(.secondRowThirdColumn):
(.firstRowFourthColumn):
(.secondRowFourthColumn):
(.firstAutoRowSecondAutoColumn):
(.autoLastRowAutoLastColumn):
(.autoSecondRowAutoFirstColumn):
(.firstRowBothColumn):
(.secondRowBothColumn):
(.bothRowFirstColumn):
(.bothRowSecondColumn):
(.bothRowBothColumn):
(.autoRowAutoColumn):
(.firstRowAutoColumn):
(.secondRowAutoColumn):
(.thirdRowAutoColumn):
(.autoRowFirstColumn):
(.autoRowSecondColumn):
(.autoRowThirdColumn):
(.autoRowAutoColumnSpanning2):
(.autoRowSpanning2AutoColumn):
(.autoRowSpanning2AutoColumnSpanning3):
(.autoRowSpanning3AutoColumnSpanning2):
(.autoRowFirstColumnSpanning2):
(.autoRowSecondColumnSpanning2):
(.firstRowSpanning2AutoColumn):
(.secondRowSpanning2AutoColumn):
(.gridAutoFlowColumnSparse):
(.gridAutoFlowColumnDense):
(.gridAutoFlowRowSparse):
(.gridAutoFlowRowDense):
(.constrainedContainer):
(.unconstrainedContainer):
(.sizedToGridArea):
(.verticalRL):
(.verticalLR):
(.horizontalTB):
(.directionRTL):
(.directionLTR):
* web-platform-tests/css/css-grid/grid-definition/support/testing-utils.js:
(checkGridTemplateRows): Convert the passed computed style to an Array in case it is just an string.
* web-platform-tests/css/css-grid/grid-definition/support/w3c-import.log:
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

Indefinitely sized containers use the specified definite min-size (if any) as available
space in order to compute the number of auto repeat tracks to create. A bug in that code was
causing the grid to be one track larger than expected. That was only happening in the case
of the free space being a multiple of the total size of the autorepeat tracks.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229897 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed build fix.
ryanhaddad@apple.com [Fri, 23 Mar 2018 16:38:09 +0000 (16:38 +0000)]
Unreviewed build fix.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229896 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
magomez@igalia.com [Fri, 23 Mar 2018 15:29:30 +0000 (15:29 +0000)]
[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
https://bugs.webkit.org/show_bug.cgi?id=183892

Source/WebCore:

Reviewed by Žan Doberšek.

Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
conversion during the painting. This way we don't need to swap the R and B components on the CPU.
Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
remove the UpdateContentsFlag as we never need to modify the original image data.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/BitmapTexture.h:
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL):
(WebCore::BitmapTextureGL::didReset):
(WebCore::BitmapTextureGL::updateContents):
(WebCore::BitmapTextureGL::applyFilters):
(WebCore::swizzleBGRAToRGBA): Deleted.
(WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
* platform/graphics/texmap/BitmapTextureGL.h:
(WebCore::BitmapTextureGL::colorConvertFlags const):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::acquireTexture):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::get):
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawNumber):
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintIntoSurface):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperTile.cpp:
(WebCore::TextureMapperTile::updateContents):
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::updateContents):
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().

Reviewed by Žan Doberšek.

* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):

Source/WebKitLegacy/win:

Remove the UpdateContentsFlag parameter as it's not used anymore.

Reviewed by Žan Doberšek.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::acceleratedCompositingAvailable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229895 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWebProcess memory monitor thresholds should be better tuned for embedded systems.
clopez@igalia.com [Fri, 23 Mar 2018 12:41:44 +0000 (12:41 +0000)]
WebProcess memory monitor thresholds should be better tuned for embedded systems.
https://bugs.webkit.org/show_bug.cgi?id=183773

Reviewed by Yusuke Suzuki.

Take into account the total system RAM for the thresholds calculation.

For systems with more than 3GB the conservative and strict thresholds remain as they are,
but for systems with less RAM the thresholds are dynamically configured as follows:

- Conservative threshold (release non critical memory) if WebProcess using more than 33% of the total RAM.
- Strict threshold (release all possible memory) if WebProcess using more than 50% of the total RAM.

The Kill threshold is also modified. Now it is capped at 90% of the total RAM.

* wtf/MemoryPressureHandler.cpp:
(WTF::thresholdForMemoryKillWithProcessState):
(WTF::thresholdForPolicy):
(WTF::MemoryPressureHandler::shrinkOrDie):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229894 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WTF] Add standard containers with FastAllocator specialization
utatane.tea@gmail.com [Fri, 23 Mar 2018 12:34:08 +0000 (12:34 +0000)]
[WTF] Add standard containers with FastAllocator specialization
https://bugs.webkit.org/show_bug.cgi?id=183789

Reviewed by Darin Adler.

Source/JavaScriptCore:

* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::testDoubleLiteralComparison):
(JSC::B3::testFloatEqualOrUnorderedFoldingNaN):
* dfg/DFGGraph.h:
* dfg/DFGIntegerCheckCombiningPhase.cpp:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::switchStringSlow):
* runtime/FunctionHasExecutedCache.h:
* runtime/TypeLocationCache.h:

Source/WebCore:

* Modules/indexeddb/IDBKeyData.h:
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/webauthn/cbor/CBORValue.h:
It did not use FastAllocator for its container.

* page/WheelEventTestTrigger.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:
* rendering/OrderIterator.h:

Source/WTF:

Sometimes we want standard containers due to various reasons.
For example, WTF::HashMap lacks the ability to hold all the
integer keys since it uses 0 for empty value and -1 for deleted
value. However, using std::containers use std::allocator without
specialization.

This patch introduces WTF::{StdMap, StdSet, StdList, StdUnorderedMap, StdUnorderedSet}.
They are standard containers with FastAllocator specialization.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/StdList.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229893 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[FTL] Fix ArrayPush(ArrayStorage)'s abstract heap
utatane.tea@gmail.com [Fri, 23 Mar 2018 12:32:40 +0000 (12:32 +0000)]
[FTL] Fix ArrayPush(ArrayStorage)'s abstract heap
https://bugs.webkit.org/show_bug.cgi?id=182960

Reviewed by Saam Barati.

This patch fixes ArrayPush(ArrayStorage)'s abstract heap.
It should always touch ArrayStorage_vector. To unify
vector setting code for the real ArrayStorage_vector and
ScratchBuffer, we use ArrayStorage_vector.atAnyIndex() to
annotate this.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Web Animations] infinite repeat counts aren't reflected for CSS Animations
graouts@webkit.org [Fri, 23 Mar 2018 11:49:04 +0000 (11:49 +0000)]
[Web Animations] infinite repeat counts aren't reflected for CSS Animations
https://bugs.webkit.org/show_bug.cgi?id=183932

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-computed-timing-expected.txt:
* css-animations/test_animation-finish-expected.txt:

Source/WebCore:

The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):

LayoutTests:

One of the Mozilla tests now passes completely and reliably.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Web Animations] Correctly cancel animations when a parent gets a "display: none...
graouts@webkit.org [Fri, 23 Mar 2018 11:47:26 +0000 (11:47 +0000)]
[Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
https://bugs.webkit.org/show_bug.cgi?id=183919

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

A number of tests now pass thanks to correctly canceling animations when a parent element in the hierarchy gets a
"display: none" style or if an element with animations is removed.

* css-animations/test_animation-cancel-expected.txt:
* css-animations/test_document-get-animations-expected.txt:
* css-animations/test_effect-target-expected.txt:
* css-transitions/test_animation-cancel-expected.txt:
* css-transitions/test_effect-target-expected.txt:

Source/WebCore:

The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
sure we don't create extra RefPtr<> objects.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
element is removed.
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
a pseudo-element is removed.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
for all children elements when an element gets a "display: none" style.

LayoutTests:

Three of the imported Mozilla tests now pass reliably, removing them from the list of flaky failure and timeout tests.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229890 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Web Animations] Animated transform styles are ignored when calling getComputedStyle()
graouts@webkit.org [Fri, 23 Mar 2018 11:45:40 +0000 (11:45 +0000)]
[Web Animations] Animated transform styles are ignored when calling getComputedStyle()
https://bugs.webkit.org/show_bug.cgi?id=183918

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

We obtain one more PASS by correctly serializing the transform property on getComputedStyle().

* css-animations/test_animation-cancel-expected.txt:

LayoutTests/imported/w3c:

We obtain a number of progressions by correctly serializing the transform property on getComputedStyle().

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt:

Source/WebCore:

Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
transform is applied for an element. Looking at the RenderStyle is preferable because in the case
of animations running on the compositor, such as a transform-only animation or transition, the
renderer doesn't necessarily have a transform style on it, since we don't blend properties in
software as the animation progresses. Instead, all of the blending is performed by the compositor,
and only the computed style object has the software-blended transform style on it.

We do need to account for inline renderers though as these do not support transforms.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTransform):

LayoutTests:

We obtain a number of progressions by correctly serializing the transform property on getComputedStyle().

* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Web Animations] Support "transition: all" for CSS Transitions as Web Animations
graouts@webkit.org [Fri, 23 Mar 2018 11:42:31 +0000 (11:42 +0000)]
[Web Animations] Support "transition: all" for CSS Transitions as Web Animations
https://bugs.webkit.org/show_bug.cgi?id=183917

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions thanks to supporting "transition: all".

* css-transitions/test_animation-finished-expected.txt:
* css-transitions/test_csstransition-transitionproperty-expected.txt:
* css-transitions/test_effect-target-expected.txt:
* css-transitions/test_element-get-animations-expected.txt:
* css-transitions/test_pseudoElement-get-animations-expected.txt:

Source/WebCore:

We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
property.

* animation/AnimationTimeline.cpp:
(WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
all backing Animation objects found in the old style that match the conditions enforced by the new method
shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
with a "transition: all" style. If we're dealing with a single property, we only process that single property.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
since we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
for backing Animation objects to determine whether their respective properties match since this would compare the
"property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
which indicates that we don't care about matching the transition property itself.
* animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
CSSTransition to get at the transition property.
* platform/animation/Animation.cpp:
(WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
* platform/animation/Animation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229888 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Fri, 23 Mar 2018 08:53:06 +0000 (08:53 +0000)]
Unreviewed GTK+ gardening.

Add a port-specific baseline for fast/css/apple-system-control.html.

Mark http/wpt/service-workers tests as a mix of failures and passes,
since a lot of the tests pass now that service workers were enabled, but
the passing ones are still in minority and there's additionally flaky
tests. This should improve after necessary testing SW directories are
properly specified.

In contrast, a bunch of SW-reliant tests under
imported/w3c/web-platform-tests/streams are now passing consistently.
Failure expectations for these are removed.

Failue expectations for three compositing tests are also removed after
r229804 fixed them.

* platform/gtk/TestExpectations:
* platform/gtk/fast/css/apple-system-control-colors-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229887 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed build fix for GCC 4.9 builds.
zandobersek@gmail.com [Fri, 23 Mar 2018 08:46:09 +0000 (08:46 +0000)]
Unreviewed build fix for GCC 4.9 builds.

* assembler/MacroAssemblerCodeRef.h: std::is_trivially_copyable<> isn't
supported in 4.9 libstdc++, so wrap the static assert using it in a
COMPILER_SUPPORTS() macro, and use __is_trivially_copyable() builtin,
as is done in bitwise_cast() in StdLibExtras.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229886 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WPE][GTK] Fix -Wswitch warnings after r229778
mcatanzaro@igalia.com [Fri, 23 Mar 2018 07:56:08 +0000 (07:56 +0000)]
[WPE][GTK] Fix -Wswitch warnings after r229778
https://bugs.webkit.org/show_bug.cgi?id=183927

Reviewed by Carlos Garcia Campos.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
received as a PolicyAction
* UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
which should be invisible to WebKit clients

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229885 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed. Run JSC GLib API tests in GTK+ and WPE bots.
carlosgc@webkit.org [Fri, 23 Mar 2018 07:49:14 +0000 (07:49 +0000)]
Unreviewed. Run JSC GLib API tests in GTK+ and WPE bots.

The test runners were still considering the JSC tests as google tests, but they are now GLib tests.

* Scripts/run-gtk-tests:
(GtkTestRunner.is_glib_test):
(GtkTestRunner.is_google_test):
* Scripts/run-wpe-tests:
(WPETestRunner.is_glib_test):
(WPETestRunner.is_google_test):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229884 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
timothy_horton@apple.com [Fri, 23 Mar 2018 06:53:26 +0000 (06:53 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
https://bugs.webkit.org/show_bug.cgi?id=183930
<rdar://problem/38782249>

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/CopyPALHeaders.xcconfig:
* Configurations/PAL.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoVersioning.
jmarcell@apple.com [Fri, 23 Mar 2018 05:33:55 +0000 (05:33 +0000)]
Versioning.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229882 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r229876.
commit-queue@webkit.org [Fri, 23 Mar 2018 05:11:45 +0000 (05:11 +0000)]
Unreviewed, rolling out r229876.
https://bugs.webkit.org/show_bug.cgi?id=183929

Some webrtc tests are timing out on iOS simulator (Requested
by youenn on #webkit).

Reverted changeset:

"Use libwebrtc ObjectiveC H264 encoder and decoder"
https://bugs.webkit.org/show_bug.cgi?id=183912
https://trac.webkit.org/changeset/229876

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229881 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoExpose more system colors via CSS
megan_gardner@apple.com [Fri, 23 Mar 2018 04:04:57 +0000 (04:04 +0000)]
Expose more system colors via CSS
https://bugs.webkit.org/show_bug.cgi?id=183764
<rdar://problem/36975898>

Reviewed by Tim Horton.

Test: fast/css/apple-system-control-colors.html

Expose Apple specific system colors via CSS.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229880 268f45cc-cd09-0410-ab3c-d52691b4dbfc