WebKit-https.git
13 months ago[GTK][WPE] Update baseline for fast/dom/navigator-detached-no-crash
csaavedra@igalia.com [Mon, 17 Sep 2018 14:36:36 +0000 (14:36 +0000)]
[GTK][WPE] Update baseline for fast/dom/navigator-detached-no-crash

In GTK it's just a matter of updating the baseline. In WPE
there's some JS output that just needs to be ignored.
* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/TestExpectations:

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

13 months ago[WPE] Mark crashing animations test.
csaavedra@igalia.com [Mon, 17 Sep 2018 14:09:19 +0000 (14:09 +0000)]
[WPE] Mark crashing animations test.

animations/play-state-start-paused.html crashing.
Unreviewed gardening.
* platform/wpe/TestExpectations:

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

13 months ago[WPE] Unmark now passing tests
csaavedra@igalia.com [Mon, 17 Sep 2018 12:23:51 +0000 (12:23 +0000)]
[WPE] Unmark now passing tests

Unreviewed gardening.
* platform/wpe/TestExpectations:

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

13 months ago[GTK] Unmark now passing tests.
csaavedra@igalia.com [Mon, 17 Sep 2018 12:07:04 +0000 (12:07 +0000)]
[GTK] Unmark now passing tests.

Unreviewed gardening.
* platform/gtk/TestExpectations:

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

13 months agoUnreviewed, fix incorrect WPE build fix made in r236009
mcatanzaro@igalia.com [Mon, 17 Sep 2018 11:23:13 +0000 (11:23 +0000)]
Unreviewed, fix incorrect WPE build fix made in r236009

This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
type is not actually used anywhere in this header. Actually, the problematic function is no
longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
so remove it.

* UIProcess/API/wpe/WebKitScriptDialog.h:
* UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
(webkitScriptDialogRun): Deleted.

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

13 months ago[JHBuild] Update to GStreamer 1.14.3
philn@webkit.org [Mon, 17 Sep 2018 11:06:44 +0000 (11:06 +0000)]
[JHBuild] Update to GStreamer 1.14.3
https://bugs.webkit.org/show_bug.cgi?id=189450

Reviewed by Xabier Rodriguez-Calvar.

* gstreamer/jhbuild.modules: Bump GStreamer modules from 1.14.1 to 1.14.3.

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

13 months ago[JHBuild] Doesn't check sha256 sums
philn@webkit.org [Mon, 17 Sep 2018 08:30:03 +0000 (08:30 +0000)]
[JHBuild] Doesn't check sha256 sums
https://bugs.webkit.org/show_bug.cgi?id=189646

Reviewed by Michael Catanzaro.

* gstreamer/jhbuild.modules: Properly set the sha256: prefix on hashes.

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

13 months agoMove IndexedDB to Network Process
sihui_liu@apple.com [Mon, 17 Sep 2018 07:11:55 +0000 (07:11 +0000)]
Move IndexedDB to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189415
<rdar://problem/44396973>

Reviewed by Chris Dumez.

Source/WebKit:

We are going to eliminate storage process and move its functionality to network process.
The reasons why we want to do this:
1. Lower resource usage of having an additional process for storage operations, especially
memory. Single storage process takes about 5MB memory on macOS.
2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
regression in app launch. The launch time of storage process is partly attributed to this:
Service Workers delay page loading until receiving response from storage process.
3. We choose network process because UI process may have broader access in file system
that we don't want the storage operations to have.

This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
to corresponding components of network process. Moving of Service Worker and stopping to
launch storage process will be done in following patches.

We expect to see the higher cpu and memory usage of network process as it is taking more work,
but the overall gain in memory and latency after we completely remove storage process should be
positive.

* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::didCloseFromServer):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

Code moved from StorageToWebProcessConnection::didReceiveMessage.

(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

Network process receives and stores sandbox extension of temporary files for later indexedDB
use.

(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::ensurePathExists):
(WebKit::NetworkProcess::postStorageTask):
(WebKit::NetworkProcess::performNextStorageTask):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):

Instead of asking UI process to grant sandbox extension to storage process, now network
process just asks for sandbox extension fot itself.

(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::idbServer): Deleted.
(WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
(WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
(WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
(WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
(WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::queue): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::generateIDBConnectionToServerIdentifier): Deleted.
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
(WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
(TEST):

LayoutTests:

* storage/indexeddb/modern/opendatabase-after-storage-crash.html:

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

13 months agoUnreviewed test gardening, mark fast/text/variations/ipc2.html as slow.
ryanhaddad@apple.com [Mon, 17 Sep 2018 00:35:31 +0000 (00:35 +0000)]
Unreviewed test gardening, mark fast/text/variations/ipc2.html as slow.

* platform/mac-wk2/TestExpectations:

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

13 months agoWeb Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
drousso@apple.com [Sat, 15 Sep 2018 18:41:58 +0000 (18:41 +0000)]
Web Inspector: REGRESSION: breakpoint context menu appears twice in DOM tree
https://bugs.webkit.org/show_bug.cgi?id=189308

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMBreakpointTreeController.js:
(WI.DOMBreakpointTreeController.appendBreakpointContextMenuItems):
Set a symbol on the `contextMenu` to ensure that the same items are not added twice.

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

13 months agoStreamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
darin@apple.com [Sat, 15 Sep 2018 16:17:24 +0000 (16:17 +0000)]
Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=189455

Reviewed by Keith Miller.

Source/JavaScriptCore:

* API/JSObjectRef.cpp:
(OpaqueJSPropertyNameArray): Use Ref<OpaqueJSString> instead of
JSRetainPtr<JSStringRef>.
(JSObjectCopyPropertyNames): Remove now-unneeded use of leakRef and
adopt constructor.
(JSPropertyNameArrayGetNameAtIndex): Use ptr() instead of get() since
the array elements are now Ref.

* API/JSRetainPtr.h: While JSRetainPtr is written as a template,
it only works for two specific unrelated types, JSStringRef and
JSGlobalContextRef. Simplified the default constructor using data
member initialization. Prepared to make the adopt constructor private
(got everything compiling that way, then made it public again so that
Apple internal software will still build). Got rid of unneeded
templated constructor and assignment operator, since it's not relevant
since there is no inheritance between JSRetainPtr template types.
Added WARN_UNUSED_RETURN to leakRef as in RefPtr and RetainPtr.
Added move constructor and move assignment operator for slightly better
performance. Simplified implementations of various member functions
so they are more obviously correct, by using leakPtr in more of them
and using std::exchange to make the flow of values more obvious.

* API/JSValue.mm:
(+[JSValue valueWithNewSymbolFromDescription:inContext:]): Added a
missing JSStringRelease to fix a leak.

* API/tests/CustomGlobalObjectClassTest.c:
(customGlobalObjectClassTest): Added a JSGlobalContextRelease to fix a leak.
(globalObjectSetPrototypeTest): Ditto.
(globalObjectPrivatePropertyTest): Ditto.

* API/tests/ExecutionTimeLimitTest.cpp:
(testResetAfterTimeout): Added a call to JSStringRelease to fix a leak.
(testExecutionTimeLimit): Ditto, lots more.

* API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides): Added a call to JSStringRelease to fix a leak.

* API/tests/JSObjectGetProxyTargetTest.cpp:
(testJSObjectGetProxyTarget): Added a call to JSGlobalContextRelease to fix
a leak.

* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow): Added calls to JSGlobalContextRelease and
JSStringRelease to fix leaks.

* API/tests/testapi.c:
(throwException): Added. Helper function for repeated idiom where we want
to throw an exception, but with additional JSStringRelease calls so we don't
have to leak just to keep the code simpler to read.
(MyObject_getProperty): Use throwException.
(MyObject_setProperty): Ditto.
(MyObject_deleteProperty): Ditto.
(isValueEqualToString): Added. Helper function for an idiom where we check
if something is a string and then if it's equal to a particular string
constant, but a version that has an additional JSStringRelease call so we
don't have to leak just to keep the code simpler to read.
(MyObject_callAsFunction): Use isValueEqualToString and throwException.
(MyObject_callAsConstructor): Ditto.
(MyObject_hasInstance): Ditto.
(globalContextNameTest): Added a JSGlobalContextRelease to fix a leak.
(testMarkingConstraintsAndHeapFinalizers): Ditto.

Source/WebCore:

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Adding a missing
JSStringRelease to fix a leak.

Source/WebKit:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSString): Use adopt function instead of adopt construuctor.
(WebKit::evaluate): Ditto.
(WebKit::evaluateJavaScriptCallback): Ditto.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.

Tools:

There is a lot of copied and pasted code for WebKit vs. Legacy WebKit
testing and even for macOS vs. iOS vs. Windows platform-specific code.
For now, this patch just makes corresponding changes to the copied code.
Later we might get better results by merging more code instead of having
all these separate copies.

* DumpRenderTree/AccessibilityController.cpp:
(AccessibilityController::makeWindowObject): Use the adopt function
instead of the special Adopt constructor of JSRetainPtr.

* DumpRenderTree/AccessibilityTextMarker.cpp: Removed unneeded include.

* DumpRenderTree/AccessibilityUIElement.cpp: Ditto.
(allAttributesCallback): Don't adopt at this level; changed the
underlying function to return a JSRetainPtr so the adopt is right next
to the call to the create or copy function.
(attributesOfLinkedUIElementsCallback): Ditto.
(attributesOfDocumentLinksCallback): Ditto.
(attributesOfChildrenCallback): Ditto.
(parameterizedAttributeNamesCallback): Ditto.
(attributesOfColumnHeadersCallback): Ditto.
(attributesOfRowHeadersCallback): Ditto.
(attributesOfColumnsCallback): Ditto.
(attributesOfRowsCallback): Ditto.
(attributesOfVisibleCellsCallback): Ditto.
(attributesOfHeaderCallback): Ditto.
(rowIndexRangeCallback): Ditto.
(columnIndexRangeCallback): Ditto.
(rangeForLineCallback): Ditto.
(boundsForRangeCallback): Ditto.
(rangeForPositionCallback): Ditto.
(stringForRangeCallback): Ditto.
(attributedStringForRangeCallback): Ditto.
(uiElementCountForSearchPredicateCallback): Use the free adopt
function instead of the adopt member function.
(uiElementForSearchPredicateCallback): Ditto.
(selectTextWithCriteriaCallback): Don't adopt at this level.
(attributedStringForElementCallback): Ditto.
(setValueCallback): Use free adopt.
(stringAttributeValueCallback): Don't adopt at this level.
(uiElementArrayAttributeValueCallback): Ditto.
(uiElementAttributeValueCallback): Ditto.
(stringForTextMarkerRangeCallback): Ditto.
(attributedStringForTextMarkerRangeCallback): Ditto.
(attributedStringForTextMarkerRangeWithOptionsCallback): Ditto.
(getARIADropEffectsCallback): Ditto.
(getClassListCallback): Ditto.
(getRoleCallback): Ditto.
(getSubroleCallback): Ditto.
(getRoleDescriptionCallback): Ditto.
(getComputedRoleStringCallback): Ditto.
(getTitleCallback): Ditto.
(getDescriptionCallback): Ditto.
(getStringValueCallback): Ditto.
(getLanguageCallback): Ditto.
(getHelpTextCallback): Ditto.
(getOrientationCallback): Ditto.
(getPathDescriptionCallback): Ditto.
(getSelectedTextRangeCallback): Ditto.
(speakAsCallback): Ditto.
(getValueDescriptionCallback): Ditto.
(getAccessibilityValueCallback): Ditto.
(getDocumentEncodingCallback): Ditto.
(getDocumentURICallback): Ditto.
(getURLCallback): Ditto.
(characterAtOffsetCallback): Ditto.
(wordAtOffsetCallback): Ditto.
(lineAtOffsetCallback): Ditto.
(sentenceAtOffsetCallback): Ditto.
(stringForSelectionCallback): Ditto.
(getIdentifierCallback): Ditto.
(getTraitsCallback): Ditto.
(supportedActionsCallback): Ditto.
(mathPostscriptsDescriptionCallback): Ditto.
(mathPrescriptsDescriptionCallback): Ditto.
(AccessibilityUIElement::rangeForLine): Updated to return JSRetainPtr.
(AccessibilityUIElement::rangeForPosition): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.

* DumpRenderTree/AccessibilityUIElement.h: Use JSRetainPtr instead of
raw pointers for the results of the functions that create strings.
The old way was difficult to get right; the functions didn't even follow
the create/copy naming rule.

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
(_platformTypeConstructor): Use the adopt function instead of the
JSRetainPtr adopt constructor. Also nullptr instead of 0.

* DumpRenderTree/GCController.cpp:
(GCController::makeWindowObject): Use adopt function instead of constructor.

* DumpRenderTree/TestRunner.cpp:
(pathToLocalResourceCallback): Use adopt function instead of constructor.
(addDisallowedURLCallback): Ditto.
(addURLToRedirectCallback): Ditto.
(clearApplicationCacheForOriginCallback): Ditto.
(applicationCacheDiskUsageForOriginCallback): Ditto.
(decodeHostNameCallback): Don't adopt at this level.
(encodeHostNameCallback): Ditto.
(execCommandCallback): Use adopt instead of JSRetainPtr::adopt.
(findStringCallback): Use adopt function instead of constructor.
(isCommandEnabledCallback): Ditto.
(overridePreferenceCallback): Ditto.
(queueLoadCallback): Ditto.
(queueLoadHTMLStringCallback): Ditto.
(queueLoadingScriptCallback): Ditto.
(queueNonLoadingScriptCallback): Ditto.
(setAuthenticationPasswordCallback): Ditto.
(setAuthenticationUsernameCallback): Ditto.
(setDomainRelaxationForbiddenForURLSchemeCallback): Ditto.
(setMockGeolocationPositionUnavailableErrorCallback): Ditto.
(setPOSIXLocaleCallback): Ditto.
(setPersistentUserStyleSheetLocationCallback): Ditto.
(setUserStyleSheetLocationCallback): Ditto.
(setValueForUserCallback): Ditto.
(setWillSendRequestClearHeaderCallback): Ditto.
(setPageVisibilityCallback): Ditto.
(evaluateInWebInspectorCallback): Ditto.
(evaluateScriptInIsolatedWorldCallback): Ditto.
(evaluateScriptInIsolatedWorldAndReturnValueCallback): Ditto.
(addOriginAccessWhitelistEntryCallback): Ditto.
(removeOriginAccessWhitelistEntryCallback): Ditto.
(setScrollbarPolicyCallback): Ditto.
(addUserScriptCallback): Ditto.
(addUserStyleSheetCallback): Ditto.
(apiTestNewWindowDataLoadBaseURLCallback): Ditto.
(authenticateSessionCallback): Ditto.
(getTitleTextDirectionCallback): Ditto.
(getInspectorTestStubURLCallback): Ditto.
(simulateLegacyWebNotificationClickCallback): Ditto.
(setTextDirectionCallback): Ditto.
(grantWebNotificationPermissionCallback): Ditto.
(denyWebNotificationPermissionCallback): Ditto.
(accummulateLogsForChannel): Ditto.
(runUIScriptCallback): Ditto.
(TestRunner::makeWindowObject): Ditto.
(TestRunner::uiScriptDidComplete): Ditto.
(TestRunner::setOpenPanelFiles): Ditto.

* DumpRenderTree/TestRunner.h: Use JSRetainPtr instead of
raw pointers for the results of the functions that create strings.

* DumpRenderTree/ios/AccessibilityControllerIOS.mm:
(AccessibilityController::platformName const): Use the adopt
function instead of the adopt constructor.

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(concatenateAttributeAndValue): Changed to return a JSRetainPtr.
(AccessibilityUIElement::identifier): Ditto.
(AccessibilityUIElement::traits): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::stringForSelection): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::attributedStringForElement): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::allAttributes): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::classList const): Ditto.

