WebKit-https.git
2 years agoMake UIScriptController::zoomToScale() work on Mac WK1 and WK2
simon.fraser@apple.com [Tue, 1 Nov 2016 02:43:47 +0000 (02:43 +0000)]
Make UIScriptController::zoomToScale() work on Mac WK1 and WK2
https://bugs.webkit.org/show_bug.cgi?id=164238

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/zooming/uiscript-zooming.html

Expose pageScaleFactor() for tests.

* testing/Internals.cpp:
(WebCore::Internals::pageScaleFactor):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Implement UIScriptController::zoomToScale() for WTR and DRT on Mac.

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::zoomToScale):
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::zoomToScale):

LayoutTests:

* fast/zooming/uiscript-zooming-expected.txt: Added.
* fast/zooming/uiscript-zooming.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

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

2 years agoMigrate CanvasRenderingContext's internal canvas pointer to a reference
mmaxfield@apple.com [Tue, 1 Nov 2016 01:36:00 +0000 (01:36 +0000)]
Migrate CanvasRenderingContext's internal canvas pointer to a reference
https://bugs.webkit.org/show_bug.cgi?id=164259

Reviewed by Dean Jackson.

It is never nullptr.

No new tests because there is no behavior change.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::ref):
(WebCore::CanvasRenderingContext::deref):
(WebCore::CanvasRenderingContext::canvas):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::unwindStateStack):
(WebCore::CanvasRenderingContext2D::isAccelerated):
(WebCore::CanvasRenderingContext2D::realizeSaves):
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::resetTransform):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::clearCanvas):
(WebCore::CanvasRenderingContext2D::transformAreaToDevice):
(WebCore::CanvasRenderingContext2D::rectContainsCanvas):
(WebCore::CanvasRenderingContext2D::calculateCompositingBufferRect):
(WebCore::CanvasRenderingContext2D::compositeBuffer):
(WebCore::CanvasRenderingContext2D::createPattern):
(WebCore::CanvasRenderingContext2D::didDrawEntireCanvas):
(WebCore::CanvasRenderingContext2D::didDraw):
(WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2D::drawingContext):
(WebCore::CanvasRenderingContext2D::getImageData):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
(WebCore::CanvasRenderingContext2D::putImageData):
(WebCore::CanvasRenderingContext2D::setFont):
(WebCore::CanvasRenderingContext2D::toTextDirection):
(WebCore::CanvasRenderingContext2D::direction):
(WebCore::CanvasRenderingContext2D::platformLayer):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::markContextChanged):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::isContextLostOrPending):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printWarningToConsole):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::clampedCanvasSize):
* html/canvas/WebGLRenderingContextBase.h:

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

2 years agoUpdate twisted version in webkitpy.thirdparty.autoinstalled module.
dewei_zhu@apple.com [Tue, 1 Nov 2016 01:17:58 +0000 (01:17 +0000)]
Update twisted version in webkitpy.thirdparty.autoinstalled module.
https://bugs.webkit.org/show_bug.cgi?id=154667

Reviewed by Ryosuke Niwa.

Use twisted_15_5_0 for the twisted module used by run-benchmark because there is a bug in twisted 12.1.0 which sometimes stops the test.
Installing twisted was introduced in https://bugs.webkit.org/show_bug.cgi?id=147082 for run-benchmark script.
Since buildbot relies on twisted 12.1.0 and has not been verified the compatibility on twisted 15.5.0, it would be more secure to use an individual version for run-benchmark script.

* Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.find_module):
(AutoinstallImportHook._install_twisted_15_5_0):
(AutoinstallImportHook._install_twisted): Deleted.

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

2 years agoRemove test workaround now that original issue is fixed
commit-queue@webkit.org [Tue, 1 Nov 2016 00:47:12 +0000 (00:47 +0000)]
Remove test workaround now that original issue is fixed
https://bugs.webkit.org/show_bug.cgi?id=164255

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-31
Reviewed by Saam Barati.

* inspector/debugger/resources/log-pause-location.js:
(TestPage.registerInitializer.window.logResolvedBreakpointLinesWithContext):
(TestPage.registerInitializer.window.logLinesWithContext):
(TestPage.registerInitializer.String.prototype.myPadStart): Deleted.
Use the real String.prototype.padStart now that it is fixed.

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

2 years agoAddress style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
beidson@apple.com [Tue, 1 Nov 2016 00:46:52 +0000 (00:46 +0000)]
Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
https://bugs.webkit.org/show_bug.cgi?id=164248

Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.

No new tests (No behavior change).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::createIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
(WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
(WebCore::IDBClient::IDBConnectionProxy::getRecord):
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
(WebCore::IDBClient::IDBConnectionProxy::getCount):
(WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
(WebCore::IDBClient::IDBConnectionProxy::openCursor):
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
(WebCore::IDBResultData::deleteDatabaseSuccess):
(WebCore::IDBResultData::putOrAddSuccess):
(WebCore::IDBResultData::getRecordSuccess):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getCountSuccess):
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):

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

2 years agoEnable custom elements by default everywhere
rniwa@webkit.org [Tue, 1 Nov 2016 00:32:08 +0000 (00:32 +0000)]
Enable custom elements by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=164242

Reviewed by Antti Koivisto.

Source/WebCore:

Set the status of Custom Elements API to "Done".

* features.json:

Tools:

Enable custom elements API on every port by default.

* Scripts/webkitperl/FeatureList.pm:

LayoutTests:

Enable tests for custom elements everywhere. Also removed the superfluous expectations for shadow DOM tests.

* TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoUnreviewed, rolling out r207967.
ryanhaddad@apple.com [Tue, 1 Nov 2016 00:27:28 +0000 (00:27 +0000)]
Unreviewed, rolling out r207967.

This change seems to be the cause of at least one LayoutTest
becoming flaky.

Reverted changeset:

"REGRESSION(r207753-207755): ASSERTION FAILED:
m_parsedStyleSheetCache->isInMemoryCache()"
https://bugs.webkit.org/show_bug.cgi?id=163905
http://trac.webkit.org/changeset/207967

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

2 years agoWeb Inspector: Shadow DOM scoped styles are missing
joepeck@webkit.org [Tue, 1 Nov 2016 00:23:29 +0000 (00:23 +0000)]
Web Inspector: Shadow DOM scoped styles are missing
https://bugs.webkit.org/show_bug.cgi?id=164247
<rdar://problem/29035061>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: inspector/css/shadow-scoped-style.html

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
Only match :host pseudo class for NOPSEUDO. It doesn't make sense
with a pseudo element request (:host::before does not make sense).

* css/InspectorCSSOMWrappers.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
Simplify existing "once per document" wrapper collection.

(WebCore::InspectorCSSOMWrappers::maybeCollectFromStyleSheets):
(WebCore::InspectorCSSOMWrappers::collectScopeWrappers):
Include a path to add style sheets that weren't already collected.
This will be useful when trying the StyleScope stylesheets which
are different for different nodes.

* inspector/InspectorCSSAgent.cpp:
(WebCore::containingStyleScopeForElement):
(WebCore::InspectorCSSAgent::buildObjectForRule):
Collect rules for document and StyleScope sheets separately.
For elements with a shadow root, add the root's sheets as
well in case there are :host rules that affect the element.

Source/WebInspectorUI:

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
Fix incorrect WrapperPromise usage.

LayoutTests:

* inspector/css/shadow-scoped-style-expected.txt: Added.
* inspector/css/shadow-scoped-style.html: Added.

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

2 years agoUnreviewed, rolling out r208180.
ryanhaddad@apple.com [Tue, 1 Nov 2016 00:10:24 +0000 (00:10 +0000)]
Unreviewed, rolling out r208180.

This change caused fast/shadow-dom/slotted-pseudo-element-css-
text.html to crash on macOS and iOS on every test run.

Reverted changeset:

"[CSS Parser] Support the shadow DOM"
https://bugs.webkit.org/show_bug.cgi?id=164240
http://trac.webkit.org/changeset/208180

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

2 years agoAX: aria-sort is not exposed on iOS
n_wang@apple.com [Tue, 1 Nov 2016 00:03:52 +0000 (00:03 +0000)]
AX: aria-sort is not exposed on iOS
https://bugs.webkit.org/show_bug.cgi?id=164245

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the aria-sort attribute value in accessibilitySortDirection.

Test: accessibility/ios-simulator/aria-sort-ios.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilitySortDirection]):

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::stringAttributeValue):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::stringAttributeValue):

LayoutTests:

* accessibility/ios-simulator/aria-sort-ios-expected.txt: Added.
* accessibility/ios-simulator/aria-sort-ios.html: Added.

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

2 years agoUnreviewed, rolling out r208178.
ryanhaddad@apple.com [Mon, 31 Oct 2016 23:57:05 +0000 (23:57 +0000)]
Unreviewed, rolling out r208178.

The test added with this change fails or times out on macOS
and iOS.

Reverted changeset:

"[Modern Media Controls] Media Controller: Airplay support"
https://bugs.webkit.org/show_bug.cgi?id=163729
http://trac.webkit.org/changeset/208178

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

2 years agoUnreviewed, rolling out r208182.
ryanhaddad@apple.com [Mon, 31 Oct 2016 23:53:48 +0000 (23:53 +0000)]
Unreviewed, rolling out r208182.

Both of the tests added with this change time out on macOS
Release.

Reverted changeset:

"[Modern Media Controls] Media Controller: Placard support"
https://bugs.webkit.org/show_bug.cgi?id=163731
http://trac.webkit.org/changeset/208182

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

2 years agoIndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
beidson@apple.com [Mon, 31 Oct 2016 23:43:50 +0000 (23:43 +0000)]
IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
<rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
       storage/indexeddb/modern/idbobjectstore-getall-1.html
       storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
       storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
       Existing imported W3C tests.

- Add new objects for "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
  new requests and responses.
- Add lots of boilerplate code to move these new objects around in the IDB machinery.
- Update "GetRecord" code to be shared with "GetAll" code where necessary.
- Other tweaks here and there.

* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:

* Modules/indexeddb/IDBGetAllResult.cpp: Added.
(WebCore::isolatedCopyOfVariant):
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys):
(WebCore::IDBGetAllResult::values):
(WebCore::IDBGetAllResult::allBlobFilePaths):
* Modules/indexeddb/IDBGetAllResult.h: Added.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::type):
(WebCore::IDBGetAllResult::encode):
(WebCore::IDBGetAllResult::decode):

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
* Modules/indexeddb/IDBRequest.h:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::getAllRecordsOnServer):
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
* Modules/indexeddb/IDBTransaction.h:

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::didGetAllRecords):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllRecords):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::getAllRecords):
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::queryForGetAllRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
(WebCore::IDBGetAllRecordsData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
(WebCore::IDBGetAllRecordsData::encode):
(WebCore::IDBGetAllRecordsData::decode):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getAllResult):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode):
(WebCore::IDBResultData::decode):

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didGetAllRecords):
(WebCore::InProcessIDBServer::getAllRecords):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:

Source/WebKit2:

- Handle moving "Get All" requests to and from the DatabaseProcess.
- Handle the additional task of creating/passing Sandbox Extensions for
  referenced files when necessary.

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::getAllRecords):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* Shared/WebCoreArgumentCoders.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::getAllRecords):
(WebKit::preregisterSandboxExtensionsIfNecessary):
(WebKit::WebIDBConnectionToServer::didGetAllRecords):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1-private.html: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1.html: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1.html: Added.
* storage/indexeddb/modern/resources/idbobjectstore-getall-1.js: Added.

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

2 years agoGTK+ and EFL build fixes after r208176.
rniwa@webkit.org [Mon, 31 Oct 2016 23:37:55 +0000 (23:37 +0000)]
GTK+ and EFL build fixes after r208176.

* css/PropertySetCSSStyleDeclaration.cpp:

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

2 years agoFix #include case.
simon.fraser@apple.com [Mon, 31 Oct 2016 23:27:35 +0000 (23:27 +0000)]
Fix #include case.

* page/IntersectionObserverEntry.h:

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

2 years ago[WK1] Candidate visibility should not update as a result of selection during a dictio...
wenson_hsieh@apple.com [Mon, 31 Oct 2016 23:19:19 +0000 (23:19 +0000)]
[WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
https://bugs.webkit.org/show_bug.cgi?id=164236
<rdar://problem/28747712>

Reviewed by Beth Dakin.

Source/WebCore:

Moves state that keeps track of whether or not a dictionary lookup is active from the WebPage to the Editor, so
that when clicking a text field or contenteditable in WK1 or WK2, we are able to avoid notifying the
WebEditorClient of the selection change.

Changes to WK2 are covered by existing unit tests in WKWebViewCandidateTests which verify that clicking does not
thrash candidate list visibility. A similar test will be added in the future for the WK1 case in CandidateTests.

* editing/Editor.h:
(WebCore::Editor::setIsGettingDictionaryPopupInfo):
(WebCore::Editor::isGettingDictionaryPopupInfo):

Source/WebKit/mac:

See WebCore ChangeLog for more detail. Sets the Editor's isGettingDictionaryPopupInfo state to true during a
dictionary lookup.

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::respondToChangedSelection):
* WebView/WebImmediateActionController.mm:
(+[WebImmediateActionController _dictionaryPopupInfoForRange:inFrame:withLookupOptions:indicatorOptions:transition:]):