* DumpRenderTree/mac/AccessibilityCommonMac.h: Changed the
createJSStringRef method to return a JSRetainPtr.
* DumpRenderTree/mac/AccessibilityCommonMac.mm:
(-[NSString createJSStringRef]): Ditto.
(searchPredicateParameterizedAttributeForSearchCriteria): Use the
adopt function instead of the adopt constructor.
* DumpRenderTree/mac/AccessibilityControllerMac.mm:
(AccessibilityController::platformName const): Ditto.

* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
(makeValueRefForValue): Updated for the above, no adopt needed here now.
(makeObjectRefForDictionary): Ditto.
(-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(concatenateAttributeAndValue): Changed to return a JSRetainPtr.
(descriptionOfElements): Ditto.
(selectTextParameterizedAttributeForCriteria): Ditto.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::allAttributes): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::classList const): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::rangeForLine): Ditto.
(AccessibilityUIElement::rangeForPosition): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(createJSStringRef): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(AccessibilityUIElement::supportedActions): Ditto.
(AccessibilityUIElement::mathPostscriptsDescription const): Ditto.
(AccessibilityUIElement::mathPrescriptsDescription const): Ditto.

* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
Use the adopt function instead of the adopt constructor.
* DumpRenderTree/mac/TestRunnerMac.mm:
(originsArrayToJS): Ditto.
(TestRunner::copyDecodedHostName): Return a JSRetainPtr.
(TestRunner::copyEncodedHostName): Ditto.
(TestRunner::pathToLocalResource): Ditto.
(TestRunner::queueLoad): Use adopt function instead of constructor.
(TestRunner::findString): Ditto.
(TestRunner::inspectorTestStubURL): Return a JSRetainPtr.

* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::winNotificationReceived): Use adopt function
instead of adopt constructor.
(AccessibilityController::platformName const): Ditto.

* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(AccessibilityUIElement::allAttributes): Changed to return a JSRetainPtr.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::classList const): Ditto.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::copyDecodedHostName): Changed to return a JSRetainPtr.
(TestRunner::copyEncodedHostName): Ditto.
(TestRunner::pathToLocalResource): Ditto.
(TestRunner::queueLoad): Ditto.
(TestRunner::findString): Ditto.
(TestRunner::inspectorTestStubURL): Ditto.

* TestRunnerShared/Bindings/JSWrapper.h:
(WTR::setProperty): Use adopt function instead of constructor.
* TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::UIScriptContext): Ditto.
(UIScriptContext::runUIScript): Ditto.
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::toDeviceOrientation): Ditto.

* TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(nsTextCheckingType): Changed this function to not take an rvalue
reference to a JSRetainPtr since it doesn't take ownership.
(-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Updated
for the above change.

* TestWebKitAPI/JavaScriptTest.cpp:
(TestWebKitAPI::javaScriptCallback): Use adopt function instead of
adopt member function.

* TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp: Removed unneeded include.
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm: Ditto.
* TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Use adopt function instead of
adopt constructor.
* TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm: Ditto.

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
Removed unneeded includes.
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Ditto.

* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_platformTypeConstructor): Use the adopt function instead of the
JSRetainPtr adopt constructor. Also nullptr instead of 0.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::arrayLength): Use adopt function instead of constructor.
(WTR::parseModifierArray): Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::propertyValue): Ditto.
(WTR::dumpPath): Ditto.
(WTR::toJS): Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::findString): Ditto.
(WTR::TestRunner::statisticsDidRunTelemetryCallback): Ditto.
(WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback): Ditto.
(WTR::TestRunner::setOpenPanelFiles): Ditto.
* WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
(WTR::AccessibilityController::platformName): Ditto.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
This fixes storage leaks in many functions below, which were using
the create function and putting the value right into a JSRetainPtr
without adoption.
(WTR::createEmptyJSString): Added. This helper function reduces the
repetitive code to create empty strings.
(WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
Use createEmptyJSString, fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(WTR::AccessibilityUIElement::attributesOfChildren): Ditto.
(WTR::AccessibilityUIElement::allAttributes): Ditto.
(WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
(WTR::AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(WTR::AccessibilityUIElement::role): Ditto.
(WTR::AccessibilityUIElement::subrole): Ditto.
(WTR::AccessibilityUIElement::roleDescription): Ditto.
(WTR::AccessibilityUIElement::computedRoleString): Ditto.
(WTR::AccessibilityUIElement::title): Ditto.
(WTR::AccessibilityUIElement::orientation const): Ditto.
(WTR::AccessibilityUIElement::language): Ditto.
(WTR::AccessibilityUIElement::valueDescription): Ditto.
(WTR::AccessibilityUIElement::ariaDropEffects const): Ditto.
(WTR::AccessibilityUIElement::boundsForRange): Ditto.
(WTR::AccessibilityUIElement::stringForRange): Removed unneeded null check.
(WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
Use createEmptyJSString, fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(WTR::AccessibilityUIElement::attributesOfColumns): Ditto.
(WTR::AccessibilityUIElement::attributesOfRows): Ditto.
(WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(WTR::AccessibilityUIElement::attributesOfHeader): Ditto.
(WTR::AccessibilityUIElement::selectedTextRange): Ditto.
(WTR::AccessibilityUIElement::accessibilityValue const): Ditto.
(WTR::AccessibilityUIElement::documentEncoding): Ditto.
(WTR::AccessibilityUIElement::documentURI): Ditto.
(WTR::AccessibilityUIElement::stringForSelection): Removed unneeded
null check.
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
Use createEmptyJSString, fixing a storage leak due to missing adoption.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h:
Use JSRetainPtr for the return value of createJSStringRef.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
(-[NSString createJSStringRef]): Ditto.
(WTR::searchPredicateParameterizedAttributeForSearchCriteria): Use the
adopt function instead of the adopt constructor.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::AccessibilityController::platformName): Ditto

* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
(makeValueRefForValue): Updated for above by removing adopt.
(makeObjectRefForDictionary): Ditto.
(-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
(WTR::descriptionOfElements): Ditto.
(WTR::selectTextParameterizedAttributeForCriteria): Ditto.
(WTR::AccessibilityUIElement::accessibilityValue const): Use createEmptyJSString,
fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::documentEncoding): Ditto.
(WTR::AccessibilityUIElement::documentURI): Ditto.
(WTR::createJSStringRef): Return a JSRetainPtr.

* WebKitTestRunner/StringFunctions.h:
(WTR::toWK): Take a const& to eliminate a little bit of reference count churn.
(WTR::toJS): Use the adopt function instead of the constructor.

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

13 months ago2018-09-15 Rob Buis <rbuis@igalia.com>
rwlbuis@webkit.org [Sat, 15 Sep 2018 14:08:47 +0000 (14:08 +0000)]
2018-09-15  Rob Buis  <rbuis@igalia.com>

        XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
        https://bugs.webkit.org/show_bug.cgi?id=189627

        Reviewed by Alexey Proskuryakov.

        Right now we return an empty Blob without type when the response is empty, but
        it should always include the type [1].

        Test: web-platform-tests/xhr/overridemimetype-blob.html

        [1] https://xhr.spec.whatwg.org/#blob-response

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createResponseBlob):

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

13 months agoUnreviewed, rolling out r236020.
jlewis3@apple.com [Sat, 15 Sep 2018 01:20:27 +0000 (01:20 +0000)]
Unreviewed, rolling out r236020.

This caused an api failure on High Sierra

Reverted changeset:

"Refactoring related to Safe Browsing"
https://bugs.webkit.org/show_bug.cgi?id=189631
https://trac.webkit.org/changeset/236020

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

13 months ago[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
Basuke.Suzuki@sony.com [Sat, 15 Sep 2018 00:46:47 +0000 (00:46 +0000)]
[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
https://bugs.webkit.org/show_bug.cgi?id=189530

Reviewed by Alex Christensen.

Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
Source/WebCore:

Also respondEnd was not correctly recorded and fixed.

No new tests because it cannot be measured from DRT.

* platform/network/ResourceHandleInternal.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::setStartTime):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueAfterWillSendRequest):

Source/WebKit:

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:

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

13 months agoWeb Inspector: Source View doesn't scroll to show line when breakpoint is hit inside...
commit-queue@webkit.org [Sat, 15 Sep 2018 00:39:59 +0000 (00:39 +0000)]
Web Inspector: Source View doesn't scroll to show line when breakpoint is hit inside of <script> in HTML resource
https://bugs.webkit.org/show_bug.cgi?id=189638
<rdar://problem/43359278>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-09-14
Reviewed by Matt Baker.

Pausing in Document resources on page load have special considerations where we
may not receive their full content immediately, so we may synthesize inline script
content for the resource until we have full content. Unfortunately, when we get
full content and update the TextEditor we were losing the revealed position and
other editor information. This change specifically targets those cases, by
re-applying editor state when updating such a resource from partial to full content.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._contentAvailable):
Signal to the editor that when updating the content it should carry
over editor state. Only do this if we had partial content before.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor):
(WI.TextEditor.prototype.set repeatReveal):
Provide a way to signal we should restore state when update the content.

(WI.TextEditor.set string.update):
(WI.TextEditor.prototype.set string):
When repeatReveal was enabled, restore editor state such as the
revealed location and text selection.

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

13 months agoAdditional tests for conic gradients
megan_gardner@apple.com [Sat, 15 Sep 2018 00:33:58 +0000 (00:33 +0000)]
Additional tests for conic gradients
https://bugs.webkit.org/show_bug.cgi?id=189566

Reviewed by Simon Fraser.

Adding tests that actually test the gradient nature of gradients.
This is done by using an svg filter to consolidate the sections
of the gradient to sections we can actuall test the color of. Also,
the seams are clipped out, to reduce noise. Since gradients are
highly noise prone, this is the best way to check and make sure
that gradients are functional without sevear noise issues.

* TestExpectations:
* fast/gradients/conic-gradient-alpha-expected.html: Added.
* fast/gradients/conic-gradient-alpha.html: Added.
* fast/gradients/conic-gradient-expected.html: Added.
* fast/gradients/conic-gradient-extended-stops-expected.html: Added.
* fast/gradients/conic-gradient-extended-stops.html: Added.
* fast/gradients/conic-gradient.html: Added.
* platform/ios-12/TestExpectations:
* platform/mac/TestExpectations:

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

13 months agoAdd Justin Michaud.
dino@apple.com [Sat, 15 Sep 2018 00:22:46 +0000 (00:22 +0000)]
Add Justin Michaud.

* Scripts/webkitpy/common/config/contributors.json:

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

13 months agoWebGL 2 conformance: rgb-format-support.html
justin_fan@apple.com [Sat, 15 Sep 2018 00:05:22 +0000 (00:05 +0000)]
WebGL 2 conformance: rgb-format-support.html
https://bugs.webkit.org/show_bug.cgi?id=189610
<rdar://problem/44403343>

Reviewed by Dean Jackson.

Source/WebCore:

Implementing getInternalformatParameter (emulating on macOS) and updating
renderbufferStorage{Multisample} for WebGL 2 conformance.

Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::isRenderableInternalformat):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
(WebCore::WebGL2RenderingContext::renderbufferStorage):
(WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
(WebCore::WebGL2RenderingContext::isIntegerFormat):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getInternalformativ):
(WebCore::GraphicsContext3D::renderbufferStorageMultisample):

LayoutTests:

Enabled rgb-format-support.html, and updated expectation for gl-teximage.html.

* TestExpectations:
* platform/mac/TestExpectations:
* webgl/2.0.0/conformance2/rendering/rgb-format-support-expected.txt:

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

13 months agoAdd support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics...
commit-queue@webkit.org [Fri, 14 Sep 2018 23:55:37 +0000 (23:55 +0000)]
Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
https://bugs.webkit.org/show_bug.cgi?id=5968

Source/WebCore:

Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
the result of multiplying stop-opacity with the opacity of the color.

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-09-14
Reviewed by Simon Fraser.

Tests: svg/gradients/spreadMethod-expected.svg
       svg/gradients/spreadMethod.svg
       svg/gradients/spreadMethodAlpha-expected.svg
       svg/gradients/spreadMethodAlpha.svg
       svg/gradients/spreadMethodClose0-expected-mismatch.svg
       svg/gradients/spreadMethodClose0.svg
       svg/gradients/spreadMethodClose1-expected-mismatch.svg
       svg/gradients/spreadMethodClose1.svg
       svg/gradients/spreadMethodClose2-expected.svg
       svg/gradients/spreadMethodClose2.svg
       svg/gradients/spreadMethodDiagonal-expected.svg
       svg/gradients/spreadMethodDiagonal.svg
       svg/gradients/spreadMethodDiagonal2-expected.svg
       svg/gradients/spreadMethodDiagonal2.svg
       svg/gradients/spreadMethodDuplicateStop-expected.svg
       svg/gradients/spreadMethodDuplicateStop.svg
       svg/gradients/spreadMethodReversed-expected.svg
       svg/gradients/spreadMethodReversed.svg
       svg/gradients/stopAlpha-expected.svg
       svg/gradients/stopAlpha.svg

* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):

LayoutTests:

Add new svg tests for linear gradients with spreadMethod, and alpha values specified in
both stop-opacity and color.

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-09-14
Reviewed by Simon Fraser.

* platform/mac/svg/W3C-SVG-1.1/pservers-grad-10-b-expected.png:
* svg/gradients/spreadMethod-expected.svg: Added.
* svg/gradients/spreadMethod.svg: Added.
* svg/gradients/spreadMethodAlpha-expected.svg: Added.
* svg/gradients/spreadMethodAlpha.svg: Added.
* svg/gradients/spreadMethodClose0-expected-mismatch.svg: Added.
* svg/gradients/spreadMethodClose0.svg: Added.
* svg/gradients/spreadMethodClose1-expected-mismatch.svg: Added.
* svg/gradients/spreadMethodClose1.svg: Added.
* svg/gradients/spreadMethodClose2-expected.svg: Added.
* svg/gradients/spreadMethodClose2.svg: Added.
* svg/gradients/spreadMethodDiagonal-expected.svg: Added.
* svg/gradients/spreadMethodDiagonal.svg: Added.
* svg/gradients/spreadMethodDiagonal2-expected.svg: Added.
* svg/gradients/spreadMethodDiagonal2.svg: Added.
* svg/gradients/spreadMethodDuplicateStop-expected.svg: Added.
* svg/gradients/spreadMethodDuplicateStop.svg: Added.
* svg/gradients/spreadMethodReversed-expected.svg: Added.
* svg/gradients/spreadMethodReversed.svg: Added.
* svg/gradients/stopAlpha-expected.svg: Added.
* svg/gradients/stopAlpha.svg: Added.

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

13 months ago[WinCairo] Unreviewed test gardening.
ross.kirsling@sony.com [Fri, 14 Sep 2018 23:54:09 +0000 (23:54 +0000)]
[WinCairo] Unreviewed test gardening.

* TestExpectations: Remove duplicative line introduced in r235959.
* platform/wincairo/TestExpectations:

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

13 months agoDon't dump OSRAvailabilityData in Graph::dump because a stale Availability may point...
sbarati@apple.com [Fri, 14 Sep 2018 23:47:55 +0000 (23:47 +0000)]
Don't dump OSRAvailabilityData in Graph::dump because a stale Availability may point to a Node that is already freed
https://bugs.webkit.org/show_bug.cgi?id=189628
<rdar://problem/39481690>

Reviewed by Mark Lam.

JSTests:

* stress/verbose-failure-dont-graph-dump-availability-already-freed.js: Added.
(foo):

Source/JavaScriptCore:

An Availability may point to a Node. And that Node may be removed from
the graph, e.g, it's freed and its memory is no longer owned by Graph.
This patch makes it so we no longer dump this metadata by default. If
this metadata is interesting to you, you'll need to go in and change
Graph::dump to dump the needed metadata.

* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):

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

13 months agoAdd stability to tests for web API statistics
commit-queue@webkit.org [Fri, 14 Sep 2018 23:15:27 +0000 (23:15 +0000)]
Add stability to tests for web API statistics
https://bugs.webkit.org/show_bug.cgi?id=189560
<rdar://problem/44396413>

Patch by Woodrow Wang <woodrow_wang@apple.com> on 2018-09-14
Reviewed by Chris Dumez.

Using js-test added some data to the font loading collection, which made the tests dependent on
js-test.js. Thus, if any changes were made to js-test.js the tests for web API statistics would
fail. This patch removes the dependency on js-test. Also, this patch speeds up each test
significantly by bypassing the timer in ResourceLoadObserver for recording the statistics.

* http/tests/webAPIStatistics/canvas-read-and-write-data-collection-expected.txt:
* http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:
* http/tests/webAPIStatistics/font-load-data-collection-expected.txt:
* http/tests/webAPIStatistics/font-load-data-collection.html:
* http/tests/webAPIStatistics/navigator-functions-accessed-data-collection-expected.txt:
* http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html:
* http/tests/webAPIStatistics/screen-functions-accessed-data-collection-expected.txt:
* http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html:

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

13 months agoRefactoring related to Safe Browsing
commit-queue@webkit.org [Fri, 14 Sep 2018 22:09:30 +0000 (22:09 +0000)]
Refactoring related to Safe Browsing
https://bugs.webkit.org/show_bug.cgi?id=189631

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-14
Reviewed by Tim Horton.

Make SafeBrowsingResult RefCounted.
Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
(WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
(WebKit::WebPageProxy::startDrag): Deleted.
(WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
(WebKit::WebPageProxy::setDragCaretRect): Deleted.
(WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
(WebKit::WebPageProxy::platformCloneAttachment): Deleted.
* UIProcess/SafeBrowsingResult.h:
(WebKit::SafeBrowsingResult::create):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:

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

13 months agoClarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
ggaren@apple.com [Fri, 14 Sep 2018 21:59:27 +0000 (21:59 +0000)]
Clarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
https://bugs.webkit.org/show_bug.cgi?id=189634

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKUIDelegate.h:

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

13 months agoRefactor some ForInContext code for better encapsulation.
mark.lam@apple.com [Fri, 14 Sep 2018 21:00:21 +0000 (21:00 +0000)]
Refactor some ForInContext code for better encapsulation.
https://bugs.webkit.org/show_bug.cgi?id=189626
<rdar://problem/44466415>

Reviewed by Keith Miller.

1. Add a ForInContext::m_type field to store the context type.  This does not
   increase the class size, but eliminates the need for a virtual call to get the
   type.

   Note: we still need a virtual destructor because we'll be mingling
   IndexedForInContexts and StructureForInContexts in the BytecodeGenerator::m_forInContextStack.

2. Add ForInContext::isIndexedForInContext() and ForInContext::isStructureForInContext()
   convenience methods.

3. Add ForInContext::asIndexedForInContext() and ForInContext::asStructureForInContext()
   to do the casting to the subclass types.  This ensures that we'll properly
   assert that the casting is legal.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetByVal):
(JSC::BytecodeGenerator::popIndexedForInScope):
(JSC::BytecodeGenerator::popStructureForInScope):
* bytecompiler/BytecodeGenerator.h:
(JSC::ForInContext::type const):
(JSC::ForInContext::isIndexedForInContext const):
(JSC::ForInContext::isStructureForInContext const):
(JSC::ForInContext::asIndexedForInContext):
(JSC::ForInContext::asStructureForInContext):
(JSC::ForInContext::ForInContext):
(JSC::StructureForInContext::StructureForInContext):
(JSC::IndexedForInContext::IndexedForInContext):
(JSC::ForInContext::~ForInContext): Deleted.

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

13 months agoUnreviewed, attempt to fix the iOSMac build after r236015.
ryanhaddad@apple.com [Fri, 14 Sep 2018 20:36:45 +0000 (20:36 +0000)]
Unreviewed, attempt to fix the iOSMac build after r236015.

* platform/graphics/cv/PixelBufferResizer.mm:
(WebCore::PixelBufferResizer::PixelBufferResizer):

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

13 months agoMake GraphicsLayers ref-counted, so their tree can persist when disconnected from...
simon.fraser@apple.com [Fri, 14 Sep 2018 19:49:46 +0000 (19:49 +0000)]
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521

Reviewed by Tim Horton.
Source/WebCore:

Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.

RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.

All the other changes are just to adapt to the new ownership patterns.

I verified that no GraphicsLayers were leaked or abandoned after this change.

No behavior change.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.

RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.

Added some helper functions to null out a RefPtr<GraphicsLayer> after removing from the tree,
clearing the client. GraphicsLayer.m_client becomes a pointer, so it can be set to point to a singleton
empty client when a GraphicsLayer gets detached from its owner. More explicit layer unparenting,
and removed some unnecessary parent checks, and redundant unparenting.

Other changes are just to adapt to the new ownership patterns.

I verified that no GraphicsLayers were leaked or abandoned after this change.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):
(WebKit::WebInspectorClient::showPaintRect):
(WebKit::WebInspectorClient::animationEndedForLayer):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::createGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

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

13 months agoSupport arbitrary video resolution in getUserMedia API
eric.carlson@apple.com [Fri, 14 Sep 2018 19:01:41 +0000 (19:01 +0000)]
Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=178109
<rdar://problem/35083128>

Reviewed by Youenn Fablet.

Source/WebCore:

Support arbitrary video resolutions by configuring the camera to capture at the closest
larger size it supports and scaling/cropping frames as necessary.

No new tests, existing tests updated.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MediaStreamAudioSource::settings): Ditto.
(WebCore::MediaStreamAudioSource::capabilities const): Deleted.
(WebCore::MediaStreamAudioSource::settings const): Deleted.
* Modules/webaudio/MediaStreamAudioSource.h:

* SourcesCocoa.txt: Add PixelBufferResizer.

* WebCore.xcodeproj/project.pbxproj: Ditto.

* platform/cocoa/CoreVideoSoftLink.h:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:

* platform/graphics/cv/PixelBufferResizer.h: Added.
(WebCore::PixelBufferResizer::canResizeTo):
* platform/graphics/cv/PixelBufferResizer.mm: Added.
(WebCore::PixelBufferResizer::PixelBufferResizer):
(WebCore::PixelBufferResizer::resize):

* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingAudioSource::settings): Ditto.
(WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingAudioSource.h:

* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingVideoSource::settings): Ditto.
(WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingVideoSource.h:

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsConstraint):
(WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::presets):
(WebCore::RealtimeVideoSource::setSupportedPresets):
(WebCore::standardVideoSizes):
(WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
(WebCore::presetSupportsFrameRate):
(WebCore::RealtimeVideoSource::supportsCaptureSize):
(WebCore::RealtimeVideoSource::shouldUsePreset):
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
(WebCore::VideoPresetData::encode const):
(WebCore::VideoPresetData::decode):
(WebCore::VideoPreset::create):
(WebCore::VideoPreset::VideoPreset):
(WebCore::RealtimeVideoSource::prefersPreset):
(WebCore::RealtimeVideoSource::canResizeVideoFrames const):
(WebCore::RealtimeVideoSource::setDefaultSize):
(WebCore::RealtimeVideoSource::observedFrameRate const):
(WebCore::VideoPreset::encode const): Deleted.
(WebCore::VideoPreset::decode): Deleted.

* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::videoPresets): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoPreset::create):
(WebCore::AVVideoPreset::AVVideoPreset):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::settings):
(WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::AVVideoCaptureSource::setFrameRate):
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::isFrameRateSupported):
(WebCore::AVVideoCaptureSource::generatePresets):
(WebCore::updateSizeMinMax): Deleted.
(WebCore::updateAspectRatioMinMax): Deleted.
(WebCore::AVVideoCaptureSource::settings const): Deleted.
(WebCore::AVVideoCaptureSource::capabilities const): Deleted.
(WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
(WebCore::AVVideoCaptureSource::setPreset): Deleted.
(WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
(WebCore::CoreAudioCaptureSource::settings const): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
(WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
(WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
(WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:

* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
* platform/mock/MockMediaDevice.h:
(WebCore::MockCameraProperties::decode):

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
(WebCore::MockRealtimeAudioSource::settings const): Deleted.
(WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
* platform/mock/MockRealtimeAudioSource.h:

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Change video device presets to trigger resize code more often.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::generatePresets):
(WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
(WebCore::MockRealtimeVideoSource::settings const): Deleted.
* platform/mock/MockRealtimeVideoSource.h:

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:

Source/WebKit:

* WebProcess/cocoa/UserMediaCaptureManager.cpp:

LayoutTests:

* fast/mediastream/MediaStreamTrack-getCapabilities-expected.txt:
* fast/mediastream/apply-constraints-advanced-expected.txt:
* fast/mediastream/apply-constraints-advanced.html:
* fast/mediastream/apply-constraints-video.html:

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

13 months agobots should pass --clobber-old-results to run-webkit-tests
ryanhaddad@apple.com [Fri, 14 Sep 2018 18:47:27 +0000 (18:47 +0000)]
bots should pass --clobber-old-results to run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=189623

Reviewed by Aakash Jain.

In order to ensure that bots to not produce confusing results due to transient execptions,
or run out of space if they continually hit an exception, old layout test results should be clobbered.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunWebKitTests):

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

13 months agoBug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTagged...
commit-queue@webkit.org [Fri, 14 Sep 2018 18:33:44 +0000 (18:33 +0000)]
Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
https://bugs.webkit.org/show_bug.cgi?id=189541

Patch by Frederic Wang <fwang@igalia.com> on 2018-09-14
Reviewed by Alex Christensen.

FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
FontTaggedSettings::hash() template function. This instantiation may happen before
FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
we declare full specialization of the hash() functions in FontTaggedSettings.h.

No new tests, behavior unchanged.

* platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
* platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().

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

13 months ago[Curl][WebKit] Bug fix for continuously retrying with empty credentials.
Basuke.Suzuki@sony.com [Fri, 14 Sep 2018 18:28:29 +0000 (18:28 +0000)]
[Curl][WebKit] Bug fix for continuously retrying with empty credentials.
https://bugs.webkit.org/show_bug.cgi?id=189601

Reviewed by Alex Christensen.

Added stop condition for empty credentials passed by client.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
* NetworkProcess/curl/NetworkDataTaskCurl.h:

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

13 months agoUnreviewed, rolling out r235990.
ryanhaddad@apple.com [Fri, 14 Sep 2018 18:17:42 +0000 (18:17 +0000)]
Unreviewed, rolling out r235990.

Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS

Reverted changeset:

"Enable USE_MEDIAREMOTE on iOS"
https://bugs.webkit.org/show_bug.cgi?id=189096
https://trac.webkit.org/changeset/235990

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

13 months agoTurn SourceBufferChangeTypeEnabled on by default
jer.noble@apple.com [Fri, 14 Sep 2018 17:03:35 +0000 (17:03 +0000)]
Turn SourceBufferChangeTypeEnabled on by default
https://bugs.webkit.org/show_bug.cgi?id=189527

Reviewed by Eric Carlson.

Source/WebCore:

* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

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

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

13 months agoUnreviewed, speculative WPE build fix after r236004
mcatanzaro@igalia.com [Fri, 14 Sep 2018 16:50:14 +0000 (16:50 +0000)]
Unreviewed, speculative WPE build fix after r236004
https://bugs.webkit.org/show_bug.cgi?id=189545

* UIProcess/API/wpe/WebKitScriptDialog.h:

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

13 months agoWeb Inspector: Record actions performed on ImageBitmapRenderingContext
webkit@devinrousso.com [Fri, 14 Sep 2018 16:44:22 +0000 (16:44 +0000)]
Web Inspector: Record actions performed on ImageBitmapRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=181341

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Recording.json:
* inspector/scripts/codegen/generator.py:

Source/WebCore:

Test: inspector/canvas/recording-bitmaprenderer.html

* html/canvas/ImageBitmapRenderingContext.idl:

* inspector/InspectorCanvas.cpp:
(WebCore::shouldSnapshotBitmapRendererAction):
(WebCore::InspectorCanvas::recordAction):

* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):

* page/PageConsoleClient.cpp:
(canvasRenderingContext):

Source/WebInspectorUI:

* UserInterface/Models/Recording.js:
(WI.Recording.fromPayload):
(WI.Recording.prototype.createContext):

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction._prototypeForType):
(WI.RecordingAction.prototype.getImageParameters):

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._classNameForAction.classNameForActionName):

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.get navigationItems):
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.shown):
(WI.RecordingContentView.prototype.hidden):
(WI.RecordingContentView.prototype._generateContentFromSnapshot): Renamed.
(WI.RecordingContentView.prototype._updateImageGrid):
(WI.RecordingContentView.prototype._generateContentCanvasWebGL): Deleted.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):