Source/WebKit2:

See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):

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

2 years agoWeb Inspector: Arrows for Styles scope bar item are misaligned
commit-queue@webkit.org [Mon, 31 Oct 2016 23:18:38 +0000 (23:18 +0000)]
Web Inspector: Arrows for Styles scope bar item are misaligned
https://bugs.webkit.org/show_bug.cgi?id=164159

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-31
Reviewed by Timothy Hatcher.

* UserInterface/Views/ScopeRadioButtonNavigationItem.css:
(.scope-radio-button-navigation-item > .scope-radio-button-item-select:focus):
(.scope-radio-button-navigation-item > .arrows):

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

2 years agoAdd $vm.codeBlockFor() debugging utility.
mark.lam@apple.com [Mon, 31 Oct 2016 23:18:04 +0000 (23:18 +0000)]
Add $vm.codeBlockFor() debugging utility.
https://bugs.webkit.org/show_bug.cgi?id=164192

Reviewed by Saam Barati.

Sometimes, while debugging, it would be nice if we can get the codeBlock info for
a function.  Amongst other uses, this is useful for checking what optimization
level the function is currently at.  With $vm.codeBlockFor(), we can now do this.
For example, when JS_useDollarVM=true:

    print("test's codeBlock = " + $vm.codeBlockFor(test)); // prints function test's codeBlock.

Also added some comments to clarify some pre-existing code.

* tools/JSDollarVMPrototype.cpp:
(JSC::functionCodeBlockForFrame):
(JSC::codeBlockFromArg):
(JSC::functionCodeBlockFor):
(JSC::JSDollarVMPrototype::finishCreation):

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

2 years agoWeb Inspector: Entering ":n" in Open Resource Dialog, where n > number of lines,...
commit-queue@webkit.org [Mon, 31 Oct 2016 23:17:03 +0000 (23:17 +0000)]
Web Inspector: Entering ":n" in Open Resource Dialog, where n > number of lines, should jump to the last line
https://bugs.webkit.org/show_bug.cgi?id=160840

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-31
Reviewed by Timothy Hatcher.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.revealPosition):
Since it is possible for the given position to be outside the bounds of the CodeMirror
instance, wait to get the line handler for the highlight animation until we have constrained
the position value.

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

2 years agoMarking two http/tests/websocket/tests/hybi tests as flaky.
ryanhaddad@apple.com [Mon, 31 Oct 2016 23:06:33 +0000 (23:06 +0000)]
Marking two http/tests/websocket/tests/hybi tests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164080

Unreviewed test gardening.

* TestExpectations:

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

2 years agoSkipping media/modern-media-controls/volume-support/volume-support-media-api.html...
ryanhaddad@apple.com [Mon, 31 Oct 2016 23:00:09 +0000 (23:00 +0000)]
Skipping media/modern-media-controls/volume-support/volume-support-media-api.html on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=164250

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years agoGetByOffset rule is has incorrect assumptions inside arguments elimination phase
sbarati@apple.com [Mon, 31 Oct 2016 22:51:36 +0000 (22:51 +0000)]
GetByOffset rule is has incorrect assumptions inside arguments elimination phase
https://bugs.webkit.org/show_bug.cgi?id=164239
<rdar://problem/29032041>

Reviewed by Keith Miller.

The rule for GetByOffset assumes that a child will always be transformed before
the user of a child is by assuming its child will already be a phantom allocation.
This will almost certainly be true because of how we generate bytecode for
arguments allocation and how traversal of the graph works using blocksInNaturalOrder.
However, there is no guarantee that blocksInNaturalOrder must first traverse a
block's dominator before the block being dominated. Since it's unlikely that this
bug will ever be seen by real code, this fix is mostly for maintaining good hygiene.

* dfg/DFGArgumentsEliminationPhase.cpp:

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

2 years agoChanging expectation from Failure to Skip for two insertReplacementText tests on...
ryanhaddad@apple.com [Mon, 31 Oct 2016 22:45:41 +0000 (22:45 +0000)]
Changing expectation from Failure to Skip for two insertReplacementText tests on ios-simulator.

Unreviewed test gardening.

These tests will always time out on ios-simulator due to reliance upon
testRunner.waitUntilDone().

* platform/ios-simulator/TestExpectations:

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

2 years agoMarking three modern-media-controls tests as flaky.
ryanhaddad@apple.com [Mon, 31 Oct 2016 22:24:54 +0000 (22:24 +0000)]
Marking three modern-media-controls tests as flaky.

Unreviewed test gardening.

* TestExpectations:

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

2 years ago[Modern Media Controls] Media Controller: Placard support
graouts@webkit.org [Mon, 31 Oct 2016 22:13:08 +0000 (22:13 +0000)]
[Modern Media Controls] Media Controller: Placard support
https://bugs.webkit.org/show_bug.cgi?id=163731
<rdar://problem/28869598>

Reviewed by Dean Jackson.

We introduce the PlacardSupport class which brings support for showing the
appropriate placard when the media is played via AirPlay or in picture-in-picture.

Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
       media/modern-media-controls/placard-support/placard-support-pip.html

* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/placard-support.js: Added.
(PlacardSupport):
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype.handleEvent):
(PlacardSupport.prototype._updatePlacard):
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoImplement IntersectionObserver
simon.fraser@apple.com [Mon, 31 Oct 2016 22:12:05 +0000 (22:12 +0000)]
Implement IntersectionObserver
https://bugs.webkit.org/show_bug.cgi?id=159475

Reviewed by Ryosuke Niwa.
Source/JavaScriptCore:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add bindings support for Intersection Observer
<https://wicg.github.io/IntersectionObserver/>

Code is wrapped in ENABLE(INTERSECTION_OBSERVER), and controlled by a runtime
Setting (off by default for now).

A minor bindings change was required to fix the callback code.

IntersectionObserver is just a shell for now.