LayoutTests:

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-bitmaprenderer-expected.txt: Added.
* inspector/canvas/recording-bitmaprenderer.html: Added.
* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl-snapshots-expected.txt:
* inspector/canvas/resources/recording-utilities.js:
Simplify the test output to avoid unrelated failures, such as if line numbers change.
Also remove non-human-readable text, as it makes it more difficult for those unfamiliar with
the test to determine if any differences are acceptable.

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

13 months agoREGRESSION (r235954): Fix build failure on watchOS
ddkilzer@apple.com [Fri, 14 Sep 2018 16:38:19 +0000 (16:38 +0000)]
REGRESSION (r235954): Fix build failure on watchOS
<https://webkit.org/b/189605>

Reviewed by Geoffrey Garen.

Remove `using WebCore::IndexedDB::KeyType;` from
Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
resulting build failures.

* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::isValid const):
(WebCore::IDBKey::compare const):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createNumber):
(WebCore::IDBKey::createDate):
(WebCore::IDBKey::type const):
(WebCore::IDBKey::array const):
(WebCore::IDBKey::string const):
(WebCore::IDBKey::date const):
(WebCore::IDBKey::number const):
(WebCore::IDBKey::binary const):
(WebCore::IDBKey::compareTypes):
(WebCore::IDBKey::IDBKey):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey const):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare const):
(WebCore::IDBKeyData::loggingString const):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setBinaryValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
(WebCore::IDBKeyData::isValid const):
(WebCore::IDBKeyData::operator== const):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::minimum):
(WebCore::IDBKeyData::maximum):
(WebCore::IDBKeyData::type const):
(WebCore::IDBKeyData::hash const):
(WebCore::IDBKeyData::string const):
(WebCore::IDBKeyData::date const):
(WebCore::IDBKeyData::number const):
(WebCore::IDBKeyData::binary const):
(WebCore::IDBKeyData::array const):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):

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

13 months ago[EME] Add support the waitingforkey event
calvaris@igalia.com [Fri, 14 Sep 2018 15:37:14 +0000 (15:37 +0000)]
[EME] Add support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=189616

Reviewed by Philippe Normand.

Crossplatform support to fire the waitingforkey event from the
player to the element. The element implements the W3C specified
algorithm.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
(WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::waitingForKey):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):

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

13 months agobuiltins directory causes name conflict on Python 3
commit-queue@webkit.org [Fri, 14 Sep 2018 15:16:09 +0000 (15:16 +0000)]
builtins directory causes name conflict on Python 3
https://bugs.webkit.org/show_bug.cgi?id=189552

Patch by Mike Gorse <mgorse@suse.com> on 2018-09-14
Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* CMakeLists.txt: builtins -> wkbuiltins.
* DerivedSources.make: builtins -> wkbuiltins.
* Scripts/generate-js-builtins.py: import wkbuiltins, rather than
  builtins.
* Scripts/wkbuiltins/__init__.py: Renamed from Source/JavaScriptCore/Scripts/builtins/__init__.py.
* Scripts/wkbuiltins/builtins_generate_combined_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py.
* Scripts/wkbuiltins/builtins_generate_internals_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py.
* Scripts/wkbuiltins/builtins_generate_separate_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py.
* Scripts/wkbuiltins/builtins_generate_separate_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py.
* Scripts/wkbuiltins/builtins_generate_wrapper_header.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_header.py.
* Scripts/wkbuiltins/builtins_generate_wrapper_implementation.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generate_wrapper_implementation.py.
* Scripts/wkbuiltins/builtins_generator.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_generator.py.
* Scripts/wkbuiltins/builtins_model.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_model.py.
* Scripts/wkbuiltins/builtins_templates.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins_templates.py.
* Scripts/wkbuiltins/wkbuiltins.py: Renamed from Source/JavaScriptCore/Scripts/builtins/builtins.py.
* JavaScriptCore.xcodeproj/project.pbxproj: Update for the renaming.

Source/WebCore:

No new tests (No behavior change).

* CMakeLists.txt: builtins -> wkbuiltins.
* DerivedSources.make: builtins -> wkbuiltins.

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

13 months ago[GTK] Make script dialogs modal to the current web view only
carlosgc@webkit.org [Fri, 14 Sep 2018 11:01:06 +0000 (11:01 +0000)]
[GTK] Make script dialogs modal to the current web view only
https://bugs.webkit.org/show_bug.cgi?id=189545

Reviewed by Michael Catanzaro.

Source/WebCore/platform/gtk/po:

* POTFILES.in:

Source/WebKit:

Change the default implementation of script dialogs to use an embedded window, like the HTTP auth dialog,
instead of a GtkMessageDialog. This patch adds a base class WebKitWebViewDialog shared by
WebKitAuthenticationDialog and the new WebKitScriptDialogImpl.

* SourcesGTK.txt: Add new files to compilation.
* UIProcess/API/glib/WebKitScriptDialogPrivate.h:
* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
(webkitAuthenticationDialogInitialize): Do not use a frame and use a better styled title.
(webkit_authentication_dialog_class_init): Remove implementation of vfuncs that are now implemented by the
parent.
* UIProcess/API/gtk/WebKitAuthenticationDialog.h:
* UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
(webkitScriptDialogAccept): Use WebKitScriptDialogImpl API.
(webkitScriptDialogDismiss): Ditto.
(webkitScriptDialogSetUserInput): Ditto.
* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: Added.
(webkitScriptDialogImplClose):
(webkitScriptDialogImplKeyPressEvent):
(webkitScriptDialogImplMap):
(webkitScriptDialogImplConstructed):
(webkitScriptDialogImplDispose):
(webkit_script_dialog_impl_class_init):
(webkitScriptDialogImplAddButton):
(webkitScriptDialogImplNew):
(webkitScriptDialogImplCancel):
(webkitScriptDialogImplConfirm):
(webkitScriptDialogImplSetEntryText):
* UIProcess/API/gtk/WebKitScriptDialogImpl.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewChildIsInternalWidget): Rename authenticationDialog as just dialog.
(webkitWebViewBaseAddDialog): Ditto.
(webkitWebViewBaseContainerRemove): Ditto.
(webkitWebViewBaseContainerForall): Ditto.
(webkitWebViewBaseConstructed): Ditto.
(webkitWebViewBaseSizeAllocate): Ditto.
(webkitWebViewBaseKeyPressEvent): Ditto.
(webkitWebViewBaseHandleMouseEvent): Ditto.
(webkitWebViewBaseButtonPressEvent): Ditto.
(webkitWebViewBaseButtonReleaseEvent): Ditto.
(webkitWebViewBaseHandleWheelEvent): Ditto.
(webkitWebViewBaseScrollEvent): Ditto.
(webkitWebViewBaseMotionNotifyEvent): Ditto.
(webkitWebViewBaseCrossingNotifyEvent): Ditto.
(webkitWebViewBaseTouchEvent): Ditto.
(webkitWebViewBaseFocus): Ditto.
(webkitWebViewBaseDestroy): Ditto.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewDialog.cpp: Added.
(webkitWebViewDialogDraw):
(webkitWebViewDialogSizeAllocate):
(webkitWebViewDialogConstructed):
(webkit_web_view_dialog_class_init):
* UIProcess/API/gtk/WebKitWebViewDialog.h: Added.
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewAuthenticate):
(webkitWebViewScriptDialog):

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

13 months agoRemove some obsolete XHR tests
Ms2ger@igalia.com [Fri, 14 Sep 2018 07:20:01 +0000 (07:20 +0000)]
Remove some obsolete XHR tests
https://bugs.webkit.org/show_bug.cgi?id=189581

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

These tests were removed upstream, but stuck around in WebKit.

* web-platform-tests/xhr/OWNERS: Removed.
* web-platform-tests/xhr/abort-during-open-expected.txt: Removed.
* web-platform-tests/xhr/abort-during-open.htm: Removed.
* web-platform-tests/xhr/abort-during-open.js: Removed.
* web-platform-tests/xhr/abort-during-open.worker-expected.txt: Removed.
* web-platform-tests/xhr/abort-during-open.worker.html: Removed.
* web-platform-tests/xhr/abort-during-open.worker.js: Removed.
* web-platform-tests/xhr/getallresponseheaders-cl-expected.txt: Removed.
* web-platform-tests/xhr/getallresponseheaders-cl.htm: Removed.
* web-platform-tests/xhr/interfaces-expected.txt: Removed.
* web-platform-tests/xhr/interfaces.html: Removed.
* web-platform-tests/xhr/open-url-bogus-expected.txt: Removed.
* web-platform-tests/xhr/open-url-bogus.htm: Removed.
* web-platform-tests/xhr/overridemimetype-done-state-expected.txt: Removed.
* web-platform-tests/xhr/overridemimetype-done-state.htm: Removed.
* web-platform-tests/xhr/readme.txt: Removed.
* web-platform-tests/xhr/responsetype-expected.txt: Removed.
* web-platform-tests/xhr/responsetype.html: Removed.
* web-platform-tests/xhr/send-non-same-origin.sub-expected.txt: Removed.
* web-platform-tests/xhr/send-non-same-origin.sub.htm: Removed.
* web-platform-tests/xhr/send-send-expected.txt: Removed.
* web-platform-tests/xhr/send-send.htm: Removed.
* web-platform-tests/xhr/send-send.js: Removed.
* web-platform-tests/xhr/send-send.worker-expected.txt: Removed.
* web-platform-tests/xhr/send-send.worker.html: Removed.
* web-platform-tests/xhr/send-send.worker.js: Removed.
* web-platform-tests/xhr/send-usp-expected.txt: Removed.
* web-platform-tests/xhr/send-usp.html: Removed.
* web-platform-tests/xhr/send-usp.js: Removed.

LayoutTests:

* TestExpectations: Drop reference to removed test.

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

13 months agoCapturing event listeners are called during bubbling phase for shadow hosts
rniwa@webkit.org [Fri, 14 Sep 2018 05:56:19 +0000 (05:56 +0000)]
Capturing event listeners are called during bubbling phase for shadow hosts
https://bugs.webkit.org/show_bug.cgi?id=174288
LayoutTests/imported/w3c:

Reviewed by Darin Adler.

* web-platform-tests/dom/events/Event-dispatch-handlers-changed-expected.txt: Rebaselined. This test's
expectation is now wrong because event listner 3 is added after the event listener list is cloned for
capturing event listeners but before cloned for bubbling event listeners. As a result, event listener 3
is now invoked. It used to be not called because both bubbling and capturing event listeners are called
after cloning the event listner list once, which didn't have event listener 3.

* web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt: Rebaselined. This test expects
event listener 2, which is bubbling, to be called between two capturing event listeners 1 and 3, which
is no longer true after this patch.

Source/WebCore:

<rdar://problem/33530455>

Reviewed by Darin Adler.

Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
dispatched within its shadow tree.

To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
  section#hostParent
    + div#host -- ShadowRoot
                    - p#parent
                        - span#target
Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
the following order in WebKit & Chrome right now:

1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #parent, capturing, eventPhase: CAPTURING_PHASE
3. #target, capturing, eventPhase: AT_TARGET
4. #target, non-capturing, eventPhase: AT_TARGET
5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
6. #host, capturing, eventPhase: AT_TARGET
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE

This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
started. A more natural ordering would be:

1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #host, capturing, eventPhase: AT_TARGET
3. #parent, capturing, eventPhase: CAPTURING_PHASE
4. #target, capturing, eventPhase: AT_TARGET
5. #target, non-capturing, eventPhase: AT_TARGET
6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE

This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
event listeners on the event's target is invoked in the registration order. After this patch, all capturing
event listeners are invoked before bubbling event listeners are invoked.

To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.

Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html

* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
media controls before author scripts recieve the event.
(MediaControllerSupport.prototype.disable): Ditto.
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents const):
(WebCore::MouseOrFocusEventContext::handleLocalEvents const):
(WebCore::TouchEventContext::handleLocalEvents const):
* dom/EventContext.h:
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
the special code path for the event's target with the code in the bubbling phase.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::handleLocalEvents const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
(WebCore::EventTarget::fireEventListeners):
(WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
event listeners even when eventPhase is Event::Phase::AT_TARGET.
* dom/EventTarget.h:
* dom/Node.cpp:
(WebCore::Node::handleLocalEvents):
* dom/Node.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::handleLocalEvents):
* html/HTMLFormElement.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):

LayoutTests:

Reviewed by Darin Adler.

Added a W3C style testharness.js test and rebaselined two tests. See below for rationals of rebaselines.

* fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees-expected.txt: Added.
* fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html: Added.

* media/media-load-event-expected.txt: Rebaselined. The logging of oncanplaythrough event is now happening
before canplaythrough() is called because the logging is done by waitForEvent which uses a capturing event
listener whereas canplaythrough is called by a event handler, which is non-capturing.

* platform/ios-11/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt:

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

13 months agoUpdate webkit-webgl-test-harness.js for more details on WebGL 2 conformance tests...
justin_fan@apple.com [Fri, 14 Sep 2018 02:19:45 +0000 (02:19 +0000)]
Update webkit-webgl-test-harness.js for more details on WebGL 2 conformance tests part 4
https://bugs.webkit.org/show_bug.cgi?id=189609

Unreviewed small change for only the few webgl 2 tests' harness; completely passing
tests now only report the PASS line, to avoid discrepancies between e.g. feature ability
of different graphics cards causing diffs to fail.

* webgl/2.0.0/conformance2/glsl3/array-as-return-value-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-assign-constructor-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-assign-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-complex-indexing-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-element-increment-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-equality-expected.txt:
* webgl/2.0.0/conformance2/glsl3/array-in-complex-expression-expected.txt:
* webgl/2.0.0/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec-expected.txt:
* webgl/2.0.0/conformance2/glsl3/compare-structs-containing-arrays-expected.txt:
* webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination-expected.txt:
* webgl/2.0.0/conformance2/glsl3/const-array-init-expected.txt:
* webgl/2.0.0/conformance2/glsl3/forbidden-operators-expected.txt:
* webgl/2.0.0/conformance2/glsl3/frag-depth-expected.txt:
* webgl/2.0.0/conformance2/glsl3/invalid-default-precision-expected.txt:
* webgl/2.0.0/conformance2/glsl3/invalid-invariant-expected.txt:
* webgl/2.0.0/conformance2/glsl3/loops-with-side-effects-expected.txt:
* webgl/2.0.0/conformance2/glsl3/misplaced-version-directive-expected.txt:
* webgl/2.0.0/conformance2/glsl3/no-attribute-vertex-shader-expected.txt:
* webgl/2.0.0/conformance2/glsl3/sampler-no-precision-expected.txt:
* webgl/2.0.0/conformance2/glsl3/sequence-operator-returns-non-constant-expected.txt:
* webgl/2.0.0/conformance2/glsl3/shader-with-1025-character-define-expected.txt:
* webgl/2.0.0/conformance2/glsl3/shader-with-1025-character-identifier.frag-expected.txt:
* webgl/2.0.0/conformance2/glsl3/short-circuiting-in-loop-condition-expected.txt:
* webgl/2.0.0/conformance2/glsl3/texture-offset-out-of-range-expected.txt:
* webgl/2.0.0/conformance2/glsl3/texture-offset-uniform-texture-coordinate-expected.txt:
* webgl/2.0.0/conformance2/glsl3/tricky-loop-conditions-expected.txt:
* webgl/2.0.0/conformance2/glsl3/uniform-block-layout-match-expected.txt:
* webgl/2.0.0/conformance2/glsl3/uniform-block-layouts-expected.txt:
* webgl/2.0.0/conformance2/glsl3/vector-dynamic-indexing-expected.txt:
* webgl/2.0.0/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug-expected.txt:
* webgl/2.0.0/conformance2/renderbuffers/framebuffer-test-expected.txt:
* webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object-expected.txt:
* webgl/2.0.0/resources/webkit-webgl-test-harness.js:
(window.webglTestHarness.notifyFinished):

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

13 months agoLayout Test imported/w3c/web-platform-tests/streams/piping/error-propagation-backward...
ryanhaddad@apple.com [Fri, 14 Sep 2018 01:37:15 +0000 (01:37 +0000)]
Layout Test imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=188070

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark test as flaky.
* platform/mac-wk1/TestExpectations: Ditto.

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

13 months agoFix color stop blending in conic gradients for stops past 1
megan_gardner@apple.com [Fri, 14 Sep 2018 00:25:14 +0000 (00:25 +0000)]
Fix color stop blending in conic gradients for stops past 1
https://bugs.webkit.org/show_bug.cgi?id=189532
<rdar://problem/44158221>

Reviewed by Simon Fraser.

Source/WebCore:

Calculation was wrong, fixed it, and wrote a test that failed
without the change, and passes with it.

Test: fast/gradients/conic-repeating-last-stop.html

* css/CSSGradientValue.cpp:
(WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):

LayoutTests:

Tests that last stop in the gradient is correct.

* fast/gradients/conic-repeating-last-stop-expected.html: Added.
* fast/gradients/conic-repeating-last-stop.html: Added.
* platform/ios-12/TestExpectations:
* platform/mac/TestExpectations:

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

13 months agoWeb Inspector: Dark Mode: bezier curve editor should be updated
commit-queue@webkit.org [Fri, 14 Sep 2018 00:08:35 +0000 (00:08 +0000)]
Web Inspector: Dark Mode: bezier curve editor should be updated
https://bugs.webkit.org/show_bug.cgi?id=187657

Patch by Jamal Nasser <jamaln@mail.com> on 2018-09-13
Reviewed by Matt Baker.

* UserInterface/Views/DarkMode.css:
(@media (prefers-dark-interface)):
(.bezier-editor > .bezier-preview-timing):
(.bezier-editor > .bezier-container .bezier-curve):
(.bezier-editor > .bezier-container .linear-curve):
(.bezier-editor > .bezier-preview):
(.bezier-editor > .bezier-preview > div):
(.bezier-editor > .bezier-container .control-handle):
(.bezier-editor > .bezier-container .control-line):

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

13 months agoWeb Inspector: Timelines: clicking a row in Script > Events grid triggers Location...
mattbaker@apple.com [Fri, 14 Sep 2018 00:03:05 +0000 (00:03 +0000)]
Web Inspector: Timelines: clicking a row in Script > Events grid triggers Location popover when column is hidden
https://bugs.webkit.org/show_bug.cgi?id=189603
<rdar://problem/44431403>

Reviewed by Joseph Pecoraro.

TimelineDataGrid controls showing/hiding the call frame popover, with subclasses
overriding callFramePopoverAnchorElement to position it. This patch adds
another overridable base class method, shouldShowCallFramePopover, which subclasses
can use to block the popover when the Location column is hidden.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.layout):
(WI.DataGrid.prototype._positionResizerElements):
(WI.DataGrid.prototype._isColumnVisible): Deleted.

* UserInterface/Views/LayoutTimelineDataGrid.js:
(WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.LayoutTimelineDataGrid):

* UserInterface/Views/ScriptTimelineDataGrid.js:
(WI.ScriptTimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.ScriptTimelineDataGrid):

* UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.TimelineDataGrid.prototype._dataGridSelectedNodeChanged):

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

13 months agoWeb Inspector: Opening inspector with a selected element might immediately scroll...
commit-queue@webkit.org [Thu, 13 Sep 2018 23:58:41 +0000 (23:58 +0000)]
Web Inspector: Opening inspector with a selected element might immediately scroll that element off screen in the DOM Tree outline
https://bugs.webkit.org/show_bug.cgi?id=189569
<rdar://problem/44397098>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-09-13
Reviewed by Devin Rousso.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.layout):
Re-select the selected DOM node in the DOM Tree when the view resizes.
Typically this can happen if the sidebar opens/closes/resizes, in which
case we will want the selected DOM node to stay in view even if the DOM
tree starts wrapping earlier content.

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

13 months agoUnreviewed, rolling out r235954.
ryanhaddad@apple.com [Thu, 13 Sep 2018 22:50:39 +0000 (22:50 +0000)]
Unreviewed, rolling out r235954.

Breaks the watchOS build.

Reverted changeset:

"Move IndexedDB to Network Process"
https://bugs.webkit.org/show_bug.cgi?id=189415
https://trac.webkit.org/changeset/235954

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

13 months agoRegression(PSON): setting window.opener to null allows process swapping in cases...
cdumez@apple.com [Thu, 13 Sep 2018 22:38:25 +0000 (22:38 +0000)]
Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
https://bugs.webkit.org/show_bug.cgi?id=189590
<rdar://problem/44422725>

Reviewed by Geoffrey Garen.

Source/WebCore:

Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.

Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
(WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/Page.h:
(WebCore::Page::openedViaWindowOpenWithOpener const):
(WebCore::Page::setOpenedViaWindowOpenWithOpener):

Source/WebKit:

If script calls window.open() without 'noopener' and the newly navigated window gets navigated cross-site,
we are currently unable to process-swap because the opener has a WindowProxy handle to this new Window and
may interact with it (which we currently do not support cross-process). We were dealing with this by not
process-swapping if window.opener is not null. This works most of the time but is not sufficient because the
opener may get nulled out, while the opener still has a valid WindowProxy handle to its openee.

Therefore, we now also check for a flag indicating if the frame was opened via window.open() without
'nooopener'. We still need to check if the browsing context has an opener for browsing context created
via <a target="_blank"> for example (the opener does not have a handle to the new window but the openee
has access to its opener).

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::openedViaWindowOpenWithOpener const):
(API::Navigation::setOpenedViaWindowOpenWithOpener):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

LayoutTests:

Add layout test coverage.

* http/tests/navigation/resources/navigate-helper.html: Added.
* http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin-expected.txt: Added.
* http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html: Added.

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

13 months agoGenerate warnings for Preferences files
dino@apple.com [Thu, 13 Sep 2018 22:33:10 +0000 (22:33 +0000)]
Generate warnings for Preferences files
https://bugs.webkit.org/show_bug.cgi?id=189573

Reviewed by Sam Weinig.

Generate the "DO NOT EDIT" warnings, rather than have
them in the template (which was confusing).

While here, simplify some of the templating generation code
to avoid duplication.

* Scripts/GeneratePreferences.rb:
* Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:

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

13 months agoWebPageProxy::reportPageLoadResult can crash on some code paths
krollin@apple.com [Thu, 13 Sep 2018 22:32:33 +0000 (22:32 +0000)]
WebPageProxy::reportPageLoadResult can crash on some code paths
https://bugs.webkit.org/show_bug.cgi?id=189568

Reviewed by Chris Dumez.

WebPageProxy::reportPageLoadResult (which is called from
WebPageProxy::didFinishLoadForFrame) can sometimes crash when
accessing m_pageLoadStart (a std::optional) in its unloaded state.
Normally, m_pageLoadStart is initialized in
WebPageProxy::didStartProvisionalLoadForFrame, which one would expect
would be called before WebPageProxy::didFinishLoadForFrame. But that
turns out to not always be the case. It's not apparent under what
conditions didStartProvisionalLoadForFrame will not be called, but
it's happening in the wild, leading to crashes now that std::optional
asserts in release builds on bad accesses (see
https://bugs.webkit.org/show_bug.cgi?id=189568).

Fix this by checking m_pageLoadState on entry to reportPageLoadResult.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::reportPageLoadResult):

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Thu, 13 Sep 2018 22:28:30 +0000 (22:28 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

Missed this test header.

* webanimations/accelerated-transition-interrupted-on-composited-element.html:

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

13 months agoEnable USE_MEDIAREMOTE on iOS
jer.noble@apple.com [Thu, 13 Sep 2018 22:19:40 +0000 (22:19 +0000)]
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096

Reviewed by Eric Carlson.

Source/WebCore:

Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.

Source/WTF:

* wtf/Platform.h:

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

13 months ago[WebAssembly] Inline WasmContext accessor functions
yusukesuzuki@slowstart.org [Thu, 13 Sep 2018 21:49:47 +0000 (21:49 +0000)]
[WebAssembly] Inline WasmContext accessor functions
https://bugs.webkit.org/show_bug.cgi?id=189416

Reviewed by Saam Barati.

WasmContext accessor functions are very small while it resides in the critical path of
JS to Wasm function call. This patch makes them inline to improve performance.
This change improves a small benchmark (calling JS to Wasm function 1e7 times) from 320ms to 270ms.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* interpreter/CallFrame.cpp:
* jit/AssemblyHelpers.cpp:
* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmContextInlines.h: Renamed from Source/JavaScriptCore/wasm/WasmContext.cpp.
(JSC::Wasm::Context::useFastTLS):
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmMemoryInformation.cpp:
* wasm/WasmModuleParser.cpp: Include <wtf/SHA1.h> due to changes of unified source combinations.
* wasm/js/JSToWasm.cpp:
* wasm/js/WebAssemblyFunction.cpp:

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

13 months agoProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy:...
cdumez@apple.com [Thu, 13 Sep 2018 20:52:34 +0000 (20:52 +0000)]
ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame()
https://bugs.webkit.org/show_bug.cgi?id=189599

Reviewed by Geoffrey Garen.

The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case
of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the
process we're reattaching to already has a WebPage (with a main frame), in which case
WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame.

The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we
detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess).
It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history
navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process.
For example, no SuspendedPageProxy may be available for the history navigation because the history
was restored to a new view from disk, or because the WebBackForwardListItem no longer has a
SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem).

Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations
is incorrect and we should instead check if we're reattaching to a SuspendedPage's process.

Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and
existing Back/Forward PSON API tests which are still passing.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:

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