Tests: intersection-observer/intersection-observer-entry-interface.html
       intersection-observer/intersection-observer-interface.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldPassWrapperByReference):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* page/IntersectionObserver.cpp: Added.
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::observe):
(WebCore::IntersectionObserver::unobserve):
(WebCore::IntersectionObserver::disconnect):
(WebCore::IntersectionObserver::takeRecords):
* page/IntersectionObserver.h: Added.
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::root):
(WebCore::IntersectionObserver::rootMargin):
(WebCore::IntersectionObserver::thresholds):
* page/IntersectionObserver.idl: Added.
* page/IntersectionObserverCallback.h: Added.
(WebCore::IntersectionObserverCallback::~IntersectionObserverCallback):
* page/IntersectionObserverCallback.idl: Added.
* page/IntersectionObserverEntry.cpp: Added.
(WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
* page/IntersectionObserverEntry.h: Added.
(WebCore::IntersectionObserverEntry::create):
(WebCore::IntersectionObserverEntry::time):
(WebCore::IntersectionObserverEntry::rootBounds):
(WebCore::IntersectionObserverEntry::boundingClientRect):
(WebCore::IntersectionObserverEntry::intersectionRect):
(WebCore::IntersectionObserverEntry::target):
(WebCore::IntersectionObserverEntry::intersectionRatio):
* page/IntersectionObserverEntry.idl: Added.
* page/Settings.in:

Source/WebKit2:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Basic interface tests.

* intersection-observer/intersection-observer-entry-interface-expected.txt: Added.
* intersection-observer/intersection-observer-entry-interface.html: Added.
* intersection-observer/intersection-observer-interface-expected.txt: Added.
* intersection-observer/intersection-observer-interface.html: Added.

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

2 years ago[CSS Parser] Support the shadow DOM
hyatt@apple.com [Mon, 31 Oct 2016 22:08:12 +0000 (22:08 +0000)]
[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240

Reviewed by Dean Jackson.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.

* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.

* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.

* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.

* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.

* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.

(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).

(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.

(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.

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

2 years agoUse #pragma once in WebCore
commit-queue@webkit.org [Mon, 31 Oct 2016 22:07:53 +0000 (22:07 +0000)]
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164194

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-31
Rubber-stamped by Sam Weinig.

Source/WebCore:

* accessibility/*.h:
* bindings/*.h:
* contentextensions/*.h:
* dom/*.h:
* html/*.h:
* page/*.h:
Use #pragma once in headers.

* html/parser/ParsingUtilities.h:
Add missing namespace.

* html/track/VTTScanner.h:
(WebCore::VTTScanner::skipWhile):
(WebCore::VTTScanner::skipUntil):
(WebCore::VTTScanner::collectWhile):
(WebCore::VTTScanner::collectUntil):
Include namespace.

Source/WebKit/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::isSpeaking):
(WebContextMenuClient::shareMenuItem): Deleted.
* WebCoreSupport/WebContextMenuClient.h:
Remove this dead code since r192333.

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

2 years ago[Modern Media Controls] Media Controller: Airplay support
graouts@webkit.org [Mon, 31 Oct 2016 22:05:02 +0000 (22:05 +0000)]
[Modern Media Controls] Media Controller: Airplay support
https://bugs.webkit.org/show_bug.cgi?id=163729

Reviewed by Dean Jackson.

We introduce the AirplaySupport class which brings support for playing the media
via Airplay by clicking on the Airplay button in the media controls and correctly
reflecting when the media is played through Airplay via the media API. The enabled
state of the Airplay button is also tied to Airplay sources being available.

Test: media/modern-media-controls/airplay-support/airplay-support.html

* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.get on):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js: Added.
(AirplaySupport.prototype.get control):
(AirplaySupport.prototype.get mediaEvents):
(AirplaySupport.prototype.buttonWasClicked):
(AirplaySupport.prototype.handleEvent):
(AirplaySupport.prototype.syncControl):
(AirplaySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoWeb Inspector: Provide an opportunity to clear ScriptValues associated with debugged...
commit-queue@webkit.org [Mon, 31 Oct 2016 21:51:21 +0000 (21:51 +0000)]
Web Inspector: Provide an opportunity to clear ScriptValues associated with debugged target
https://bugs.webkit.org/show_bug.cgi?id=164167
<rdar://problem/29010148>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-31
Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/InspectorAgentBase.h:
(Inspector::InspectorAgentBase::discardValues):
* inspector/InspectorAgentRegistry.cpp:
(Inspector::AgentRegistry::~AgentRegistry):
(Inspector::AgentRegistry::discardValues):
* inspector/InspectorAgentRegistry.h:
New standard agent method to allow the agent to discard values.

* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::discardValues):
Discard ScriptValues in ConsoleMessages.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::globalObjectDestroyed):
Global object is going away, discard values.

Source/WebCore:

* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
Page is going away, discard values.

* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::workerTerminating):
Worker is going away, discard values.

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

2 years agoCSSStyleDeclaration should be annotated with CEReactions
rniwa@webkit.org [Mon, 31 Oct 2016 21:47:30 +0000 (21:47 +0000)]
CSSStyleDeclaration should be annotated with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163968

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the test now that all test cases pass.

* web-platform-tests/custom-elements/attribute-changed-callback-expected.txt:

Source/WebCore:

Added CEReactions to CSSStyleDeclaration.idl.

Test: fast/custom-elements/reactions/CSSStyleDeclaration.html

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* css/CSSStyleDeclaration.idl:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Remember the old value when this is
an inline style declaration for a custom element. Also store m_oldValue and m_customElement instead of
a mutation record so that we don't create a superfluous mutation record for custom elements.
(WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope): Enqueue attributeChangedCallback
when m_customElement is not null.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::observesStyleAttribute):
* dom/CustomElementReactionQueue.h:

LayoutTests:

Added a W3C style testharness.js test.

* fast/custom-elements/reactions/CSSStyleDeclaration-expected.txt: Added.
* fast/custom-elements/reactions/CSSStyleDeclaration.html: Added.

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

2 years agoUnreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.
jer.noble@apple.com [Mon, 31 Oct 2016 21:37:30 +0000 (21:37 +0000)]
Unreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoUnreviewed, rolling out r208154.
ryanhaddad@apple.com [Mon, 31 Oct 2016 21:31:16 +0000 (21:31 +0000)]
Unreviewed, rolling out r208154.

This change caused an assertion failure during API tests on
macOS.

Reverted changeset:

"NetworkSession: Network process crash when converting main
resource to download"
https://bugs.webkit.org/show_bug.cgi?id=164220
http://trac.webkit.org/changeset/208154

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

2 years agoLayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView...
zalan@apple.com [Mon, 31 Oct 2016 20:18:03 +0000 (20:18 +0000)]
LayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=164230

Reviewed by Simon Fraser.

When a <frameset> has invalid children, in addition to clear the needs layout flag on the children
we also need to do clear the descendants too.

Covered by LayoutTests/fast/frames/invalid-frameset.html.

* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames):

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

2 years agoUnreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParamete...
jer.noble@apple.com [Mon, 31 Oct 2016 20:17:30 +0000 (20:17 +0000)]
Unreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParameter not
defined pre-Sierra.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState...
zalan@apple.com [Mon, 31 Oct 2016 20:16:37 +0000 (20:16 +0000)]
ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
https://bugs.webkit.org/show_bug.cgi?id=164076

Reviewed by Antti Koivisto.

Source/WebCore:

FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
measure text with zero font size at all.

Test: fast/text/simple-line-layout-with-zero-sized-font.html

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):

LayoutTests:

* fast/text/simple-line-layout-with-zero-sized-font-expected.txt: Added.
* fast/text/simple-line-layout-with-zero-sized-font.html: Added.

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

2 years ago[CSS Parser] Support -webkit-named-image
hyatt@apple.com [Mon, 31 Oct 2016 19:38:58 +0000 (19:38 +0000)]
[CSS Parser] Support -webkit-named-image
https://bugs.webkit.org/show_bug.cgi?id=164235

Reviewed by Dean Jackson.

* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebkitNamedImage):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):

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

2 years agoDo a better job of protecting Frame objects in the context of JavaScript calls
bfulgham@apple.com [Mon, 31 Oct 2016 19:15:52 +0000 (19:15 +0000)]
Do a better job of protecting Frame objects in the context of JavaScript calls
https://bugs.webkit.org/show_bug.cgi?id=164163
<rdar://problem/28955249>

Reviewed by Darin Adler.

Source/WebCore:

* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame.
* editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executeSwapWithMark): Ditto.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Ditto.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard): Ditto.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::collapse): Ditto.
(WebCore::DOMSelection::collapseToEnd): Ditto.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Ditto.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::modify): Ditto.
(WebCore::DOMSelection::extend): Ditto.
(WebCore::DOMSelection::addRange): Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/DragController.cpp:
(WebCore::setSelectionToDragCaret): Ditto.
(WebCore::DragController::startDrag): Ditto.
* page/Frame.cpp:
(WebCore::Frame::checkOverflowScroll): Ditto.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync): Ditto.
(WebKit::WebPage::setComposition): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::insertDictatedTextAsync): Ditto.

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

2 years ago[CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
hyatt@apple.com [Mon, 31 Oct 2016 19:09:23 +0000 (19:09 +0000)]
[CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
https://bugs.webkit.org/show_bug.cgi?id=164233

Reviewed by Dean Jackson.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):

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

2 years ago[CSS Parser] Allow unitless values on background-size in quirks mode
hyatt@apple.com [Mon, 31 Oct 2016 18:59:45 +0000 (18:59 +0000)]
[CSS Parser] Allow unitless values on background-size in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=164232

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundSize):

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

2 years agoUnreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only define...
jer.noble@apple.com [Mon, 31 Oct 2016 17:46:10 +0000 (17:46 +0000)]
Unreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only defined in non-simulator SDKs.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoDebug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing out
sbarati@apple.com [Mon, 31 Oct 2016 17:26:36 +0000 (17:26 +0000)]
Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing out
https://bugs.webkit.org/show_bug.cgi?id=164227

Unreviewed timeout fix.

* microbenchmarks/pure-get-by-id-cse-2.js:

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

2 years agoAX: iOS Voiceover does not announce previously selected value from input type="date...
n_wang@apple.com [Mon, 31 Oct 2016 17:18:19 +0000 (17:18 +0000)]
AX: iOS Voiceover does not announce previously selected value from input type="date" form field
https://bugs.webkit.org/show_bug.cgi?id=164176

Reviewed by Chris Fleizach.

Source/WebCore:

Input type date is a popup button on iOS and its value was not exposed in stringValue() since
it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
the case in stringValue() and removing the AXTitle exposure.

Changes are covered in modified test.

* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::isInputTypePopupButton):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityLabel]):

LayoutTests:

* accessibility/ios-simulator/input-type-time-expected.txt:
* accessibility/ios-simulator/input-type-time.html:

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

2 years agoAdd requestIdleCallback to features.json.
simon.fraser@apple.com [Mon, 31 Oct 2016 17:16:52 +0000 (17:16 +0000)]
Add requestIdleCallback to features.json.

* features.json:

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

2 years ago[CSS Parser] Fully support prefixed background-size and box-shadows
hyatt@apple.com [Mon, 31 Oct 2016 17:09:18 +0000 (17:09 +0000)]
[CSS Parser] Fully support prefixed background-size and box-shadows
https://bugs.webkit.org/show_bug.cgi?id=164228

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years agoUnreviewed, change my status to be a WebKit reviewer
said@apple.com [Mon, 31 Oct 2016 17:07:39 +0000 (17:07 +0000)]
Unreviewed, change my status to be a WebKit reviewer

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

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

2 years agoNetworkSession: Network process crash when converting main resource to download
carlosgc@webkit.org [Mon, 31 Oct 2016 16:57:03 +0000 (16:57 +0000)]
NetworkSession: Network process crash when converting main resource to download
https://bugs.webkit.org/show_bug.cgi?id=164220

Reviewed by Alex Christensen.

Source/WebKit2:

Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
created yet. That's not expected to happen and when the response completion handler is called in the
NetworkDataTask it tries to use either the client or the download and it crashes.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
(WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
call cleanup() because it will be called by didBecomeDownload() later.

Tools:

Split /webkit2/Downloads/policy-decision-download in two, one to test the full load when main resource is
converted to a download and another one to test the cancellation as the test was doing before. When doing the
full load, delay a bit the decide destination to ensure the load is aborted before the data task has became a
download.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(testPolicyResponseDownload):
(testPolicyResponseDownloadCancel):
(beforeAll):

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

2 years agoUnreviewed, fix watchlist regexp for wasm.
keith_miller@apple.com [Mon, 31 Oct 2016 16:51:40 +0000 (16:51 +0000)]
Unreviewed, fix watchlist regexp for wasm.

* Scripts/webkitpy/common/config/watchlist:

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

2 years ago[CSS Parser] Get rid of CSSCustomIdentValue::creates
hyatt@apple.com [Mon, 31 Oct 2016 16:46:35 +0000 (16:46 +0000)]
[CSS Parser] Get rid of CSSCustomIdentValue::creates
https://bugs.webkit.org/show_bug.cgi?id=164225

Reviewed by Zalan Bujtas.

Get rid of all instances of CSSCustomIdent::create, since our style
resolution code isn't prepared to handle that value type yet.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeAttr):

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

2 years agoOpt-out of AVPlayer automatic sleep disabling
jer.noble@apple.com [Mon, 31 Oct 2016 16:37:27 +0000 (16:37 +0000)]
Opt-out of AVPlayer automatic sleep disabling
https://bugs.webkit.org/show_bug.cgi?id=163983

Reviewed by Eric Carlson.

In addition to the DisplaySleepDisabler, notify the MediaPlayerPrivateAVFoundationObjC object whether
it should disable display sleep.  Provide all the necessary boilerplate to allow the media player private
to query the HTMLMediaPlayer so that the correct value can be set on AVPlayer upon creation.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setShouldDisableSleep):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldDisableSleep):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):

Drive-by fix: Re-organize the contents of AVFoundationSPI.h so that there's a single top-level
#if USE(APPLE_INTERNAL_SDK) statement, rather than that conditional being sprinkled about the
file.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoREGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked...
jer.noble@apple.com [Mon, 31 Oct 2016 16:36:37 +0000 (16:36 +0000)]
REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
https://bugs.webkit.org/show_bug.cgi?id=162496

Reviewed by Darin Adler.

Source/WebCore:

The change to MockMediaSourcePrivate in r206300 revealed a true bug: seeks to the MediaSource's duration
will always fail. We should discard out of hand seeks which are greater than the duration, but allow seeks
directly to the duration.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::hasBufferedTime):

LayoutTests:

* platform/mac/TestExpectations:

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

2 years agoAllow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
jer.noble@apple.com [Mon, 31 Oct 2016 16:36:00 +0000 (16:36 +0000)]
Allow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
https://bugs.webkit.org/show_bug.cgi?id=162366
<rdar://problem/28639600>

Reviewed by Eric Carlson.

Source/WebCore:

Tests: media/video-concurrent-visible-playback.html
       media/video-multiple-concurrent-playback.html

Separate out the concept of "video-only" from "video-with-audio" in PlatformMediaSession::MediaType,
and only set the ConcurrentPlaybackNotPermitted restriction for "video-with-audio".  This allows multiple
silent video elements to play back simultaneously.

However, the bug in question also shows bad behavior when both concurrent playback and invisible playback
are not allowed. Namely, an invisible element will attempt to autoplay, interrupt visible elements, and
then fail to play due to it's non-visibility.  Add an extra check to canTransitionFromAutoplayToPlay()
which asks the session if autoplay is allowed (which will return false if the element is not visible).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
(WebCore::HTMLMediaElement::mediaType):
(WebCore::HTMLMediaElement::presentationType):
(WebCore::HTMLMediaElement::updateShouldAutoplay):
(WebCore::mediaElementIsAllowedToAutoplay): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted):
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
* testing/Internals.cpp:
(WebCore::Internals::setMediaSessionRestrictions):

LayoutTests:

* media/content/test-video-only.mp4: Added.
* media/non-existent-video-playback-interrupted-expected.txt:
* media/non-existent-video-playback-interrupted.html:
* media/video-background-playback-expected.txt:
* media/video-background-playback.html:
* media/video-background-tab-playback-expected.txt:
* media/video-background-tab-playback.html:
* media/video-concurrent-playback-expected.txt:
* media/video-concurrent-playback.html:
* media/video-concurrent-visible-playback-expected.txt: Added.
* media/video-concurrent-visible-playback.html: Added.
* media/video-multiple-concurrent-playback-expected.txt: Added.
* media/video-multiple-concurrent-playback.html: Added.
* media/video-playback-interrupted-expected.txt:
* media/video-playback-interrupted.html:
* media/video-restricted-invisible-autoplay-not-allowed.html:

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

2 years agoautogenerated files from wasm.json should be in derived sources.
keith_miller@apple.com [Mon, 31 Oct 2016 16:24:59 +0000 (16:24 +0000)]
autogenerated files from wasm.json should be in derived sources.
https://bugs.webkit.org/show_bug.cgi?id=164152

Reviewed by Filip Pizlo.

JSTests:

Delete generation script since it is no longer used.

* wasm/generate-wasmops-header.js: Removed.

Source/JavaScriptCore:

Add two new python scripts to the build. These scripts do what the
old js script in JSTests did. Previously, changes to wasm.json needed
to be manually reflected in WasmOps.h. This patch will auto-build from
the json file. That system was unsustainable, especially as future patches
will likely add more autogenerated files. The generated header files are
identical other than the comment at the top and the order of the opcodes.
I believe ordering difference just has to do with the iteration order for
sets.

* DerivedSources.make:
* wasm/WasmOps.h: Removed.
* wasm/generateWasm.py: Added.
(Wasm):
(Wasm.__init__):
(opcodeIterator):
(toCpp):
(isNormal):
(isUnary):
(isBinary):
* wasm/generateWasmOpsHeader.py: Added.
(cppMacro):
(opcodeMacroizer):
(ceilDiv):
(bitSet):
(BinaryOpType):
(UnaryOpType):
(LoadOpType):
(StoreOpType):
* wasm/wasm.json: Added.

Tools:

Add message to make sure that people keep the wasm.jsons up to date.

* Scripts/webkitpy/common/config/watchlist:

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

2 years ago[CSS Parser] Support unprefixed cross-fade
hyatt@apple.com [Mon, 31 Oct 2016 16:17:48 +0000 (16:17 +0000)]
[CSS Parser] Support unprefixed cross-fade
https://bugs.webkit.org/show_bug.cgi?id=164224

Reviewed by Zalan Bujtas.

* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):

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

2 years ago[CSS Parser] Simplify background-position-x/y style mapping
hyatt@apple.com [Mon, 31 Oct 2016 16:10:11 +0000 (16:10 +0000)]
[CSS Parser] Simplify background-position-x/y style mapping
https://bugs.webkit.org/show_bug.cgi?id=164223

Reviewed by Zalan Bujtas.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):

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

2 years agoMove ChildNode and ParentNode from ExceptionCode to Exception, add support for Except...
darin@apple.com [Mon, 31 Oct 2016 15:54:51 +0000 (15:54 +0000)]
Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
https://bugs.webkit.org/show_bug.cgi?id=164214

Reviewed by Alex Christensen.

Source/WebCore:

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
Ref<FetchHeaders> for return value.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
SourceBuffer* for return value.
* Modules/mediasource/MediaSource.h: Updated for above.

* bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
it works with a function returning a reference.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
Counter* for return value.
(WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
Rect* for return value.
* css/CSSPrimitiveValue.h: Updated for above.

* dom/ChildNode.idl: Use non-legacy exceptions.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::querySelector): Use ExceptionOr.
(WebCore::ContainerNode::querySelectorAll): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above.

* dom/Document.cpp:
(WebCore::Document::selectorQueryForString): Use ExceptionOr.
* dom/Document.h: Updated for above.

* dom/Element.cpp:
(WebCore::Element::attachShadow): Return ShadowRoot& instead of
Ref<ShadowRoot> since the shadow root is owned by the element, not
the caller.
(WebCore::Element::matches): Updated for change to make the
selectorQueryForString function use ExceptionOr.
(WebCore::Element::closest): Ditto.
(WebCore::contextNodeForInsertion): Return ContainerNode& instead of
ContainerNode*.
(WebCore::contextElementForInsertion): Updated for above.
* dom/Element.h: Updated for above.
* dom/Element.idl: Changed return type for closest and for
insertAdjacentElement to be nullable since both can return null.

* dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.

* dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
* dom/Node.h: Updated for above changes.

* dom/ParentNode.idl: Use non-legacy exceptions.

* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::queryAll): Changed return type to Ref.
(WebCore::SelectorQueryCache::add): Use ExceptionOr.
* dom/SelectorQuery.h: Updated for above changes.

* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
Document& instead of Document*.
* html/HTMLFrameOwnerElement.h: Updated for above change.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
instead of Ref<TextTrack>.
* html/HTMLMediaElement.h: Updated for above.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
Updated for new exceptions.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector): Ditto.
(WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
(WebCore::InspectorDOMAgent::performSearch): Ditto.
(WebCore::InspectorDOMAgent::highlightSelector): Ditto.

* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::performSearch): Put a null check
here so callers don't have to do it. Pass references to the
individual functions since the pointer can't be null.
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
Updated to use reference and streamlined code a bit, using
containsIgnoringASCIICase instead of findIgnoringCase.
(WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
(WebCore::InspectorNodeFinder::matchesElement): Ditto.
(WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
Also updated  for new exceptions in querySelectorAll.
* inspector/InspectorNodeFinder.h: Updated for above.

* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
insetad of WebKitSubtleCrypto*.
* page/Crypto.h: Updated for above.

* testing/Internals.h: Removed declarations for functions already
removed: ensureShadowRoot and createShadowRoot.

Source/WebKit/mac:

* DOM/DOMCSSPrimitiveValue.mm:
(-[DOMCSSPrimitiveValue getCounterValue]): Updated since return value
is a reference now.
(-[DOMCSSPrimitiveValue getRectValue]): Ditto.

* DOM/DOMDocument.mm:
(-[DOMDocument querySelector:]): Updated exception handling.
(-[DOMDocument querySelectorAll:]): Ditto.
* DOM/DOMDocumentFragment.mm:
(-[DOMDocumentFragment querySelector:]): Ditto.
(-[DOMDocumentFragment querySelectorAll:]): Ditto.
* DOM/DOMElement.mm:
(-[DOMElement querySelector:]): Ditto.
(-[DOMElement querySelectorAll:]): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_query_selector): Updated exception handling.
(webkit_dom_document_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_query_selector): Ditto.
(webkit_dom_document_fragment_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_query_selector): Ditto.
(webkit_dom_element_query_selector_all): Ditto.

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

2 years agoConvert Document from ExceptionCode to Exception
darin@apple.com [Mon, 31 Oct 2016 15:49:34 +0000 (15:49 +0000)]
Convert Document from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164212

Reviewed by Alex Christensen.

Source/WebCore:

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer): Removed IGNORE_EXCEPTION.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom): Use releaseReturnValue
instead of ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserInsertBefore): Removed ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserAppendChild): Ditto.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Updated for new
exception handling.
(WebCore::DOMImplementation::createDocument): Ditto.

* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation): Return ExceptionOr.
(WebCore::Document::createElementForBindings): Ditto.
(WebCore::Document::createCDATASection): Ditto.
(WebCore::Document::createProcessingInstruction): Ditto.
(WebCore::Document::importNode): Ditto.
(WebCore::Document::adoptNode): Ditto.
(WebCore::Document::createElementNS): Ditto.
(WebCore::Document::setXMLVersion): Ditto.
(WebCore::Document::setBodyOrFrameset): Ditto.
(WebCore::Document::processHttpEquiv): Ditto.
(WebCore::Document::createEvent): Ditto.
(WebCore::Document::cookie): Ditto.
(WebCore::Document::setCookie): Ditto.
(WebCore::Document::setDomain): Ditto.
(WebCore::Document::parseQualifiedName): Ditto. Also added an overload
that constructs a QualifiedName directly that most call sites can use.
(WebCore::Document::createAttribute): Return ExceptionOr.
(WebCore::Document::createAttributeNS): Ditto.
(WebCore::Document::createTouch): Removed unneeded ExceptionCode&.
* dom/Document.h: Updated for above.
* dom/Document.idl: Use non-legacy exceptions. Removed exception
entirely from createTouch.

* dom/Element.cpp:
(WebCore::Element::parseAttributeName): Updated to use the new
Document::parseQualifiedName.
* editing/EditorCommand.cpp:
(WebCore::executeFormatBlock): Ditto.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName): Updated for the new
exception handling.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies): Ditto.

* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Use the
HTMLHtmlElement::create and HTMLBodyElement::create instead of using
createElementNS to make the simple document.

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName): Renamed, made this
a member function, updated to use the new Document::parseQualifiedName,
and also moved the code to get the attribute in here.
(WebCore::SVGSMILElement::constructAttributeName): Added. Helper function
for the two places we update the attribute name from attributeNameAttr.
(WebCore::SVGSMILElement::insertedInto): Use updateAttributeName.
(WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
* svg/animation/SVGSMILElement.h: Updated for the above.

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::processingInstruction): Updated to understand
ExceptionOr rather than an out argument.
(WebCore::XMLDocumentParser::startDocument): Removed ASSERT_NO_EXCEPTION.

Source/WebKit/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument setXmlVersion:]): Updated exception handling.
(-[DOMDocument cookie]): Ditto.
(-[DOMDocument setCookie:]): Ditto.
(-[DOMDocument setBody:]): Ditto.
(-[DOMDocument createElement:]): Ditto.
(-[DOMDocument createCDATASection:]): Ditto.
(-[DOMDocument createProcessingInstruction:data:]): Ditto.
(-[DOMDocument createAttribute:]): Ditto.
(-[DOMDocument createEntityReference:]): Ditto.
(-[DOMDocument importNode:deep:]): Ditto.
(-[DOMDocument createElementNS:qualifiedName:]): Ditto.
(-[DOMDocument createAttributeNS:qualifiedName:]): Ditto.
(-[DOMDocument getElementsByTagNameNS:localName:]): Ditto.
(-[DOMDocument adoptNode:]): Ditto.
(-[DOMDocument createEvent:]): Ditto.

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMDocument::createElement): Updated exception handling.
(DOMDocument::createEvent): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_create_element): Updated exception handling.
(webkit_dom_document_create_cdata_section): Ditto.
(webkit_dom_document_create_processing_instruction): Ditto.
(webkit_dom_document_create_attribute): Ditto.
(webkit_dom_document_import_node): Ditto.
(webkit_dom_document_create_element_ns): Ditto.
(webkit_dom_document_create_attribute_ns): Ditto.
(webkit_dom_document_adopt_node): Ditto.
(webkit_dom_document_create_event): Ditto.
(webkit_dom_document_set_xml_version): Ditto.
(webkit_dom_document_get_cookie): Ditto.
(webkit_dom_document_set_cookie): Ditto.
(webkit_dom_document_set_body): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocument createElement:]): Ditto.

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

2 years agoHolding down a key to choose an accented character should fire "insertReplacementText...
wenson_hsieh@apple.com [Mon, 31 Oct 2016 15:12:00 +0000 (15:12 +0000)]
Holding down a key to choose an accented character should fire "insertReplacementText" input events
https://bugs.webkit.org/show_bug.cgi?id=164209
<rdar://problem/29019305>

Reviewed by Darin Adler.

Source/WebCore:

For TypingCommands that correspond to "insertReplacementText" inputTypes, vend dataTransfers for resulting
beforeinput and input events if the edited area is not an input field or textarea. To do this, convert the plain
text representation of the content to be inserted to HTML text using a helper function,
MarkupAccumulator::appendCharactersReplacingEntities, that is used when creating markup for Text nodes.

Tests: fast/events/before-input-prevent-insert-replacement.html
       fast/events/input-event-insert-replacement.html

* editing/TypingCommand.cpp:
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::inputEventDataTransfer):
* editing/TypingCommand.h:

Source/WebKit2:

When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
changes in order to support testing replacement text insertion.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertText:replacementRange:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):

Tools:

Adds test support for inserting replacement text on Mac. This is equivalent to holding down a vowel key (e.g.
'a') to bring up the menu containing accented version of the character, then selecting an accented character to
insert in place of the typed character. This is exposed via UIScriptController.insertText, which takes a string
and an insertion range.

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::insertText):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:

Note that there is no callback argument to insertText, since UIScriptController::insertText is synchronous in
the UI process. The tests end when corresponding input events fired as a result of insertText have been received
in the web process. Please see the new layout tests for more detail.

* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::insertText):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::nsStringFromJSString):
(WTR::UIScriptController::insertText):

LayoutTests:

Adds 2 new layout tests to verify that inserting replacement text fires input events of inputType
"insertReplacementText" instead of the generic "insertText", and that calling preventDefault() on the
beforeinput event prevents text from being inserted. Also checks that inserting replacement text in
contenteditable areas causes the dataTransfer attribute to be populated, and that the data attribute is null.

* fast/events/before-input-prevent-insert-replacement-expected.txt: Added.
* fast/events/before-input-prevent-insert-replacement.html: Added.
* fast/events/input-event-insert-replacement-expected.txt: Added.
* fast/events/input-event-insert-replacement.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

2 years ago[CSS Parser] Miscellaneous bug fixes
hyatt@apple.com [Mon, 31 Oct 2016 15:01:18 +0000 (15:01 +0000)]
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164211

Reviewed by Darin Adler.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
Make sure to properly reject invalid transform-origin-z values.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeAttribute):
Make attribute selector parsing strict about requiring a ] to end
the selector.

(WebCore::CSSSelectorParser::consumePseudo):
Force the nth-child "of" syntax to have whitespace after "of" but
before the selector. It is unclear if this should be a requirement
or not (spec is ambiguous), but for now we match the old parser.

(WebCore::CSSSelectorParser::consumeCombinator):
Fix a bug that caused the double child combinator to match even
when there was whitespace between the two > symbols.

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

2 years agoRTCOfferAnswerOptions does not need to be refcounted
commit-queue@webkit.org [Mon, 31 Oct 2016 13:42:43 +0000 (13:42 +0000)]
RTCOfferAnswerOptions does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164216

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-31
Reviewed by Darin Adler.

Covered by existing tests.

Making RTCOffer/Answer options dictionaries as per specification.
Removing code that handles RTCOffer/Answer options dictionary since this is done by the binding generator.
Updated users of the options accordingly.

* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOffer):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCOfferAnswerOptions.cpp: Removed.
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* WebCore.xcodeproj/project.pbxproj:

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

2 years agofast/mediastream/RTCPeerConnection-* tests crashing under ASan
commit-queue@webkit.org [Mon, 31 Oct 2016 08:32:34 +0000 (08:32 +0000)]
fast/mediastream/RTCPeerConnection-* tests crashing under ASan
https://bugs.webkit.org/show_bug.cgi?id=164215

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-31
Reviewed by Philippe Normand.

Covered by ASAN bot tests.

* platform/mediastream/SDPProcessorScriptResource.cpp:
(WebCore::SDPProcessorScriptResource::scriptString):

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

2 years ago[OpenWebRTC] Initialize library one time only
philn@webkit.org [Mon, 31 Oct 2016 07:53:30 +0000 (07:53 +0000)]
[OpenWebRTC] Initialize library one time only
https://bugs.webkit.org/show_bug.cgi?id=164118

Reviewed by Darin Adler.

* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
(WebCore::initializeOpenWebRTC): Prevent multiple initialisations of the library.

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

2 years ago[EFL] Skip media tests because timeout happens on many media tests.
gyuyoung.kim@webkit.org [Mon, 31 Oct 2016 05:22:42 +0000 (05:22 +0000)]
[EFL] Skip media tests because timeout happens on many media tests.

Unreviewed EFL gardening.

Treat the media folder to *Skip* temporarily.

* platform/efl/TestExpectations:

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

2 years agoUnreviewed fix: Correct ChangeLog after my bad merge.
bfulgham@apple.com [Mon, 31 Oct 2016 00:48:18 +0000 (00:48 +0000)]
Unreviewed fix: Correct ChangeLog after my bad merge.

* ChangeLog

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

2 years ago-Wpragmas warning spam from angleutils.h
mcatanzaro@igalia.com [Sun, 30 Oct 2016 23:27:43 +0000 (23:27 +0000)]
-Wpragmas warning spam from angleutils.h
https://bugs.webkit.org/show_bug.cgi?id=164207

Reviewed by Darin Adler.

Use #pragma clang instead of #pragma GCC since all of the warnings we need to suppress are
Clang-specific warnings. GCC ignores unknown pragmas and does not warn, but it does warn if
any GCC pragma is invalid.

Note that this might still be broken for MSVCC, as MSVCC warns when it sees unknown pragmas.

* changes.diff:
* src/common/angleutils.cpp:
(FormatString):
* src/common/angleutils.h:
(MakeStaticString):
* src/common/debug.cpp:
* src/common/mathutil.cpp:
* src/libANGLE/Caps.cpp:
(gl::TextureCapsMap::get):
(gl::GetExtensionInfoMap):
* src/libANGLE/Device.cpp:
(egl::GetDeviceSet):
* src/libANGLE/Display.cpp:
(egl::Display::getClientExtensionString):
* src/libANGLE/formatutils.cpp:
(gl::GetInternalFormatMap):
(gl::GetAllSizedInternalFormats):
* src/libANGLE/validationES3.cpp:
(gl::IsValidES3CopyTexImageCombination):

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

2 years agoMove Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
darin@apple.com [Sun, 30 Oct 2016 22:36:07 +0000 (22:36 +0000)]
Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164206

Reviewed by Chris Dumez.

Source/WebCore:

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertyNames): Use modern for loop, and
updates since the names function now returns a vector.
(WebCore::JSDOMStringMap::putDelegate): Use propagateException. Also return
true any time an exception is raised. Since true tells the caller to return
without doing any work, we always want to return that on an exception.
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::names): Renamed from getNames and made this
return a Vector instead of populating a passed-in vector.
(WebCore::DatasetDOMStringMap::setItem): Use ExceptionOr.
* dom/DatasetDOMStringMap.h: Updated for above.

* dom/Document.cpp:
(WebCore::Document::adoptNode): Updated to use ExceptionOr for
removeAttributeNode. Changed to use remove rather than removeChild for
better clarity.

* dom/Element.cpp:
(WebCore::Element::setAttribute): Use ExceptionOr.
(WebCore::Element::createShadowRoot): Deleted. Unused.
(WebCore::Element::attachShadow): Use ExceptionOr.
(WebCore::Element::shadowRootForBindings): Tweaked a bit.
(WebCore::Element::userAgentShadowRoot): Removed unneeded if statemment.
(WebCore::Element::ensureUserAgentShadowRoot): Tweaked a bit.
(WebCore::Element::setAttributeNode): Use ExceptionOr.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::removeAttributeNode): Ditto.
(WebCore::Element::parseAttributeName): Ditto. Also changed return result
to be a QualifiedName instead of using an out argument.
(WebCore::Element::setAttributeNS): Ditto.
(WebCore::Element::mergeWithNextTextNode): Ditto.
(WebCore::Element::setOuterHTML): Ditto.
(WebCore::Element::setInnerHTML): Ditto.
(WebCore::Element::matches): Ditto.
(WebCore::Element::closest): Ditto.
(WebCore::Element::insertAdjacent): Ditto.
(WebCore::Element::insertAdjacentElement): Ditto.
(WebCore::contextNodeForInsertion): Ditto.
(WebCore::contextElementForInsertion): Added. Helper for the
insertAdjacentHTML function to eliminate a local variable.
(WebCore::Element::insertAdjacentHTML): Use ExceptionOr.
(WebCore::Element::insertAdjacentText): Ditto.
* dom/Element.h: Updated for above.
* dom/Element.idl: Use non-legacy exceptions.

* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::removeNamedItem): Use ExceptionOr.
(WebCore::NamedNodeMap::supportedPropertyNames): Updated to check
which strings should be removed without copying the strings.
(WebCore::NamedNodeMap::removeNamedItemNS): Use ExceptionOr.
(WebCore::NamedNodeMap::setNamedItem): Ditto. Removed overload for
legacy bindings; move that to the bindings themselves.
* dom/NamedNodeMap.h: Updated for above.
* dom/NamedNodeMap.idl: Use non-legacy exceptions.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText): Updated since mergeWithNextTextNode
now uses ExceptionOr.

* inspector/DOMEditor.cpp: Updated to use ExceptionOr.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::toErrorString): Added an overload for
Exception.
(WebCore::InspectorDOMAgent::setAttributesAsText): Updated to use ExceptionOr.
* inspector/InspectorDOMAgent.h: Updated for above.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Updated to
use the correct version of setAttribute; there was never a risk that there
would be an exception, but now that's clearer.

* testing/Internals.cpp:
(WebCore::Internals::ensureShadowRoot): Deleted. Was unused.
(WebCore::Internals::createShadowRoot): Ditto.
* testing/Internals.idl: Updated for above.

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes): Use updated parseAttributeName,
which uses ExceptionOr and a return value instead of an out argument.
(WebCore::handleElementAttributes): Ditto.

Source/WebKit/mac:

* DOM/DOMElement.mm:
(-[DOMElement setInnerHTML:]): Updated exception handling.
(-[DOMElement setOuterHTML:]): Ditto.
(-[DOMElement setAttribute:value:]): Ditto.
(-[DOMElement setAttributeNode:]): Ditto.
(-[DOMElement removeAttributeNode:]): Ditto.
(-[DOMElement setAttributeNS:qualifiedName:value:]): Ditto.
(-[DOMElement setAttributeNodeNS:]): Ditto.
(-[DOMElement matches:]): Ditto.
(-[DOMElement closest:]): Ditto.
(-[DOMElement webkitMatchesSelector:]): Ditto.
* DOM/DOMHTMLElement.mm:
(-[DOMHTMLElement insertAdjacentElement:element:]): Ditto.
(-[DOMHTMLElement insertAdjacentHTML:html:]): Ditto.
(-[DOMHTMLElement insertAdjacentText:text:]): Ditto.
* DOM/DOMNamedNodeMap.mm:
(-[DOMNamedNodeMap setNamedItem:]): Ditto.
(-[DOMNamedNodeMap removeNamedItem:]): Ditto.
(-[DOMNamedNodeMap setNamedItemNS:]): Ditto.
(-[DOMNamedNodeMap removeNamedItemNS:localName:]): Ditto.

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMElement::setAttribute): Updated exception handling.
* DOMHTMLClasses.cpp:
(DOMHTMLElement::setInnerHTML): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
(webkit_dom_named_node_map_set_named_item): Updated exception handling.
(webkit_dom_named_node_map_remove_named_item): Ditto.
(webkit_dom_named_node_map_set_named_item_ns): Ditto.
(webkit_dom_named_node_map_remove_named_item_ns): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_set_attribute): Ditto.
(webkit_dom_element_set_attribute_node): Ditto.
(webkit_dom_element_remove_attribute_node): Ditto.
(webkit_dom_element_set_attribute_ns): Ditto.
(webkit_dom_element_set_attribute_node_ns): Ditto.
(webkit_dom_element_matches): Ditto.
(webkit_dom_element_closest): Ditto.
(webkit_dom_element_webkit_matches_selector): Ditto.
(webkit_dom_element_insert_adjacent_element): Ditto.
(webkit_dom_element_insert_adjacent_html): Ditto.
(webkit_dom_element_insert_adjacent_text): Ditto.
(webkit_dom_element_set_inner_html): Ditto.
(webkit_dom_element_set_outer_html): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
(-[WKDOMElement setAttribute:value:]): Ditto.

LayoutTests:

* fast/dom/resources/shadow-test-driver.js: Deleted. Unused.

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

2 years ago[WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
weinig@apple.com [Sun, 30 Oct 2016 22:35:00 +0000 (22:35 +0000)]
[WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
https://bugs.webkit.org/show_bug.cgi?id=164208

Reviewed by Darin Adler.

Source/WebCore:

Restructure IDLParsers structs to match modern WebIDL conventions:
- Rename structs to have more WebCore like naming, consistently using
  the prefix IDL.
- Remove domSignature. Sinking it's properties into the structs that
  contained it.
- Add IDLArgument, replacing the use of domSignatures for arguments.
  IDLArgument is the subset of domSignatures needed for arguments.
- Rename domFunction to IDLOperation (matching WebILD nomenclature),
  replace signature with its own name, type (for returnType), specials,
  and extended attributes properties.
- Give IDLAttribute it's own name, type and extended attributes properties.
- Add IDLDictionaryMember, replacing the use of domSignature as the
  type of members in IDLDictionary. Give it name, type, isRequired,
  default and extendedAttributes properties.
- Renamed Typedef to be IDLTypedef. Remove the extended attributes
  property as those are not allowed in typedefs per-PebIDL.

Also fix some parsing issues:
- Stop parsing 'in' directives in function arguments.
- Stop parsing extended attributes in typedefs.
- Support applying typedefs to types deep in aggregate types
  (e.g. (sequence<(LONG or STRING)> or DOMString)?).

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/generate-bindings.pl:
Update for new struct types.

* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestTypedefs.idl:
Remove test which tested extended attributes in typedefs,
and add a test which tests typedefs used in deep type structures.

* page/make_settings.pl:
Don't generate the 'in' prefix for arguments in IDL files.

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
Update for new struct types.

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

2 years ago[CSS Parser] Fix nth-child serialization
hyatt@apple.com [Sun, 30 Oct 2016 22:33:02 +0000 (22:33 +0000)]
[CSS Parser] Fix nth-child serialization
https://bugs.webkit.org/show_bug.cgi?id=164210

Reviewed by Darin Adler.

Our nth-child serialization preserves what the author originally
typed. Even though this is not spec-compliant (the latest CSS Syntax
spec has a dumbed down serialization process that doesn't preserve what
the author originally typed), I think it's better behavior to preserve
this text.

* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize):
Fix a bug in the serialization of number tokens that started with
a plus sign. Make sure the plus sign is preserved.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Grab the range of tokens from after the ( and up to the ) or the "of"
and then serialize them. Strip whitepsace from the ends and set that
as the selector argument.

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

2 years agoUnreviewed build fix (Direct2D)
bfulgham@apple.com [Sun, 30 Oct 2016 20:48:22 +0000 (20:48 +0000)]
Unreviewed build fix (Direct2D)

* WebView.cpp:
(WebView::paintWithDirect2D): Update for revised GraphicsContext
begin/end draw behavior.

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

2 years ago[Win][Direct2D] Correct bookkeeping for begin/end draw pairs
bfulgham@apple.com [Sun, 30 Oct 2016 20:47:16 +0000 (20:47 +0000)]
[Win][Direct2D] Correct bookkeeping for begin/end draw pairs
https://bugs.webkit.org/show_bug.cgi?id=163898

Reviewed by Darin Adler.

Simon pointed out that GraphicsContext objects are generally only created at
the time we intend to do drawing, so calling 'BeginDraw' as part of object
construction, and 'EndDraw' at time of destruction should be sufficient.

As usual, he was correct.

This patch gets rid of unneeded code and greatly simplifies the Direct2D
drawing path.

Tested by existing layout tests.

* platform/graphics/GraphicsContext.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill):Remove unneeded use
of 'RenderTargetScopedDrawing.h'.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Remove unneeded use
of RenderTargetScopedDrawing class.
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Enter
the 'BeginDraw' state at object creation.
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): End
draw state at object destruction.
(WebCore::GraphicsContextPlatformPrivate::clip): Remove unneeded call to 'beginDraw'.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Get rid of draw state flags.
(WebCore::GraphicsContext::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContext::flush): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Remove unneeded use of
RenderTargetScopedDrawing class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::didBeginDraw): Deleted.
(WebCore::GraphicsContextPlatformPrivate::beginDrawIfNeeded): Deleted.
(WebCore::GraphicsContext::beginDrawIfNeeded): Deleted.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Deleted.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Remove unneeded use of RenderTargetScopedDrawing class.
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::flushContext): Call new GraphicsContext 'flush' command.
(WebCore::ImageBuffer::draw): Remove unneeded use of RenderTargetScopedDrawing class.
* platform/graphics/win/NativeImageDirect2D.cpp: Ditto.
* platform/graphics/win/RenderTargetScopedDrawing.h: Removed.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage): Remove unneeded use of RenderTargetScopedDrawing class.

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

2 years ago[CSS Parser] Clean up the two types of descendant relations in CSSSelector
hyatt@apple.com [Sun, 30 Oct 2016 18:48:09 +0000 (18:48 +0000)]
[CSS Parser] Clean up the two types of descendant relations in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=164203

Reviewed by Zalan Bujtas.

This patch gets rid of the separate boolean for double child and allows it
to be a unique relation type. Rename Descendant to DescendantSpace and
name the new relation DescendantDoubleChild.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::hasDescendantRelation):
(WebCore::CSSSelector::hasDescendantOrChildRelation):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isDescendantCombinator):
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):

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

2 years agoUnreviewed gardening
fred.wang@free.fr [Sun, 30 Oct 2016 16:35:12 +0000 (16:35 +0000)]
Unreviewed gardening

Fix build error on WinCairo.

Patch by Frederic Wang <fwang@igalia.com> on 2016-10-30

* platform/graphics/opentype/OpenTypeMathData.cpp:

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

2 years agoUse HarfBuzz ot-math API to parse the OpenType MATH table
commit-queue@webkit.org [Sun, 30 Oct 2016 16:18:57 +0000 (16:18 +0000)]
Use HarfBuzz ot-math API to parse the OpenType MATH table
https://bugs.webkit.org/show_bug.cgi?id=162671

Patch by Frederic Wang <fwang@igalia.com> on 2016-10-30
Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake: Enable internal OpenType MATH parsing for HarfBuzz < 1.3.3.

Source/WebCore:

No new tests, already covered by existing tests.

* platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on
HarfBuzz's new OpenType MATH API.
* platform/graphics/opentype/OpenTypeMathData.h: Ditto.
(WebCore::OpenTypeMathData::hasMathData):
(WebCore::OpenTypeMathData::HbFontDeleter::operator()):

Source/WTF:

* wtf/Platform.h: By default, do not enable internal OpenType MATH parsing on GTK.

LayoutTests:

Rebaseline one test for large operators due to small rendering changes.

* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:

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

2 years ago[GTK] Build break by missing geoclue-2.0.
hw1008.kim@samsung.com [Sun, 30 Oct 2016 15:56:26 +0000 (15:56 +0000)]
[GTK] Build break by missing geoclue-2.0.
https://bugs.webkit.org/show_bug.cgi?id=164170

Reviewed by Michael Catanzaro.

Revise the module name for pkg_check_modules() in FindGeoClue2.cmake.

* Source/cmake/FindGeoClue2.cmake: replace geoclue-2.0 with libgeoclue-2.0.

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

2 years ago[EFL] Remove duplicated media/media-source tests in TestExpectations
gyuyoung.kim@webkit.org [Sun, 30 Oct 2016 15:15:15 +0000 (15:15 +0000)]
[EFL] Remove duplicated media/media-source tests in TestExpectations

Unreviewed EFL gardening.

Tests of media/media-source have caused timeout on EFL layout test. However
it hasn't been marked to *Skip* because some tests are multiple marked.
So this patch cleans up it, and skip media/media-source for a while.

* platform/efl/TestExpectations:

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

2 years ago[CSS Parser] Support unprefixed image-sets
hyatt@apple.com [Sun, 30 Oct 2016 13:42:39 +0000 (13:42 +0000)]
[CSS Parser] Support unprefixed image-sets
https://bugs.webkit.org/show_bug.cgi?id=164198

Reviewed by Dean Jackson.

* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImage):

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

2 years ago[DOM] Introduce WebCore::jsDynamicDowncast
utatane.tea@gmail.com [Sun, 30 Oct 2016 10:03:20 +0000 (10:03 +0000)]
[DOM] Introduce WebCore::jsDynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=164137

Reviewed by Darin Adler.

Source/WebCore:

In WebCore, we have several extended JSTypes, like JSElementType.
For these types, WebCore offers the faster casting function compared
to JSC::jsDynamicCast. For example, for JSElementType, we have
jsElementCast.

The problem is that we may fall into the slow code if we choose
JSC::jsDynamicCast by accident. Selecting the appropriate function
requires special care in the IDL code generator when we would like
to use faster casting functions.

This patch implements a new casting function, WebCore::jsDynamicDowncast.
It is a thin wrapper to the JSC::jsDynamicCast. But it selects the
faster casting functions correctly by template specialization.

We do not choose the way specializing JSC::jsDynamicCast directly.
If we forget to include the header that specializes JSC::jsDyanmicCast,
it does not cause any compile errors, but it causes performance regression.
This bug is hard to figure out. To avoid this problem, we add a new function.

Outside JSC, only Tools' DumpRenderTree uses JSC::jsDynamicCast.
This code has FIXME that we should use JSC APIs instead of directly calling
JSC thingy. So this should be solved in the layer of JSC APIs and changing
this jsDynamicCast to WebCore's jsDynamicDowncast and exposing WebCore's thingy
are not good change. So we leave the code as is.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue):
(WebCore::toArrayBufferView):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDocumentCustom.h:
(WebCore::jsDocumentCast):
* bindings/js/JSDynamicDowncast.h: Added.
(WebCore::JSDynamicCastTrait::cast):
(WebCore::JSDynamicCastTrait<JSNode>::cast):
(WebCore::JSDynamicCastTrait<JSElement>::cast):
(WebCore::JSDynamicCastTrait<JSDocument>::cast):
(WebCore::JSDynamicCastTrait<JSEvent>::cast):
(WebCore::jsDynamicDowncast):
* bindings/js/JSElementCustom.h:
(WebCore::jsElementCast):
* bindings/js/JSEventCustom.h:
(WebCore::jsEventCast):
* bindings/js/JSEventListener.cpp:
(WebCore::setDocumentEventHandlerAttribute):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::jsEventTargetCast):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::getSettings):
(WebCore::JSMediaStreamTrack::getCapabilities):
* bindings/js/JSNodeCustom.h:
(WebCore::jsNodeCast):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultReader):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::toJSDedicatedWorkerGlobalScope):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(GetCastingHelperForThisObject):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::jsInterfaceNameConstructor):
(WebCore::setJSInterfaceNameConstructor):
(WebCore::JSInterfaceName::toWrapped):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::setJSTestActiveDOMObjectConstructor):
(WebCore::JSTestActiveDOMObject::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
(WebCore::jsTestCEReactionsConstructor):
(WebCore::setJSTestCEReactionsConstructor):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
(WebCore::jsTestCEReactionsStringifierConstructor):
(WebCore::setJSTestCEReactionsStringifierConstructor):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::setJSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
(WebCore::jsTestEventConstructorConstructor):
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
(WebCore::jsTestEventTargetConstructor):
(WebCore::setJSTestEventTargetConstructor):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::BindingCaller<JSTestException>::castForAttribute):
(WebCore::jsTestExceptionConstructor):
(WebCore::setJSTestExceptionConstructor):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::jsTestGenerateIsReachableConstructor):
(WebCore::setJSTestGenerateIsReachableConstructor):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
(WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
(WebCore::jsTestGlobalObjectConstructor):
(WebCore::setJSTestGlobalObjectConstructor):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::BindingCaller<JSTestInterface>::castForAttribute):
(WebCore::BindingCaller<JSTestInterface>::castForOperation):
(WebCore::jsTestInterfaceConstructor):
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::BindingCaller<JSTestIterable>::castForOperation):
(WebCore::jsTestIterableConstructor):
(WebCore::setJSTestIterableConstructor):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
(WebCore::jsTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
(WebCore::jsTestMediaQueryListListenerConstructor):
(WebCore::setJSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListener::toWrapped):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
(WebCore::setJSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::BindingCaller<JSTestNode>::castForAttribute):
(WebCore::BindingCaller<JSTestNode>::castForOperation):
(WebCore::jsTestNodeConstructor):
(WebCore::setJSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::BindingCaller<JSTestNondeterministic>::castForAttribute):
(WebCore::BindingCaller<JSTestNondeterministic>::castForOperation):
(WebCore::jsTestNondeterministicConstructor):
(WebCore::setJSTestNondeterministicConstructor):
(WebCore::JSTestNondeterministic::toWrapped):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::BindingCaller<JSTestObj>::castForAttribute):
(WebCore::BindingCaller<JSTestObj>::castForOperation):
(WebCore::jsTestObjConstructor):
(WebCore::setJSTestObjConstructor):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
(WebCore::setJSTestOverloadedConstructorsConstructor):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
(WebCore::jsTestOverrideBuiltinsConstructor):
(WebCore::setJSTestOverrideBuiltinsConstructor):
(WebCore::JSTestOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
(WebCore::BindingCaller<JSTestSerialization>::castForOperation):
(WebCore::jsTestSerializationConstructor):
(WebCore::setJSTestSerializationConstructor):
(WebCore::JSTestSerialization::toWrapped):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
(WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
(WebCore::jsTestTypedefsConstructor):
(WebCore::setJSTestTypedefsConstructor):
(WebCore::JSTestTypedefs::toWrapped):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):

Source/WebKit2:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::elementForNodeHandle):

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

2 years ago[JSC] JSON.stringify should handle Proxy which is non JSArray but isArray is true
utatane.tea@gmail.com [Sun, 30 Oct 2016 09:14:37 +0000 (09:14 +0000)]
[JSC] JSON.stringify should handle Proxy which is non JSArray but isArray is true
https://bugs.webkit.org/show_bug.cgi?id=164123

Reviewed by Mark Lam.

JSTests:

* stress/json-stringify-with-non-jsarray-array.js: Added.
(shouldBe):
(shouldBe.JSON.stringify.new.Proxy):

Source/JavaScriptCore:

When JSON.stringify encounter the undefined value, the result depends
on the context. If it is produced under the object property context, we ignore
that property. On the other hand, if it is produced under the array element
context, we produce "null".

For example,
    // https://tc39.github.io/ecma262/#sec-serializejsonobject section 8.b.
    // Skip the property that value is undefined.
    JSON.stringify({ value: undefined });  // => "{}"

    // https://tc39.github.io/ecma262/#sec-serializejsonarray section 8.b.
    // Write "null" when the element is undefined.
    JSON.stringify([undefined]);           // => "[null]"

At that time, we decide the context based on the `holder->inherits(JSArray::info())`.
But it is not correct since we have a holder that creates the array element context
but it is not JSArray subtype. ES6 Proxy to an array is one example. In that case,
`isArray(exec, proxy)` returns `true`, but `inherits(JSArray::info())` returns false.
Since we already have this `isArray()` value in Stringifier::Holder, we should reuse
this here. And this is the correct behavior in the ES6 spec.

* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::isArray):
(JSC::Stringifier::stringify):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::Holder):
(JSC::Stringifier::Holder::appendNextProperty):

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

2 years agoUnreviewed EFL gardening. Mark some tests to Timeout.
gyuyoung.kim@webkit.org [Sun, 30 Oct 2016 09:14:03 +0000 (09:14 +0000)]
Unreviewed EFL gardening. Mark some tests to Timeout.

* platform/efl/TestExpectations: Urgent fix to run layout test.

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

2 years agoFix failing ExtendedColor tests.
darin@apple.com [Sun, 30 Oct 2016 06:44:32 +0000 (06:44 +0000)]
Fix failing ExtendedColor tests.

* TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp:
Changed the tests in two ways: First, use EXPECT_EQ instead of EXPECT_TRUE
for the string equality comparisons. This required including WTFStringUtilities.h.
Second, change expected results to match what the code is currently generating,
so alpha channels are "0.25" rather than "0.25 / 1". I'll let Dean fix both these
tests and the code if these results are incorrect.

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

2 years ago[CSS Parser] Add font-variant-* keyword property support
hyatt@apple.com [Sun, 30 Oct 2016 03:53:10 +0000 (03:53 +0000)]
[CSS Parser] Add font-variant-* keyword property support
https://bugs.webkit.org/show_bug.cgi?id=164195

Reviewed by Zalan Bujtas.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

2 years ago[CSS Parser] Fix text-emphasis-position parsing
hyatt@apple.com [Sun, 30 Oct 2016 03:48:06 +0000 (03:48 +0000)]
[CSS Parser] Fix text-emphasis-position parsing
https://bugs.webkit.org/show_bug.cgi?id=164197

Reviewed by Zalan Bujtas.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextEmphasisPosition):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years agoConvert more of DOM from ExceptionCode to Exception
darin@apple.com [Sun, 30 Oct 2016 02:56:39 +0000 (02:56 +0000)]
Convert more of DOM from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164173

Reviewed by Ryosuke Niwa.

Source/WebCore:

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
(WebCore::MediaDevices::enumerateDevices): Ditto.
* Modules/mediastream/MediaDevices.h: Updated for above.
* Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.

* Modules/mediastream/MediaEndpointSessionDescription.cpp:
Added now-needed include of ExceptionCode.h.

* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::parseIceServer): Use ExceptionOr.
(WebCore::RTCConfiguration::create): Ditto.
(WebCore::RTCConfiguration::initialize): Ditto.
* Modules/mediastream/RTCConfiguration.h: Updated for above.
* Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::create): Use ExceptionOr.
(WebCore::RTCDTMFSender::insertDTMF): Ditto.
* Modules/mediastream/RTCDTMFSender.h: Updated for above.
* Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create): Use ExceptionOr.
(WebCore::RTCDataChannel::setBinaryType): Ditto.
(WebCore::RTCDataChannel::send): Ditto.
(WebCore::RTCDataChannel::didReceiveRawData): Ditto.
* Modules/mediastream/RTCDataChannel.h: Updated for above.
Also fhcanged resturn values to use const AtomicString& and
unsigned instead of unsigned long. Also made more private.
Also changed BinaryType into an enum class.
* Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Use ExceptionOr.
* Modules/mediastream/RTCIceCandidate.h: Updated for above.
* Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.

* Modules/mediastream/RTCOfferAnswerOptions.cpp:
(WebCore::RTCOfferOptions::create): Use ExceptionOr.
(WebCore::RTCAnswerOptions::create): Ditto.
* Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
Also removed all virtual functions since nothing here is polymorphic
and initalized data members in the header.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
(WebCore::RTCPeerConnection::addTrack): Ditto.
(WebCore::RTCPeerConnection::removeTrack): Ditto.
(WebCore::RTCPeerConnection::addTransceiver): Ditto.
(WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
(WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
(WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
(WebCore::RTCPeerConnection::setConfiguration): Ditto.
(WebCore::RTCPeerConnection::createDataChannel): Ditto.
* Modules/mediastream/RTCPeerConnection.h: Updated for above.
* Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
* Modules/mediastream/RTCRtpSender.h: Updated for above.
* Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.

* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create): Use ExceptoinOr.
* Modules/mediastream/RTCSessionDescription.h: Updated for above.
(WebCore::RTCSessionDescription::~RTCSessionDescription):
* Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.

* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
(WebCore::verifyProtocolHandlerScheme): Ditto.
(WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
(WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
* Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
* Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.

* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.

* bindings/scripts/CodeGeneratorJS.pm:
(NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
we need to call propagateException explicitly, if return value processing is not
going to propagate the exception for us.
(GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
because it's almost as short as the function call. Use the newly created
NeedsExplicitPropagateExceptionCall function, which properly handles the case
where the return value is a promise.
(GenerateReturnParameters): Deleted.

* dom/CharacterData.cpp:
(WebCore::CharacterData::substringData): Use ExceptionOr.
(WebCore::CharacterData::insertData): Ditto.
(WebCore::CharacterData::deleteData): Ditto.
(WebCore::CharacterData::replaceData): Ditto.
* dom/CharacterData.h: Updated for above.
* dom/CharacterData.idl: Use non-legacy exceptions.

* dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
like dead code that doesn't compile.
* dom/DataTransferItemList.idl: Use non-legacy exceptions.

* dom/MessagePort.idl: Use non-legacy exceptions, except this has
already been converted and was a custom binding.

* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Use ExceptionOr.
* dom/MutationObserver.h: Updated for above.
* dom/MutationObserver.idl: Use non-legacy exception.

* dom/Range.cpp:
(WebCore::deleteCharacterData): Updated use of calls that now use
ExceptionOr.
(WebCore::Range::processContentsBetweenOffsets): Ditto.
(WebCore::Range::insertNode): Ditto.

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
* dom/ShadowRoot.h: Updated for above.
* dom/ShadowRoot.idl: Use non-legacy exception.

* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unused ExceptionCode&.
* dom/Text.h: Updated for above.
* dom/Text.idl: Use non-legacy exception.

* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Rewrote to use data rather than
substringData; more efficient.

* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
functions that return ExceptionOr.
(WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
Use WTFMove to avoid a little bit of reference count churn.
(WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
(WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
(WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.

* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
that return ExceptionCode.
(WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
with functions that return ExceptionCode.

* html/HTMLTextFormControlElement.cpp:
Added now-needed include of ExceptionCode.h.

* inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
to replaceWholeText, which never throws an exception.

Source/WebKit/mac:

* DOM/DOMCharacterData.mm:
(-[DOMCharacterData substringData:length:]): Updated since this
now uses ExceptionOr.
(-[DOMCharacterData insertData:data:]): Ditto.
(-[DOMCharacterData deleteData:length:]): Ditto.
(-[DOMCharacterData replaceData:length:data:]): Ditto.
* DOM/DOMText.mm:
(-[DOMText splitText:]): Ditto.
(-[DOMText replaceWholeText:]): Removed unneeded exception code
handling from function that does not throw an exception.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_substring_data): Updated since this
now uses ExceptionOr.
(webkit_dom_character_data_insert_data): Ditto.
(webkit_dom_character_data_delete_data): Ditto.
(webkit_dom_character_data_replace_data): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_text_replace_whole_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_split_text): Ditto.

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

2 years agoWe should have a way of profiling when a get_by_id is pure and to emit a PureGetById...
sbarati@apple.com [Sun, 30 Oct 2016 01:38:22 +0000 (01:38 +0000)]
We should have a way of profiling when a get_by_id is pure and to emit a PureGetById in the DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=163305

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/pure-get-by-id-cse-2.js: Added.
(foo):
* microbenchmarks/pure-get-by-id-cse.js: Added.
(foo):
* stress/pure-get-by-id-cse-correctness.js: Added.
(assert):
(foo):
* stress/pure-get-by-id-on-non-object.js: Added.
(assert):
(foo):

Source/JavaScriptCore:

This creates a new GetById node in the DFG called PureGetById. We emit a
PureGetById when we profile that a get_by_id in the baseline never does
side effects. PureGetById speculates on the fact that it won't do side
effects. If it realizes that it must perform side effects, it will perform
the side effect, but also invalidate the CodeBlock that compiled it,
which will cause us to exit once we return back to the compiled code.
This allows us to have stricter clobberize rules for PureGetById which
model how getOwnPropertySlot(VMInquiry) behaves. This means that PureGetByIds
can be CSEd with each other, and that other things are more likely to
be CSEd around a PureGetById. To profile if a get_by_id does side
effects, I've added an extra bit into StructureStubInfo that we write
to when performing a get_by_id slow path call. If we notice that we
never do effects, inside the ByteCodeParser, we will emit a PureGetById
instead of a GetById.

To justify the performance benefit of this patch, I ran the suite of
benchmarks with useAccessInlining=false. This meant that we don't compile
any (Multi)GetByOffset/(Multi)PutByOffset. This was just to try to see if
this patch is worth anything at all in a world where we emit many
PureGetByIds. Running the benchmarks under this mode showed a 3.5% octane
improvement and a 15% kraken improvement. However, when running benchmarks
with useAccessInlining=true (the default JSC state), this patch is neutral.
I think the main reason for this is that the DFG is good at knowing when to
emit (Multi)GetByOffset, and most benchmarks that would benefit from
PureGetById are already emitting (Multi)GetByOffset. However, PureGetById can be
profitable when we encounter code that is too polymorphic for (Multi)GetByOffset.
It's reasonable to expect that JS code in the wild will fall into this use
case even though it might not be represented in some of the major JS benchmarks.
I wrote some microbenchmarks to demonstrate the benefits of PureGetById CSE,
and they were 30% (eliminating a few PureGetById from an add expression)
to 10x faster (eliminating a PureGetById in a loop).

* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::StructureStubInfo):
(JSC::StructureStubInfo::reset):
* bytecode/StructureStubInfo.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArrayMode.cpp:
(JSC::DFG::canBecomeGetArrayLength):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToGetByOffset):
(JSC::DFG::Node::convertToMultiGetByOffset):
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileTryGetById):
(JSC::DFG::SpeculativeJIT::compilePureGetById):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetById):
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/JITOperations.cpp:
(JSC::pureGetByIdCommon):
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_try_get_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_try_get_by_id):
* jit/Repatch.cpp:
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGenericGetByIdFunction):
(JSC::tryCacheGetByID):
* jit/Repatch.h:
* profiler/ProfilerJettisonReason.cpp:
(WTF::printInternal):
* profiler/ProfilerJettisonReason.h:

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

2 years agoParse color() function
dino@apple.com [Sat, 29 Oct 2016 22:34:43 +0000 (22:34 +0000)]
Parse color() function
https://bugs.webkit.org/show_bug.cgi?id=164146
<rdar://problems/29007218>

Reviewed by Darin Adler.

Source/WebCore:

Support the new CSS color() function:
https://drafts.csswg.org/css-color/#color-function

There are separate code paths for the old and new CSS parser.

Tests: css3/color/color-function-computed-style.html
       css3/color/color-function-parsing.html

* css/CSSComputedStyleDeclaration.cpp: Use Color directly, not via rgb().
(WebCore::ComputedStyleExtractor::currentColorOrValidColor):
(WebCore::ComputedStyleExtractor::valueForShadow):
(WebCore::ComputedStyleExtractor::propertyValue):

* css/CSSValueKeywords.in: Note that there is a color function, but the
keyword is already defined. Also add keywords for the color spaces.
* css/SVGCSSValueKeywords.in: sRGB is used outside of SVG now.

* css/parser/CSSParser.cpp: Old CSS parser code to handle color().
(WebCore::isPercent): Helper to tell if a ValueWithCalculation is a percentage or not.
(WebCore::CSSParser::parseColorInt): Renamed.
(WebCore::CSSParser::parseColorDouble): Helper to get a Number/Percentage into a double
(WebCore::CSSParser::parseRGBParameters):
(WebCore::CSSParser::parseColorFunctionParameters):
(WebCore::CSSParser::parseHSLParameters):
(WebCore::CSSParser::parseColorFromValue):
(WebCore::CSSParser::colorIntFromValue): Deleted.
* css/parser/CSSParser.h:

* css/parser/CSSPropertyParserHelpers.cpp: New CSS parser code to handle color().
(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):

* platform/graphics/Color.h:
(WebCore::Color::isValid): An extended color is valid.
(WebCore::Color::rgb): Move the code to a standalone inline
so that I could add a longer comment.

* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Alpha output is only needed if != 1.

* platform/graphics/cg/ColorCG.cpp: Handle ExtendedColor -> CGColor.
(WebCore::leakCGColor):
(WebCore::cachedCGColor):

LayoutTests:

Test that exercises the new color() function in CSS. It checks
all valid and invalid input, with the exception of fallback content.

* css3/color/color-function-computed-style-expected.txt: Added.
* css3/color/color-function-computed-style.html: Added.
* css3/color/color-function-parsing-expected.txt: Added.
* css3/color/color-function-parsing.html: Added.

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

2 years ago[CSS Parser] Disable -webkit-text-size-adjust when the context says to.
hyatt@apple.com [Sat, 29 Oct 2016 21:42:15 +0000 (21:42 +0000)]
[CSS Parser] Disable -webkit-text-size-adjust when the context says to.
https://bugs.webkit.org/show_bug.cgi?id=164191

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years ago[CSS Parser] Match old parser's image-rendering values
hyatt@apple.com [Sat, 29 Oct 2016 21:25:48 +0000 (21:25 +0000)]
[CSS Parser] Match old parser's image-rendering values
https://bugs.webkit.org/show_bug.cgi?id=164190

Reviewed by Dean Jackson.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

2 years ago[CSS Parser] Support -webkit-text value for background-clip and -webkit-background...
hyatt@apple.com [Sat, 29 Oct 2016 21:18:45 +0000 (21:18 +0000)]
[CSS Parser] Support -webkit-text value for background-clip and -webkit-background-clip
https://bugs.webkit.org/show_bug.cgi?id=164189

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundBox):
(WebCore::consumePrefixedBackgroundBox):

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

2 years agoRemove some unnecessary includes
commit-queue@webkit.org [Sat, 29 Oct 2016 21:12:52 +0000 (21:12 +0000)]
Remove some unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=164174

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-29
Reviewed by Darin Adler.

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

2 years ago[CSS Parser] Support -webkit-aspect-ratio
hyatt@apple.com [Sat, 29 Oct 2016 19:14:10 +0000 (19:14 +0000)]
[CSS Parser] Support -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=164187

Reviewed by Simon Fraser.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAspectRatio):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years ago[CSS Parser] Support the caps lock indicator appearance
hyatt@apple.com [Sat, 29 Oct 2016 18:59:04 +0000 (18:59 +0000)]
[CSS Parser] Support the caps lock indicator appearance
https://bugs.webkit.org/show_bug.cgi?id=164186

Reviewed by Simon Fraser.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

2 years ago[CSS Parser] Support the alt property
hyatt@apple.com [Sat, 29 Oct 2016 18:54:52 +0000 (18:54 +0000)]
[CSS Parser] Support the alt property
https://bugs.webkit.org/show_bug.cgi?id=164184

Reviewed by Simon Fraser.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAlt):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years ago[CSS Parser] Add support for -webkit-hyphenate-limit-* properties
hyatt@apple.com [Sat, 29 Oct 2016 18:37:40 +0000 (18:37 +0000)]
[CSS Parser] Add support for -webkit-hyphenate-limit-* properties
https://bugs.webkit.org/show_bug.cgi?id=164183

Reviewed by Simon Fraser.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeHyphenateLimit):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years ago[CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands
hyatt@apple.com [Sat, 29 Oct 2016 17:46:54 +0000 (17:46 +0000)]
[CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands
https://bugs.webkit.org/show_bug.cgi?id=164178

Reviewed by Zalan Bujtas.

* css/CSSPropertyNames.in:
Patch the transform-origin-x/y and perspective-origin-x/y properties
to use new converters that can handle keywords.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponentX):
(WebCore::StyleBuilderConverter::convertPositionComponentY):
Add the new converters. They just call convertPositionComponent method
that we already use for object-position and background-position.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::CSSPropertyParser::consumePerspectiveOrigin):
Changed to treat the properties as shorthands and add the longhand
properties once parsed.

(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
Move the parsing into the shorthand method, since we're still treating
these properties as shorthands.

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

2 years agoUIScriptControllerIOS.mm should not be soft-linking UIKit
wenson_hsieh@apple.com [Sat, 29 Oct 2016 16:32:53 +0000 (16:32 +0000)]
UIScriptControllerIOS.mm should not be soft-linking UIKit
https://bugs.webkit.org/show_bug.cgi?id=164171

Reviewed by Darin Adler.

Follow-up to r208090. Instead of soft-linking, we can simply grab UIKeyboardPredictionView by name instead.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex):

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

2 years agoRemove testharness.js/testharnessreport.js unnecessary copies
commit-queue@webkit.org [Sat, 29 Oct 2016 16:21:20 +0000 (16:21 +0000)]
Remove testharness.js/testharnessreport.js unnecessary copies
https://bugs.webkit.org/show_bug.cgi?id=164112

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-29
Reviewed by Darin Adler.

Removing http/tests/w3c directory.
Contained tests are skipped in Mac, EFL and mark as failing in GTK.
These tests have not been modified since more than 3 years and are probably out-of-date compared to W3C wpt.

Updated other http/tests tests using w3c/tests/resources files to use directly /resources/ URLs.
These /resources/ URLs are using an alias to remove the need to have redundant copies.

Removed imported/blink/http/tests/resources testharness and testharnessreport.js since they are not used.
A few test files in imported/blink/http/tests use /resources/... URLs but they will not point to any of the removed files since the tests are run as file based.

* http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control.html:
* http/tests/media/resources/media-source/generate-config-change-tests.py:
* http/tests/preload/single_download_preload_runner.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/form-upgrade.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-uir-on-navigation.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/resources/insecure-site.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/resources/nested-nested-frame.html:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/resources/nested-window.html:
* http/tests/security/cross-origin-css-1.html:
* http/tests/security/cross-origin-css-2.html:
* http/tests/security/cross-origin-css-3.html:
* http/tests/security/cross-origin-css-4.html:
* http/tests/security/cross-origin-css-5.html:
* http/tests/security/cross-origin-css-6.html:
* http/tests/security/cross-origin-css-7.html:
* http/tests/security/cross-origin-css-8.html:
* http/tests/security/cross-origin-css-9.html:
* http/tests/security/cross-origin-css-in-quirks-1.html:
* http/tests/security/cross-origin-css-in-quirks-2.html:
* http/tests/security/cross-origin-css-in-quirks-3.html:
* http/tests/security/cross-origin-css-in-quirks-4.html:
* http/tests/security/cross-origin-css-in-quirks-5.html:
* http/tests/security/cross-origin-css-in-quirks-6.html:
* http/tests/security/cross-origin-css-in-quirks-7.html:
* http/tests/security/cross-origin-css-in-quirks-8.html:
* http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html:
* http/tests/security/resources/post-origin-to-parent.html:
* http/tests/security/same-origin-css-1.html:
* http/tests/security/same-origin-css-2.html:
* http/tests/security/same-origin-css-3.html:
* http/tests/security/same-origin-css-4.html:
* http/tests/security/same-origin-css-5.html:
* http/tests/security/same-origin-css-6.html:
* http/tests/security/same-origin-css-7.html:
* http/tests/security/same-origin-css-8.html:
* http/tests/security/same-origin-css-in-quirks.html:
* http/tests/security/set-domain-remove-subdomain-for-ip-address.html:
* http/tests/w3c/README: Removed.
* http/tests/w3c/resources/WebIDLParser.js: Removed.
* http/tests/w3c/resources/canvas-tests.css: Removed.
* http/tests/w3c/resources/canvas-tests.js: Removed.
* http/tests/w3c/resources/idlharness.js: Removed.
* http/tests/w3c/resources/testharness.css: Removed.
* http/tests/w3c/resources/testharness.js: Removed.
* http/tests/w3c/resources/testharnessreport.js: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/basic-expected.txt: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/basic.html: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/monotonic-clock-expected.txt: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/monotonic-clock.html: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/resources/now_frame.html: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/test_cross_frame_start-expected.txt: Removed.
* http/tests/w3c/webperf/approved/HighResolutionTime/test_cross_frame_start.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_document_open-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_document_open.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_document_readiness_exist-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_document_readiness_exist.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigate_within_document-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigate_within_document.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_attributes_exist-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_attributes_exist.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_redirectCount_none-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_redirectCount_none.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_backforward-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_backforward.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_enums-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_enums.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_reload-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_navigation_type_reload.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_no_previous_document-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_no_previous_document.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_performance_attributes_exist-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_performance_attributes_exist.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_performance_attributes_exist_in_object-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_performance_attributes_exist_in_object.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_readwrite-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_readwrite.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_attributes_exist-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_attributes_exist.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_attributes_order-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_attributes_order.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_client_redirect-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_client_redirect.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_reload-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_reload.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_server_redirect-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_server_redirect.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_xserver_redirect-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_xserver_redirect.html: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_unique_performance_objects-expected.txt: Removed.
* http/tests/w3c/webperf/approved/navigation-timing/html/test_unique_performance_objects.html: Removed.
* http/tests/w3c/webperf/resources/Ahem.ttf: Removed.
* http/tests/w3c/webperf/resources/all_resource_types.htm: Removed.
* http/tests/w3c/webperf/resources/blank_image.png: Removed.
* http/tests/w3c/webperf/resources/blank_page_green.htm: Removed.
* http/tests/w3c/webperf/resources/blank_page_green_with_allow_timing.php: Removed.
* http/tests/w3c/webperf/resources/blank_page_green_with_onunload.htm: Removed.
* http/tests/w3c/webperf/resources/blank_page_meta_redirect.htm: Removed.
* http/tests/w3c/webperf/resources/blank_page_unload.htm: Removed.
* http/tests/w3c/webperf/resources/blank_page_yellow.htm: Removed.
* http/tests/w3c/webperf/resources/blank_page_yellow_with_onunload.htm: Removed.
* http/tests/w3c/webperf/resources/empty_script.js: Removed.
* http/tests/w3c/webperf/resources/generate_resource.php: Removed.
* http/tests/w3c/webperf/resources/gray_bg.css: Removed.
* http/tests/w3c/webperf/resources/green_frame.htm: Removed.
* http/tests/w3c/webperf/resources/inject_resource_test.html: Removed.
* http/tests/w3c/webperf/resources/nested.css: Removed.
* http/tests/w3c/webperf/resources/pagevistestharness.js: Removed.
* http/tests/w3c/webperf/resources/redirect.php: Removed.
* http/tests/w3c/webperf/resources/webperftestharness.js: Removed.
* http/tests/w3c/webperf/resources/webperftestharnessextension.js: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_cached-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_cached.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_connection_reuse-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_connection_reuse.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_dynamic_insertion-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_dynamic_insertion.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_ignore_data_url-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_ignore_data_url.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_ignore_failures-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_ignore_failures.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_redirects-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_redirects.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_reparenting-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_reparenting.html: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_script_types-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_script_types.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_populate_entries-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_populate_entries.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_shrink_buffer_size-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_shrink_buffer_size.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_size_restriction-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_size_restriction.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_clear_resource_timing_functionality-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_clear_resource_timing_functionality.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_on_shrink_buffer_size-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_on_shrink_buffer_size.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_store_and_clear_during_callback-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_store_and_clear_during_callback.html: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_timing_allow_cross_origin_resource_request-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_timing_allow_cross_origin_resource_request.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMarks-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMarks.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMeasures-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMeasures.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark_exception-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark_exception.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_associate_with_navigation_timing-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_associate_with_navigation_timing.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_method_exist-expected.txt: Removed.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_method_exist.html: Removed.
* http/tests/xmlhttprequest/readystatechange-and-abort.html:
* http/tests/xmlhttprequest/response-json-and-readystate.html:
* http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html:
* http/tests/xmlhttprequest/xmlhttprequest-open-method-case-insensitive.html:
* imported/blink/http/tests/resources/testharness.js: Removed.
* imported/blink/http/tests/resources/testharnessreport.js: Removed.
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

2 years ago[CMake][Win] Visual Studio invokes make_settings.pl twice
commit-queue@webkit.org [Sat, 29 Oct 2016 16:03:25 +0000 (16:03 +0000)]
[CMake][Win] Visual Studio invokes make_settings.pl twice
https://bugs.webkit.org/show_bug.cgi?id=163774

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-29
Reviewed by Michael Catanzaro.

build-webkit recompiles some files just after finishing
build-webkit in case of using CMake VisualStudio generator because
both WebCoreDerivedSources.vcxproj and WebCoreTestSupport.vcxproj
triggers make_settings.pl.

make_settings.pl generates four files
InternalSettingsGenerated.{h,cpp,idl} and SettingsMacros.h.
WebCoreDerivedSources depends on SettingsMacros.h, and
WebCoreTestSupport depends on InternalSettingsGenerated.cpp.

This problem is described in CMake documentation:
<https://cmake.org/cmake/help/v3.0/command/add_custom_command.html>

> Do not list the output in more than one independent target that may
> build in parallel or the two instances of the rule may conflict

To solve this problem, only SettingsMacros.h is specified as
OUTPUT of add_custom_command, and other generated files are marked
as BYPRODUCTS.  As the result, only WebCoreDerivedSources target
triggers make_settings.pl. And other targets already have a
dependency to WebCoreDerivedSources target.

To support earlier versions than CMake 3.2, it uses GENERATED
source file property instead of BYPRODUCTS option.

* Source/cmake/WebKitMacros.cmake(GENERATE_SETTINGS_MACROS):
Removed extra output files from OUTPUT of add_custom_command and
added BYPRODUCTS option.

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

2 years ago[CSS Parser] Support -webkit-background-composite
hyatt@apple.com [Sat, 29 Oct 2016 15:22:39 +0000 (15:22 +0000)]
[CSS Parser] Support -webkit-background-composite
https://bugs.webkit.org/show_bug.cgi?id=164179

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years agoREGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain...
commit-queue@webkit.org [Sat, 29 Oct 2016 13:46:52 +0000 (13:46 +0000)]
REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163922

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-29
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/security/cached-svg-image-with-css-cross-domain.html

Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.

* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::mayTryReplaceEncodedData):

LayoutTests:

* http/tests/security/cached-svg-image-with-css-cross-domain-expected.html: Added.
* http/tests/security/cached-svg-image-with-css-cross-domain.html: Added.
* platform/mac/TestExpectations:

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

2 years agoREGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttp...
commit-queue@webkit.org [Sat, 29 Oct 2016 13:44:27 +0000 (13:44 +0000)]
REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
https://bugs.webkit.org/show_bug.cgi?id=163814
<rdar://problem/28917420>

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-29
Reviewed by Darin Adler.

Source/WebCore:

Tests: http/tests/xmlhttprequest/resetting-timeout-to-zero.html
       http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setTimeout): If the XHR timeout is active, resetting the timeout to zero should lead to using the default network timeout.
Since it is difficult to update the timeout once the request is sent, we mimic the default network timeout with a 60 seconds XHR timeout.
(WebCore::XMLHttpRequest::createRequest): Setting network timeout to infinity if the XHR timeout is active.

LayoutTests:

* http/tests/xmlhttprequest/resetting-timeout-to-zero-expected.txt: Added.
* http/tests/xmlhttprequest/resetting-timeout-to-zero.html: Added.
* http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout-expected.txt: Added.
* http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html: Added.
* tests-options.json:

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