13 months agoAdd release logging to help debug PSON issues
cdumez@apple.com [Thu, 13 Sep 2018 20:44:43 +0000 (20:44 +0000)]
Add release logging to help debug PSON issues
https://bugs.webkit.org/show_bug.cgi?id=189562

Reviewed by Ryosuke Niwa.

Add release logging to help debug issues related to process swap on navigation.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:

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

13 months agoRemove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 20:11:01 +0000 (20:11 +0000)]
Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
https://bugs.webkit.org/show_bug.cgi?id=189576

Reviewed by Alex Christensen.

Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
statements, but "friend LazyNeverDestroyed<X>".

No new tests (No behavior change).

* css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
statement.
* css/CSSInitialValue.h: Ditto.
* css/CSSPrimitiveValue.h: Ditto.
* css/CSSRevertValue.h: Ditto.
* css/CSSUnsetValue.h: Ditto.

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

13 months agohttps://bugs.webkit.org/show_bug.cgi?id=189594
dino@apple.com [Thu, 13 Sep 2018 19:44:57 +0000 (19:44 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=189594

Mark this test as failing on WK1.

* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

13 months agoAdd null check for drawing area in WebPage::didCompletePageTransition() after r235867
cdumez@apple.com [Thu, 13 Sep 2018 19:18:13 +0000 (19:18 +0000)]
Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
https://bugs.webkit.org/show_bug.cgi?id=189587

Reviewed by Geoffrey Garen.

Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
as this is causing crashes on the bots.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Thu, 13 Sep 2018 19:11:27 +0000 (19:11 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

Add feature headers to more tests.

* fast/animation/css-animation-resuming-when-visible-with-style-change2.html:
* legacy-animation-engine/animations/duplicate-keys-expected.html:

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

13 months ago[GLib] Fix format string in KeyedEncoderGlib::beginObject().
Ms2ger@igalia.com [Thu, 13 Sep 2018 19:08:47 +0000 (19:08 +0000)]
[GLib] Fix format string in KeyedEncoderGlib::beginObject().
https://bugs.webkit.org/show_bug.cgi?id=189585

Reviewed by Michael Catanzaro.

This appears to fix the following assertion locally:

GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed

Covered by existing tests.

* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::beginObject):

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

13 months agoAdd Copy WebKit Permalink plugin for Sublime Text
dbates@webkit.org [Thu, 13 Sep 2018 18:07:22 +0000 (18:07 +0000)]
Add Copy WebKit Permalink plugin for Sublime Text
https://bugs.webkit.org/show_bug.cgi?id=189589

Rubber-stamped by Joseph Pecoraro.

Port the Copy WebKit Permalink Automator service to a Sublime Text plugin. Once installed you can
use the plugin to copy to the Clipboard a trac.webkit.org hyperlink to the selected line in the
active document with or without blame annotations.

Once installed, you can Control-click (on Mac) or right-click (on Windows and Linux) on a line and
choose Copy WebKit Permalink or Copy WebKit Permalink to Blame from the context menu to copy to the
Clipboard a permanent hyperlink to the selected line without or with blame annotations, respectively.
On Mac you can also invoke the same functionality using the keyboard shortcuts Command + Shift + Control + C
and Command + Shift + Control + Option + C, respectively.

* CopyPermalink/Sublime Text/CopyWebKitPermalink/Context.sublime-menu: Added.
* CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py: Added.
* CopyPermalink/Sublime Text/CopyWebKitPermalink/Default (OSX).sublime-keymap: Added.
* CopyPermalink/Sublime Text/INSTALL: Added.
* CopyPermalink/Xcode/Copy WebKit Permalink.workflow/Contents/Info.plist: Renamed from Tools/CopyPermalink/Copy WebKit Permalink.workflow/Contents/Info.plist.
* CopyPermalink/Xcode/Copy WebKit Permalink.workflow/Contents/document.wflow: Renamed from Tools/CopyPermalink/Copy WebKit Permalink.workflow/Contents/document.wflow.
* CopyPermalink/Xcode/INSTALL: Renamed from Tools/CopyPermalink/README.

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

13 months agoRebaseline imported/w3c/web-platform-tests/web-share/idlharness.https.html after...
ryanhaddad@apple.com [Thu, 13 Sep 2018 18:07:13 +0000 (18:07 +0000)]
Rebaseline imported/w3c/web-platform-tests/web-share/idlharness.https.html after r235925.

Unreviewed test gardening.

* platform/mac-wk2/imported/w3c/web-platform-tests/web-share/idlharness.https-expected.txt:

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

13 months agoUnreviewed, rolling out r235953.
ryanhaddad@apple.com [Thu, 13 Sep 2018 17:20:55 +0000 (17:20 +0000)]
Unreviewed, rolling out r235953.

Caused layout test crashes under GuardMalloc.

Reverted changeset:

"Make GraphicsLayers ref-counted, so their tree can persist
when disconnected from RenderLayerBackings"
https://bugs.webkit.org/show_bug.cgi?id=189521
https://trac.webkit.org/changeset/235953

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

13 months agoRemove a MSVC workaround in XPath::Step::NodeTest
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 17:17:05 +0000 (17:17 +0000)]
Remove a MSVC workaround in XPath::Step::NodeTest
https://bugs.webkit.org/show_bug.cgi?id=189578

Reviewed by Alex Christensen.

XPath::Step::NodeTest has a special code for MSVC bug workaround.
It has been introduced in 5 years ago in Bug 121082 Comment 19.

I think it is safe just to remove the workaround.

No new tests (No behavior change).

* xml/XPathStep.h: Removed the MSVC workaround.

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

13 months agoRemove a MSVC workaround in InspectorStyle::styleWithProperties
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 17:16:05 +0000 (17:16 +0000)]
Remove a MSVC workaround in InspectorStyle::styleWithProperties
https://bugs.webkit.org/show_bug.cgi?id=189577

Reviewed by Alex Christensen.

No new tests (No behavior change).

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.

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

13 months agoUse a Variant instead of a union in CSSSelector
commit-queue@webkit.org [Thu, 13 Sep 2018 17:02:24 +0000 (17:02 +0000)]
Use a Variant instead of a union in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=188559

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-13
Reviewed by Antti Koivisto.

Source/WebCore:

No change in behavior. This just makes some of the existing problems more obvious and easy to fix.

I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
I only have m_isForPage when assertions are enabled because it's only used for an assertion.
The rest is pretty straightforward translating union syntax to Variant syntax.
I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::createRareData):
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setArgument):
(WebCore::CSSSelector::setLangArgumentList):
(WebCore::CSSSelector::setSelectorList):
(WebCore::CSSSelector::setNth):
(WebCore::CSSSelector::matchNth const):
(WebCore::CSSSelector::nthA const):
(WebCore::CSSSelector::nthB const):
(WebCore::CSSSelector::RareData::RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::argument const):
(WebCore::CSSSelector::langArgumentList const):
(WebCore::CSSSelector::selectorList const):
(WebCore::CSSSelector::attribute const):
(WebCore::CSSSelector::attributeCanonicalLocalName const):
(WebCore::CSSSelector::setValue):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::tagQName const):
(WebCore::CSSSelector::tagLowercaseLocalName const):
(WebCore::CSSSelector::value const):
(WebCore::CSSSelector::serializingValue const):
(WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
(WebCore::CSSSelector::RareData::create): Deleted.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
* css/parser/CSSParserSelector.h:

Source/WTF:

* wtf/Variant.h:
Add packing macros to make it so Variant-containing structures don't always have 7 bytes of padding per Variant.

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

13 months ago[Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initial...
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 16:43:46 +0000 (16:43 +0000)]
[Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=189575

Reviewed by Alex Christensen.

No new tests (No behavior change).

* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.

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

13 months ago[GTK] Enable media-source/interfaces.html.
Ms2ger@igalia.com [Thu, 13 Sep 2018 15:40:03 +0000 (15:40 +0000)]
[GTK] Enable media-source/interfaces.html.
https://bugs.webkit.org/show_bug.cgi?id=183613

Unreviewed test gardening.

The platform-neutral expectation applies to the GTK port as well.

* platform/gtk/TestExpectations: Remove expectation.
* platform/gtk/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt: Removed.

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

13 months agoIntroduce RTCRtpSendParameters
youenn@apple.com [Thu, 13 Sep 2018 15:31:04 +0000 (15:31 +0000)]
Introduce RTCRtpSendParameters
https://bugs.webkit.org/show_bug.cgi?id=189563

Reviewed by Eric Carlson.

Source/WebCore:

Introduce RTCRtpSendParameters to match the WebRTC specification.
Split RTCRtpPrameters fields accordingly and update call sites.

Covered by updated test.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCRtpCodingParameters.h: Added
* Modules/mediastream/RTCRtpCodingParameters.idl: Added
* Modules/mediastream/RTCRtpDecodingParameters.h: Added
* Modules/mediastream/RTCRtpDecodingParameters.idl: Added
* Modules/mediastream/RTCRtpEncodingParameters.h:
* Modules/mediastream/RTCRtpEncodingParameters.idl:
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpSendParameters.h: Added.
(WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
* Modules/mediastream/RTCRtpSendParameters.idl: Added.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::getParameters):
(WebCore::RTCRtpSender::setParameters):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::fromRTCRtpSendParameters):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* webrtc/video-getParameters-expected.txt:
* webrtc/video-getParameters.html:

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

13 months agoMove JavaScriptCore files to match Xcode project hierarchy
ddkilzer@apple.com [Thu, 13 Sep 2018 13:39:55 +0000 (13:39 +0000)]
Move JavaScriptCore files to match Xcode project hierarchy
<https://webkit.org/b/189574>

Reviewed by Filip Pizlo.

* API/JSAPIValueWrapper.cpp: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp.
* API/JSAPIValueWrapper.h: Rename from Source/JavaScriptCore/runtime/JSAPIValueWrapper.h.
* CMakeLists.txt: Update for new path to
generateYarrUnicodePropertyTables.py, hasher.py and
JSAPIValueWrapper.h.
* DerivedSources.make: Ditto. Add missing dependency on
hasher.py captured by CMakeLists.txt.
* JavaScriptCore.xcodeproj/project.pbxproj: Update for new file
reference paths. Add hasher.py library to project.
* Sources.txt: Update for new path to
JSAPIValueWrapper.cpp.
* runtime/JSImmutableButterfly.h: Add missing includes
after changes to Sources.txt and regenerating unified
sources.
* runtime/RuntimeType.h: Ditto.
* yarr/generateYarrUnicodePropertyTables.py: Rename from Source/JavaScriptCore/Scripts/generateYarrUnicodePropertyTables.py.
* yarr/hasher.py: Rename from Source/JavaScriptCore/Scripts/hasher.py.

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

13 months ago[GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
calvaris@igalia.com [Thu, 13 Sep 2018 09:14:35 +0000 (09:14 +0000)]
[GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
https://bugs.webkit.org/show_bug.cgi?id=189547

Reviewed by Philippe Normand.

decrypt-key-needed message renamed to drm-cdm-instance-needed.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
renaming the message, removed the class prefix for
dispatchCDMInstance.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):

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

13 months agoUnreviewed. Fix WebDriver tests after r235225.
carlosgc@webkit.org [Thu, 13 Sep 2018 08:33:05 +0000 (08:33 +0000)]
Unreviewed. Fix WebDriver tests after r235225.

Use wpt serve command to run the http server.

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
(WebDriverW3CWebServer.__init__):
(WebDriverW3CWebServer.start):
(WebDriverW3CWebServer.stop):

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

13 months ago[GTK][WPE] Allow to run script dialogs asynchronously in the UI process
carlosgc@webkit.org [Thu, 13 Sep 2018 08:24:17 +0000 (08:24 +0000)]
[GTK][WPE] Allow to run script dialogs asynchronously in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189544

Reviewed by Michael Catanzaro.

Source/WebKit:

Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
changes are backwards compatible.

* UIProcess/API/glib/WebKitScriptDialog.cpp:
(webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
(webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
a competion handler pending.
(webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
(webkit_script_dialog_unref): Ditto.
(webkit_script_dialog_close): New method to notify that we are done with the dialog.
* UIProcess/API/glib/WebKitScriptDialogPrivate.h:
(_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
* UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewDispose): Close the current script dialog if there's any.
(webkit_web_view_class_init): Document how to handle dialogs asynchronously.
(webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
webkitScriptDialogCreate() passing the completion handler.
(webkitWebViewRunJavaScriptConfirm): Ditto.
(webkitWebViewRunJavaScriptPrompt): Ditto.
(webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitScriptDialog.h:
* UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
(scriptDialogResponseCallback): Hnadle the response callback.
(webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:

Tools:

Add test cases for the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):

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

13 months agoVersioning.
kocsen_chung@apple.com [Thu, 13 Sep 2018 07:20:25 +0000 (07:20 +0000)]
Versioning.

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

13 months agoLet Xcode have its way with the JavaScriptCore project
ddkilzer@apple.com [Thu, 13 Sep 2018 04:32:41 +0000 (04:32 +0000)]
Let Xcode have its way with the JavaScriptCore project

* JavaScriptCore.xcodeproj/project.pbxproj:

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

13 months ago[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 02:14:05 +0000 (02:14 +0000)]
[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp
https://bugs.webkit.org/show_bug.cgi?id=189538

Reviewed by Per Arne Vollan.

* WebPreferences.cpp:
Changed the type of CFNumberTraits::Type from unsigned int to CFNumberType.
(WebPreferences::migrateWebKitPreferencesToCFPreferences):
Apply static_cast to the result of OR-ed CFPropertyListFormat.
(WebPreferences::screenFontSubstitutionEnabled):
Assign false to the content of the out variable 'enabled', not assigning 0 to the variable.

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

13 months ago[Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp
Hironori.Fujii@sony.com [Thu, 13 Sep 2018 02:03:12 +0000 (02:03 +0000)]
[Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp
https://bugs.webkit.org/show_bug.cgi?id=189496
<rdar://problem/44370981>

Unreviewed warning fix.

r235929 has introduced a new compilation warning:
> Tools/ImageDiff/cairo/PlatformImageCairo.cpp:34:70: warning: unused parameter ‘imageSize’ [-Wunused-parameter]

* ImageDiff/cairo/PlatformImageCairo.cpp:
(ImageDiff::PlatformImage::createFromStdin): Removed the variable name.

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Thu, 13 Sep 2018 01:58:43 +0000 (01:58 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

Another test fix.

* legacy-animation-engine/animations/duplicate-keys.html:

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Thu, 13 Sep 2018 01:14:08 +0000 (01:14 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

And even more test fixes!

* animations/stop-animation-on-suspend.html:
* compositing/scrolling/touch-scroll-to-clip.html:

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Thu, 13 Sep 2018 01:07:48 +0000 (01:07 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

More test fixes.

* legacy-animation-engine/animations/animation-border-overflow.html:
* legacy-animation-engine/animations/cross-fade-border-image-source.html:
* legacy-animation-engine/animations/cross-fade-list-style-image.html:
* legacy-animation-engine/animations/cross-fade-webkit-mask-box-image.html:
* legacy-animation-engine/fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html:
* legacy-animation-engine/transitions/extra-transition.html:
* legacy-animation-engine/transitions/svg-transitions.html:
* legacy-animation-engine/transitions/transition-in-delay-phase.html:
* legacy-animation-engine/transitions/visited-link-color.html:

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

13 months agoUpdate availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM...
mitz@apple.com [Thu, 13 Sep 2018 00:14:22 +0000 (00:14 +0000)]
Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
https://bugs.webkit.org/show_bug.cgi?id=189561

Reviewed by Tim Horton.

Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
appear in the GM seed SDKs.

* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationDelegate.h:
* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/API/Cocoa/_WKLinkIconParameters.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Wed, 12 Sep 2018 23:47:37 +0000 (23:47 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

Fix failing tests by explicitly turning off Web Animations for CSS animations.
Previously the test system was doing this, even though the feature was
supposed to be enabled.

* legacy-animation-engine/*.html:

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

13 months agoUnreviewed GTK test gardening.
aboya@igalia.com [Wed, 12 Sep 2018 23:34:56 +0000 (23:34 +0000)]
Unreviewed GTK test gardening.

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

13 months agoUnreviewed, rebaseline imported/w3c/web-platform-tests/url/failure.html after r235808.
cdumez@apple.com [Wed, 12 Sep 2018 23:19:49 +0000 (23:19 +0000)]
Unreviewed, rebaseline imported/w3c/web-platform-tests/url/failure.html after r235808.

New checks are passing.

* web-platform-tests/url/failure-expected.txt:

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

13 months agoFix an internal build after r235935
achristensen@apple.com [Wed, 12 Sep 2018 22:47:26 +0000 (22:47 +0000)]
Fix an internal build after r235935
https://bugs.webkit.org/show_bug.cgi?id=188996

* Carbon/HIWebView.mm:
(Draw):
r235935 fixed a mismatched macro with deprecated functions below it.  To quickly fix the build, I'm just going to restore the imbalance.

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

13 months agoimported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits...
rniwa@webkit.org [Wed, 12 Sep 2018 22:36:51 +0000 (22:36 +0000)]
imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
https://bugs.webkit.org/show_bug.cgi?id=189493

Reviewed by Alex Christensen.

Source/WebCore:

The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
When a form (or any other) element has more than one ref inside removeDetachedChildren,
addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.

However, when a form associated element of this form element appears later in the tree order,
FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.

Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
operations happening in this function so this should be safe.

Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html

* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.

LayoutTests:

Unskip the test now that it doesn't hit a debug assertion.

* TestExpectations:

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

13 months ago[Cocoa] Complete support for Paste as Quotation
mitz@apple.com [Wed, 12 Sep 2018 22:26:12 +0000 (22:26 +0000)]
[Cocoa] Complete support for Paste as Quotation
https://bugs.webkit.org/show_bug.cgi?id=189504

Reviewed by Wenson Hsieh.

Source/WebCore:

Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
       editing/pasteboard/4930986-2-paste-as-quotation.html
       editing/pasteboard/4930986-3-paste-as-quotation.html

* editing/Editor.cpp:
  Added ClipboardEventKind::PasteAsQuotation.
(WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
(WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
  This means that currently event handlers can’t emulate pasting as quotation, because they
  neither have the quoted content nor knowledge that quoting has been requested. We could
  change this in the future if needed.
(WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
(WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
  PasteOption::AsQuotation to pasteWithPasteboard.
(WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
  the fragment in a blockquote element with the "type" attribute set to "cite" and the
  "class" attribute set to a well-known value, which is used to trigger special behavior in
  ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
  so eventually, we could stop using this form of in-band signaling.
* editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
  and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
  behavior.

* editing/EditorCommand.cpp:
(WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
(WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
  here.

* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
  quote the fragment if needed.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard): Ditto.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.

* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
  quote the fragment if needed.
(WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
  pasteWithPasteboard.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.

* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
  quote the fragment if needed.

* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::pasteWithPasteboard): Ditto.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
  in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
  category. If we add more actions in the category, it could make sense to fold them into
  a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
(-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
(-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
  PasteAsQuotation command.

* UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
* UIProcess/ios/WKContentViewInteraction.mm:
  Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
  behavior.
(-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.

Tools:

* MiniBrowser/mac/MainMenu.xib: Added a Paste as Quotation command in the Edit menu.

LayoutTests:

Took a few existing tests of the Paste as Quotation behavior and modified them to use the
new PasteAsQuotation command. The only difference in the results is that the blockquote has
the "type" attribute set to "cite".

* editing/pasteboard/4930986-1-paste-as-quotation-expected.txt: Added.
* editing/pasteboard/4930986-1-paste-as-quotation.html: Added.
* editing/pasteboard/4930986-2-paste-as-quotation-expected.txt: Added.
* editing/pasteboard/4930986-2-paste-as-quotation.html: Added.
* editing/pasteboard/4930986-3-paste-as-quotation-expected.txt: Added.
* editing/pasteboard/4930986-3-paste-as-quotation.html: Added.

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

13 months agoMove IndexedDB to Network Process
sihui_liu@apple.com [Wed, 12 Sep 2018 22:16:45 +0000 (22:16 +0000)]
Move IndexedDB to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189415

Reviewed by Geoffrey Garen.

Source/WebKit:

We are going to eliminate storage process and move its functionality to network process.
The reasons why we want to do this:
1. Lower resource usage of having an additional process for storage operations, especially
memory. Single storage process takes about 5MB memory on macOS.
2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
regression in app launch. The launch time of storage process is partly attributed to this:
Service Workers delay page loading until receiving response from storage process.
3. We choose network process because UI process may have broader access in file system
that we don't want the storage operations to have.

This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
to corresponding components of network process. Moving of Service Worker and stopping to
launch storage process will be done in following patches.

We expect to see the higher cpu and memory usage of network process as it is taking more work,
but the overall gain in memory and latency after we completely remove storage process should be
positive.

* CMakeLists.txt:
* DerivedSources.make:

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::didCloseFromServer):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

Code moved from StorageToWebProcessConnection::didReceiveMessage.

(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

Network process receives and stores sandbox extension of temporary files for later indexedDB
use.

(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::ensurePathExists):
(WebKit::NetworkProcess::postStorageTask):
(WebKit::NetworkProcess::performNextStorageTask):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):

Instead of asking UI process to grant sandbox extension to storage process, now network
process just asks for sandbox extension fot itself.

(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::queue):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::idbServer): Deleted.
(WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
(WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
(WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
(WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
(WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::queue): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::generateIDBConnectionToServerIdentifier): Deleted.
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
(WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):

Code moved from WebToStorageProcessConnection::didReceiveMessage.

(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
(TEST):

LayoutTests:

* storage/indexeddb/modern/opendatabase-after-storage-crash.html:

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

13 months agoMake GraphicsLayers ref-counted, so their tree can persist when disconnected from...
simon.fraser@apple.com [Wed, 12 Sep 2018 21:27:07 +0000 (21:27 +0000)]
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521

Reviewed by Tim Horton.
Source/WebCore:

Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.

RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.

All the other changes are just to adapt to the new ownership patterns.

I verified that no GraphicsLayers were leaked or abandoned after this change.

No behavior change.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.

RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.

All the other changes are just to adapt to the new ownership patterns.

I verified that no GraphicsLayers were leaked or abandoned after this change.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):
(WebKit::WebInspectorClient::showPaintRect):
(WebKit::WebInspectorClient::animationEndedForLayer):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::createGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

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

13 months agoPSON: No process swap on back navigation after URL bar navigation
cdumez@apple.com [Wed, 12 Sep 2018 21:23:40 +0000 (21:23 +0000)]
PSON: No process swap on back navigation after URL bar navigation
https://bugs.webkit.org/show_bug.cgi?id=189557
<rdar://problem/44353108>

Reviewed by Alex Christensen.

Source/WebKit:

Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
WebBackForwardList::currentItem() as source item of the navigation, instead of
using Navigation::fromItem(). In case of back navigation, by the time
processForNavigation() is called, the WebBackForwardList's currentItem has already
been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
the source and target items would be the same in the following check:
` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`

This would cause us to reuse the same process incorrectly. Our existing API test coverage
did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

13 months agoMake IPC::SharedBufferDataReference a type that decodes into but does not inherit...
commit-queue@webkit.org [Wed, 12 Sep 2018 21:22:16 +0000 (21:22 +0000)]
Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
https://bugs.webkit.org/show_bug.cgi?id=189519

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-12
Reviewed by Chris Dumez.

* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::bufferingTimerFired):
(WebKit::NetworkResourceLoader::sendBuffer):
* Platform/IPC/DataReference.cpp:
(IPC::SharedBufferDataReference::encode const): Deleted.
* Platform/IPC/DataReference.h:
(IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
* Platform/IPC/HandleMessage.h:
* Platform/IPC/SharedBufferDataReference.h: Added.
(IPC::SharedBufferDataReference::SharedBufferDataReference):
(IPC::SharedBufferDataReference::encode const):
* Scripts/webkit/messages.py:
* Shared/API/APIData.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::didReceiveData):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
* WebProcess/Network/WebResourceLoader.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerAttachmentIdentifier):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getContentsAsMHTMLData):
(WebKit::WebPage::getSelectionAsWebArchiveData):
(WebKit::WebPage::getMainResourceDataOfFrame):
(WebKit::WebPage::getResourceDataFromFrame):
(WebKit::WebPage::getWebArchiveOfFrame):
(WebKit::WebPage::drawPagesToPDF):
* WebProcess/WebPage/WebPage.messages.in:

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

13 months agoUpdated svn:ignore after r235381.
mitz@apple.com [Wed, 12 Sep 2018 21:21:27 +0000 (21:21 +0000)]
Updated svn:ignore after r235381.

* .: Added LocalOverrides.xcconfig to svn:ignore.

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

13 months agoExpose fewer of URL's internal members
commit-queue@webkit.org [Wed, 12 Sep 2018 21:01:05 +0000 (21:01 +0000)]
Expose fewer of URL's internal members
https://bugs.webkit.org/show_bug.cgi?id=189528

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-12
Reviewed by Chris Dumez.

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::urlHostHash):
* platform/URL.cpp:
(WebCore::URL::hostStart const):
(WebCore::protocolHostAndPortAreEqual):
(WebCore::hostsAreEqual):
* platform/URL.h:
(WebCore::URL::hostStart const): Deleted.
(WebCore::URL::hostEnd const): Deleted.

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

13 months agoHeader parsing for experimental and internal debug features
dino@apple.com [Wed, 12 Sep 2018 20:59:33 +0000 (20:59 +0000)]
Header parsing for experimental and internal debug features
https://bugs.webkit.org/show_bug.cgi?id=189486
<rdar://problem/44320618>

Reviewed by Tim Horton.

LayoutTests/imported/mozilla:

New webkit-test-runner headers.

* css-animations/test_animation-cancel.html:
* css-animations/test_animation-computed-timing.html:
* css-animations/test_animation-currenttime.html:
* css-animations/test_animation-finish.html:
* css-animations/test_animation-finished.html:
* css-animations/test_animation-id.html:
* css-animations/test_animation-pausing.html:
* css-animations/test_animation-playstate.html:
* css-animations/test_animation-ready.html:
* css-animations/test_animation-reverse.html:
* css-animations/test_animation-starttime.html:
* css-animations/test_animations-dynamic-changes.html:
* css-animations/test_cssanimation-animationname.html:
* css-animations/test_document-get-animations.html:
* css-animations/test_effect-target.html:
* css-animations/test_element-get-animations.html:
* css-animations/test_event-dispatch.html:
* css-animations/test_event-order.html:
* css-animations/test_keyframeeffect-getkeyframes.html:
* css-animations/test_pseudoElement-get-animations.html:
* css-animations/test_setting-effect.html:
* css-transitions/test_animation-cancel.html:
* css-transitions/test_animation-computed-timing.html:
* css-transitions/test_animation-currenttime.html:
* css-transitions/test_animation-finished.html:
* css-transitions/test_animation-pausing.html:
* css-transitions/test_animation-ready.html:
* css-transitions/test_animation-starttime.html:
* css-transitions/test_csstransition-transitionproperty.html:
* css-transitions/test_document-get-animations.html:
* css-transitions/test_effect-target.html:
* css-transitions/test_element-get-animations.html:
* css-transitions/test_event-dispatch.html:
* css-transitions/test_keyframeeffect-getkeyframes.html:
* css-transitions/test_pseudoElement-get-animations.html:
* css-transitions/test_setting-effect.html:

LayoutTests/imported/w3c:

New webkit-test-runner headers.

* web-platform-tests/css-timing-1/frames-timing-functions-output.html:
* web-platform-tests/media-source/mediasource-changetype-play.html:
* web-platform-tests/media-source/mediasource-changetype.html:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context.html:
* web-platform-tests/web-animations/interfaces/Animatable/animate.html:
* web-platform-tests/web-animations/interfaces/Animation/ready.html:
* web-platform-tests/web-animations/timing-model/animations/current-time.html:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:

Source/WebKit:

Provide key-based (string) access to experimental and internal features.

* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetExperimentalFeatureForKey):
(WKPreferencesResetAllInternalDebugFeatures):
(WKPreferencesSetInternalDebugFeatureForKey):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/WebPreferences.h:

Tools:

Keep track of experimental and internal debug features in TestOptions, and
allow webkit-test-runner headers to toggle them by name.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

New webkit-test-runner headers.

* animations/3d/matrix-transform-type-animation.html:
* animations/3d/replace-filling-transform.html:
* animations/3d/transform-origin-vs-functions.html:
* animations/3d/transform-perspective.html:
* animations/additive-transform-animations.html:
* animations/animation-border-overflow.html:
* animations/animation-callback-timestamp.html:
* animations/animation-controller-drt-api.html:
* animations/animation-direction-alternate-reverse.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/animation-direction-reverse-hardware-opacity.html:
* animations/animation-direction-reverse-hardware.html:
* animations/animation-direction-reverse-non-hardware.html:
* animations/animation-direction-reverse-timing-functions-hardware.html:
* animations/animation-direction-reverse-timing-functions.html:
* animations/animation-direction.html:
* animations/animation-followed-by-transition.html:
* animations/animation-hit-test-transform.html:
* animations/animation-hit-test.html:
* animations/animation-internals-api-multiple-keyframes.html:
* animations/animation-internals-api.html:
* animations/animation-offscreen-to-onscreen.html:
* animations/animation-playstate-paused-style-resolution.html:
* animations/big-rotation.html:
* animations/change-completed-animation-transform.html:
* animations/change-keyframes.html:
* animations/combo-transform-rotate+scale.html:
* animations/cross-fade-background-image.html:
* animations/cross-fade-border-image-source.html:
* animations/cross-fade-list-style-image.html:
* animations/cross-fade-webkit-mask-box-image.html:
* animations/duplicate-keys-expected.html:
* animations/duplicate-keys.html:
* animations/duplicated-keyframes-name.html:
* animations/fill-forwards-end-state.html:
* animations/fill-mode-forwards-zero-duration.html:
* animations/fill-mode-removed.html:
* animations/font-variations/font-stretch.html:
* animations/font-variations/font-style.html:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/font-weight.html:
* animations/generic-from-to.html:
* animations/import.html:
* animations/keyframe-multiple-timing-functions-transform.html:
* animations/keyframe-timing-functions-transform.html:
* animations/keyframe-timing-functions.html:
* animations/keyframe-timing-functions2.html:
* animations/keyframes-comma-separated.html:
* animations/keyframes-dynamic.html:
* animations/keyframes-infinite-iterations.html:
* animations/keyframes-invalid-keys.html:
* animations/keyframes-out-of-order.html:
* animations/keyframes.html:
* animations/leak-document-with-css-animation.html:
* animations/lineheight-animation.html:
* animations/longhand-timing-function.html:
* animations/matrix-anim.html:
* animations/missing-from-to-transforms.html:
* animations/missing-from-to.html:
* animations/missing-keyframe-properties-repeating.html:
* animations/missing-keyframe-properties-timing-function.html:
* animations/missing-keyframe-properties.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/multiple-animations-timing-function.html:
* animations/multiple-animations.html:
* animations/multiple-keyframes.html:
* animations/negative-delay.html:
* animations/pause-crash.html:
* animations/play-state-start-paused.html:
* animations/resources/animation-leak-iframe.html:
* animations/simultaneous-start-left.html:
* animations/simultaneous-start-transform.html:
* animations/spring-function.html:
* animations/stacking-context-unchanged-while-running.html:
* animations/timing-functions.html:
* animations/transition-and-animation-1.html:
* animations/transition-and-animation-2.html:
* animations/transition-and-animation-3.html:
* animations/trigger-container-scroll-boundaries.html:
* animations/trigger-container-scroll-empty.html:
* animations/trigger-container-scroll-simple.html:
* animations/unanimated-style.html:
* animations/unprefixed-keyframes.html:
* animations/width-using-ems.html:
* compositing/animation/animated-composited-inside-hidden.html:
* compositing/animation/computed-style-during-delay.html:
* compositing/animation/layer-for-filling-animation.html:
* compositing/backing/backface-visibility-flip.html:
* compositing/backing/transform-transition-from-outside-view.html:
* compositing/contents-scale/animating.html:
* compositing/layer-creation/animation-overlap-with-children.html:
* compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html:
* compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html:
* compositing/layer-creation/mismatched-transform-transition-overlap.html:
* compositing/layer-creation/multiple-keyframes-animation-overlap.html:
* compositing/layer-creation/overlap-animation-clipping.html:
* compositing/layer-creation/overlap-animation-container.html:
* compositing/layer-creation/overlap-animation.html:
* compositing/layer-creation/scale-rotation-animation-overlap.html:
* compositing/layer-creation/scale-rotation-transition-overlap.html:
* compositing/layer-creation/translate-animation-overlap.html:
* compositing/layer-creation/translate-scale-animation-overlap.html:
* compositing/layer-creation/translate-scale-transition-overlap.html:
* compositing/layer-creation/translate-transition-overlap.html:
* compositing/overflow/overflow-positioning.html:
* compositing/reflections/animation-inside-reflection.html:
* compositing/reflections/nested-reflection-animated.html:
* compositing/reflections/nested-reflection-transition.html:
* compositing/transitions/scale-transition-no-start.html:
* compositing/transitions/singular-scale-transition.html:
* compositing/visible-rect/animated-from-none.html:
* compositing/visible-rect/animated.html:
* css3/calc/transitions-dependent.html:
* css3/calc/transitions.html:
* css3/filters/backdrop/animation.html:
* css3/filters/composited-during-animation.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* css3/filters/filter-animation-hw.html:
* css3/filters/filter-animation-multi-hw.html:
* css3/filters/filter-animation-multi.html:
* css3/filters/filter-animation.html:
* css3/masking/clip-path-animation.html:
* fast/animation/css-animation-resuming-when-visible-with-style-change.html:
* fast/animation/css-animation-resuming-when-visible.html:
* fast/animation/css-animation-throttling-lowPowerMode.html:
* fast/animation/height-auto-transition-computed-value.html:
* fast/css-generated-content/pseudo-animation.html:
* fast/css-generated-content/pseudo-transition.html:
* fast/filter-image/filter-image-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html:
* http/wpt/css/css-animations/start-animation-001.html:
* imported/blink/transitions/transition-not-interpolable.html:
* imported/blink/transitions/unprefixed-transform.html:
* platform/mac/TestExpectations:
* transitions/background-position-transitions.html:
* transitions/background-transitions.html:
* transitions/blendmode-transitions.html:
* transitions/border-radius-transition.html:
* transitions/clip-path-path-transitions.html:
* transitions/clip-path-transitions.html:
* transitions/clip-transition.html:
* transitions/color-transition-all.html:
* transitions/color-transition-premultiplied.html:
* transitions/color-transition-rounding.html:
* transitions/cross-fade-background-image.html:
* transitions/cross-fade-border-image.html:
* transitions/cubic-bezier-overflow-color.html:
* transitions/cubic-bezier-overflow-length.html:
* transitions/cubic-bezier-overflow-shadow.html:
* transitions/cubic-bezier-overflow-svg-length.html:
* transitions/cubic-bezier-overflow-transform.html:
* transitions/default-timing-function.html:
* transitions/delay.html:
* transitions/extra-transition.html:
* transitions/flex-transitions.html:
* transitions/font-family-during-transition.html:
* transitions/frames-timing-function.html:
* transitions/interrupted-all-transition.html:
* transitions/longhand-vs-shorthand-initial.html:
* transitions/mask-transitions.html:
* transitions/min-max-width-height-transitions.html:
* transitions/mismatched-shadow-styles.html:
* transitions/mismatched-shadow-transitions.html:
* transitions/mixed-type.html:
* transitions/move-after-transition.html:
* transitions/multiple-background-size-transitions.html:
* transitions/multiple-background-transitions.html:
* transitions/multiple-mask-transitions.html:
* transitions/multiple-shadow-transitions.html:
* transitions/negative-delay.html:
* transitions/opacity-transition-zindex.html:
* transitions/remove-transition-style.html:
* transitions/shape-outside-transitions.html:
* transitions/shorthand-border-transitions.html:
* transitions/shorthand-transitions.html:
* transitions/steps-timing-function.html:
* transitions/svg-layout-transition.html:
* transitions/svg-text-shadow-transition.html:
* transitions/svg-transitions.html:
* transitions/text-indent-transition.html:
* transitions/transform-op-list-match.html:
* transitions/transform-op-list-no-match.html:
* transitions/transition-drt-api-delay.html:
* transitions/transition-drt-api.html:
* transitions/transition-end-event-rendering.html:
* transitions/transition-hit-test-transform.html:
* transitions/transition-hit-test.html:
* transitions/transition-in-delay-phase.html:
* transitions/transition-on-element-with-content.html:
* transitions/transition-shorthand-delay.html:
* transitions/transition-timing-function.html:
* transitions/transition-to-from-auto.html:
* transitions/transition-to-from-undefined.html:
* transitions/visited-link-color.html:
* transitions/zero-duration-in-list.html:
* transitions/zero-duration-with-non-zero-delay-end.html:
* transitions/zero-duration-with-non-zero-delay-start.html:
* webanimations/accelerated-transition-by-removing-property.html:
* webanimations/accessing-current-time-after-clearing-css-animation-effect.html:
* webanimations/accessing-current-time-after-finished-css-animation-target-removal.html:
* webanimations/css-animation-effect-target-change-and-animation-removal-crash.html:
* webanimations/css-animations.html:
* webanimations/empty-keyframes-crash.html:
* webanimations/partly-accelerated-transition-by-removing-property.html:
* webanimations/setting-css-animation-none-after-clearing-effect.html:
* webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html:

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

13 months agoImport media recorder api WPT tests
commit-queue@webkit.org [Wed, 12 Sep 2018 20:55:29 +0000 (20:55 +0000)]
Import media recorder api WPT tests
https://bugs.webkit.org/show_bug.cgi?id=189526

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-09-12
Reviewed by Youenn Fablet.

* resources/import-expectations.json:
* web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt: Added.
* web-platform-tests/mediacapture-record/BlobEvent-constructor.html: Added.
* web-platform-tests/mediacapture-record/META.yml: Added.
* web-platform-tests/mediacapture-record/idlharness.window-expected.txt: Added.
* web-platform-tests/mediacapture-record/idlharness.window.html: Added.
* web-platform-tests/mediacapture-record/idlharness.window.js: Added.
(idl_array.catch):
* web-platform-tests/mediacapture-record/w3c-import.log: Added.

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

13 months ago[Curl] Implement correct total received bytes.
Basuke.Suzuki@sony.com [Wed, 12 Sep 2018 20:51:30 +0000 (20:51 +0000)]
[Curl] Implement correct total received bytes.
https://bugs.webkit.org/show_bug.cgi?id=189555

Reviewed by Alex Christensen.

Curl port only reported total network received bytes before decoding.

No new test. InspectorTest is only available for WebKitTestRunner.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:

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

13 months agoSplit RTCRtpParameters idl and header file
youenn@apple.com [Wed, 12 Sep 2018 19:23:49 +0000 (19:23 +0000)]
Split RTCRtpParameters idl and header file
https://bugs.webkit.org/show_bug.cgi?id=189524

Reviewed by Eric Carlson.

This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
No change of behavior.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDegradationPreference.idl: Added.
* Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDtxStatus.idl: Added.
* Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCPriorityType.idl: Added.
* Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpCodecParameters.idl: Added.
* Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
* Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpFecParameters.idl: Added.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpRtxParameters.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
(WebCore::fromRTCEncodingParameters):
(WebCore::toRTCHeaderExtensionParameters):
(WebCore::fromRTCHeaderExtensionParameters):
(WebCore::toRTCCodecParameters):
(WebCore::toRTCRtpParameters):
(WebCore::fromRTCRtpParameters):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

13 months agoExpose a few WebPlaybackControlsManager-driven PIP APIs to clients
mrajca@apple.com [Wed, 12 Sep 2018 19:10:01 +0000 (19:10 +0000)]
Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
https://bugs.webkit.org/show_bug.cgi?id=189478
<rdar://problem/44312650>

Reviewed by Eric Carlson.

This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
I also increased the size of the video element in the test page so it gets picked up by the
main content heuristics.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
(-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
(-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
(-[WKWebView _canTogglePictureInPicture]): Renamed from...
(-[WKWebView _canTogglePictureInPictureForTesting]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
(WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
(WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
 controls manager even when there is no Touch Bar present.
(WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
(WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
(WebKit::WebViewImpl::canTogglePictureInPictureForTesting):

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

13 months ago[IntersectionObserver] Implement rootMargin expansion
ajuma@chromium.org [Wed, 12 Sep 2018 17:03:13 +0000 (17:03 +0000)]
[IntersectionObserver] Implement rootMargin expansion
https://bugs.webkit.org/show_bug.cgi?id=189525

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Rebasline expectation for test that now passes.

* web-platform-tests/intersection-observer/root-margin-expected.txt:

Source/WebCore:

Expand the root intersection rectangle by the observer's rootMargin when computing
intersections.

Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html

* dom/Document.cpp:
(WebCore::expandRootBoundsWithRootMargin):
(WebCore::computeIntersectionRects):
* page/IntersectionObserver.h:
(WebCore::IntersectionObserver::rootMarginBox const):
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::expand):

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