WebKit.git
4 years agoTouch.prototype is undefined on iOS
rniwa@webkit.org [Wed, 11 May 2016 20:09:37 +0000 (20:09 +0000)]
Touch.prototype is undefined on iOS
https://bugs.webkit.org/show_bug.cgi?id=157560
<rdar://problem/26143008>

Reviewed by Chris Dumez.

Remove Touch and TouchList attributes from DOMWindow.
These attributes should be exposed via generated binding code (JSDOMWindow.cpp).

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::touch): Deleted.
(WebCore::JSDOMWindow::touchList): Deleted.
* page/DOMWindow.idl:

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

4 years agoChange IDBObjectStore.createIndex to take an IDL dictionary
darin@apple.com [Wed, 11 May 2016 20:04:58 +0000 (20:04 +0000)]
Change IDBObjectStore.createIndex to take an IDL dictionary
https://bugs.webkit.org/show_bug.cgi?id=157520

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath): Ditto.
(WebCore::IDBKeyPath::isValid): Ditto.
(WebCore::IDBKeyPath::operator==): Ditto.
(WebCore::IDBKeyPath::encode): Ditto.
(WebCore::IDBKeyPath::decode): Ditto.

* Modules/indexeddb/IDBKeyPath.h: Use pragma once. Make constructors non-explicit so
we can just pass a string or vector and have it turn into an IDBKeyPath. Added an enum
class named Type here and use it instead of IndexedDB::KeyPathType.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Remove unneeded local variable.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::createIndex): Changed argument type to take IndexParameters
instead of two seaparate booleans. Also updated to use IDBKeyPath::Type.

* Modules/indexeddb/IDBObjectStore.h: Removed include of IndexedDB, using a forward
decalration instead. Marked the class final. Added an IndexParameters struct and used
it for the argument to createIndex.

* Modules/indexeddb/IDBObjectStore.idl: Stopped using Custom for put, add, and
createIndex functions. Stopped using Dictionary for createIndex, using IDBIndexParameters
instead as in the specification. Added IDBIndexParameters dictionary definition.

* Modules/indexeddb/IndexedDB.h: Use pragma once. Removed KeyPathType.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue): Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Ditto.
(WebCore::canInjectIDBKeyIntoScriptValue): Ditto.
(WebCore::createKeyPathArray): Ditto.
(WebCore::toJS): Ditto.
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::putOrAdd): Deleted.
(WebCore::JSIDBObjectStore::putFunction): Deleted.
(WebCore::JSIDBObjectStore::add): Deleted.
(WebCore::JSIDBObjectStore::createIndex): Deleted.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheckExpression): Fixed code that generates a type check for
wrappers to only check types is knows how to check: wrappers and arrays, including
typed arrays. This prevents it from trying to check dictionaries.

* inspector/InspectorIndexedDBAgent.cpp: Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.

LayoutTests:

* storage/indexeddb/deleteIndex-bug110792-expected.txt: Updated result.
Test is still marked as flaky, but this is the proper expectation now.
Discovered this when I accidentally reset results for the whole directory.
* storage/indexeddb/deleteIndex-bug110792-private-expected.txt: Ditto.

* storage/indexeddb/index-basics-expected.txt: Updated to expect the simpler
type error that is generated by the bindings code as opposed to the hand written
binding. If we want to make this fancier like this for all bindings we can do
that the future in the bindings script.
* storage/indexeddb/index-basics-private-expected.txt: Ditto.
* storage/indexeddb/index-basics-workers-expected.txt: Ditto.

* storage/indexeddb/keypath-basics-expected.txt: Updated for the change that
expects null and undefined the be legal key paths. See below.
* storage/indexeddb/keypath-basics-private-expected.txt: Ditto.

* storage/indexeddb/modern/create-index-failures-expected.txt: Removed
expected results that require that we forbid null for the name and key path.
See below.
* storage/indexeddb/modern/create-index-failures-private-expected.txt: Ditto.

* storage/indexeddb/modern/resources/create-index-failures.js: Removed the test
that expects failure when null is passed for the name and key path. In both
cases, the Web IDL and IDB specifications call for the null value to be converted
to the string "null", not an exception.

* storage/indexeddb/resources/keypath-basics.js:
(prepareDatabase): Added tests for both undefined and null. Both are legal values for
the key path argument to createIndex. The Web IDL and IDB specifications call for
them to be converted to the strings "undefined" and "null", not to trigger exceptions.
(testInvalidKeyPaths): Removed tests that expect exceptions when calling createIndex
with undefined and null.

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

4 years agoRebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r200677
ryanhaddad@apple.com [Wed, 11 May 2016 19:59:32 +0000 (19:59 +0000)]
Rebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r200677

Unreviewed test gardening.

* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

4 years agoModern IDB: WebWorker support.
beidson@apple.com [Wed, 11 May 2016 19:58:05 +0000 (19:58 +0000)]
Modern IDB: WebWorker support.
https://bugs.webkit.org/show_bug.cgi?id=149953

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* IndexedDB-private-browsing/idb_webworkers-expected.txt:
* web-platform-tests/IndexedDB/idb_webworkers-expected.txt:

Source/WebCore:

No new tests (Covered by changes to existing tests).

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):

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

4 years agoUpdate Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take...
cdumez@apple.com [Wed, 11 May 2016 19:02:09 +0000 (19:02 +0000)]
Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
https://bugs.webkit.org/show_bug.cgi?id=157556

Reviewed by Darin Adler.

Source/WebCore:

Update Node::appendChild() / replaceChild() / removeChild() / insertBefore()
to take references instead of pointers. Do the parameter null checks in the
bindings instead of doing it in the implementation on Node.

Also update the ContainerNode::appendChild() / replaceChild() /
insertBefore() to take C++ references instead of Ref<>&& to avoid
unnecessarily causing ref counting churns at some call sites (including
in the bindings since they are a raw pointer to the nodes). The
implementation on ContainerNode was not actually using WTFMove() on the
Ref<>&& anyway.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::removeChild):
(WebCore::JSNode::appendChild):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::ContainerNode::cloneChildNodes):
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
* dom/ContainerNode.h:
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/Document.cpp:
(WebCore::Document::setBodyOrFrameset):
* dom/Element.cpp:
(WebCore::Element::setOuterHTML):
* dom/Node.cpp:
(WebCore::Node::insertBefore):
(WebCore::Node::replaceChild):
(WebCore::Node::removeChild):
(WebCore::Node::appendChild):
(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):
(WebCore::nodeSetPreTransformedFromNodeOrStringVector): Deleted.
(WebCore::Node::normalize): Deleted.
* dom/Node.h:
* dom/Node.idl:
* dom/NodeOrString.cpp:
(WebCore::convertNodesOrStringsIntoNode):
* dom/Range.cpp:
(WebCore::Range::processContents):
(WebCore::Range::processContentsBetweenOffsets):
(WebCore::Range::processNodes):
(WebCore::Range::processAncestorsAndTheirSiblings):
(WebCore::Range::insertNode):
(WebCore::Range::surroundContents):
* dom/Range.h:
* dom/Text.cpp:
(WebCore::Text::splitText):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply):
* editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement):
* editing/EditorCommand.cpp:
(WebCore::executeInsertNode):
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply):
(WebCore::MergeIdenticalElementsCommand::doUnapply):
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doUnapply):
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::insertFragmentForTestRendering):
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::executeApply):
(WebCore::SplitElementCommand::doUnapply):
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::executeApply):
(WebCore::WrapContentsInDummySpanCommand::doUnapply):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart):
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::readURL):
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readFilenames):
(WebCore::Editor::WebContentReader::readURL):
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
(WebCore::createFragmentFromText):
(WebCore::replaceChildrenWithFragment):
(WebCore::replaceChildrenWithText):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry):
(WebCore::FTPDirectoryDocumentParser::createTDForFilename):
(WebCore::FTPDirectoryDocumentParser::createBasicDocument):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText):
(WebCore::HTMLElement::insertAdjacent):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::tryCreateImageControls):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::createTBody):
(WebCore::HTMLTableElement::insertRow):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::insertCell):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay):
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::tryCreateControls):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElement::tryCreate):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::updateDisplayTree):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::RemoveChildAction::RemoveChildAction):
(WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
(WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
(WebCore::DOMEditor::insertBefore):
(WebCore::DOMEditor::removeChild):
(WebCore::DOMEditor::replaceChild):
* inspector/DOMEditor.h:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchNode):
(WebCore::DOMPatchSupport::innerPatchNode):
(WebCore::DOMPatchSupport::innerPatchChildren):
(WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed):
(WebCore::DOMPatchSupport::removeChildAndMoveToNew):
* inspector/DOMPatchSupport.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::removeNode):
(WebCore::InspectorDOMAgent::setNodeName):
(WebCore::InspectorDOMAgent::moveTo):
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData):
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::cloneTarget):
(WebCore::SVGUseElement::expandUseElementsInShadowTree):
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::processingInstruction):
(WebCore::XMLDocumentParser::cdataBlock):
(WebCore::XMLDocumentParser::comment):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _documentFragmentWithNodesAsParagraphs:]):

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMNode::insertBefore):
(DOMNode::removeChild):

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
(-[WKDOMNode insertNode:before:]):
(-[WKDOMNode appendChild:]):
(-[WKDOMNode removeChild:]):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
(WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):

LayoutTests:

Rebaseline several tests now that the Node API provides more useful
exception messages.

* fast/dom/Document/replaceChild-null-oldChild-expected.txt:
* fast/dom/Document/script-tests/replaceChild-null-oldChild.js:
* fast/dom/incompatible-operations-expected.txt:
* fast/dom/incompatible-operations.html:
* fast/dom/processing-instruction-appendChild-exceptions-expected.txt:
* fast/dom/processing-instruction-appendChild-exceptions.xhtml:
* fast/dom/timer-clear-interval-in-handler-and-generate-error-expected.txt:
* js/dom/dot-node-base-exception-expected.txt:
* js/dom/script-tests/dot-node-base-exception.js:

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

4 years agoModern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that...
beidson@apple.com [Wed, 11 May 2016 18:42:03 +0000 (18:42 +0000)]
Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
https://bugs.webkit.org/show_bug.cgi?id=157448

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Previously skipped tests cover new behavior, and are now unskipped).

There's two main parts to this patch:

1 - When an IDBOpenDBRequest is stop()'ed due to page navigation or worker termination,
    we now notify the IDBServer of that.
2 - Lot's of little tweaks to UniqueIDBDatabase to handle shutting down version change
    transactions and/or connections related to the cancelled openDB request.

Fortunately the changes to UniqueIDBDatabase were all well covered by existing tests.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
(WebCore::IDBOpenDBRequest::cancelForStop):
(WebCore::IDBOpenDBRequest::dispatchEvent):
* Modules/indexeddb/IDBOpenDBRequest.h:

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

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

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
(WebCore::IDBServer::IDBServer::databaseConnectionClosed):
(WebCore::IDBServer::IDBServer::openDBRequestCancelled):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
(WebCore::IDBServer::UniqueIDBDatabase::openDBRequestCancelled):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
(WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

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

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
(WebCore::InProcessIDBServer::openDBRequestCancelled):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToServer::openDBRequestCancelled):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

LayoutTests:

* TestExpectations:
* storage/indexeddb/pending-version-change-stuck-private-expected.txt:
* storage/indexeddb/pending-version-change-stuck-works-with-terminate-expected.txt:
* storage/indexeddb/pending-version-change-stuck-works-with-terminate-private-expected.txt:

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

4 years agoImprove error messages for accessing arguments.callee and similar getters in strict...
commit-queue@webkit.org [Wed, 11 May 2016 18:33:31 +0000 (18:33 +0000)]
Improve error messages for accessing arguments.callee and similar getters in strict mode
https://bugs.webkit.org/show_bug.cgi?id=157545

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

Source/JavaScriptCore:

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
Provide better error GetterSetter in strict mode.

* runtime/JSFunction.cpp:
(JSC::getThrowTypeErrorGetterSetter):
(JSC::JSFunction::defineOwnProperty):
Provide better error GetterSetter in strict mode.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::throwTypeErrorGetterSetter):
(JSC::JSGlobalObject::throwTypeErrorCalleeAndCallerGetterSetter):
(JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerInStrictModeGetterSetter):
(JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerInClassContextGetterSetter):
(JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerGetterSetter): Deleted.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncThrowTypeErrorCalleeAndCaller):
(JSC::globalFuncThrowTypeErrorArgumentsAndCallerInStrictMode):
(JSC::globalFuncThrowTypeErrorArgumentsAndCallerInClassContext):
(JSC::globalFuncThrowTypeErrorArgumentsAndCaller): Deleted.
* runtime/JSGlobalObjectFunctions.h:
Rename and expose new handles for new error getter setter native functions.

LayoutTests:

* js/basic-strict-mode-expected.txt:
* js/caller-property-expected.txt:
* js/script-tests/caller-property.js:

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

4 years agoUnreviewed, rolling out r200481.
commit-queue@webkit.org [Wed, 11 May 2016 18:13:04 +0000 (18:13 +0000)]
Unreviewed, rolling out r200481.
https://bugs.webkit.org/show_bug.cgi?id=157573

it's bad news for asm.js (Requested by pizlo on #webkit).

Reverted changeset:

"Reduce maximum JIT pool size on X86_64."
http://trac.webkit.org/changeset/200481

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

4 years agoFix a typo in r200330
mmaxfield@apple.com [Wed, 11 May 2016 18:06:03 +0000 (18:06 +0000)]
Fix a typo in r200330

Unreviewed.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:

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

4 years agoUnreviewed, rolling out r200686.
cdumez@apple.com [Wed, 11 May 2016 17:28:33 +0000 (17:28 +0000)]
Unreviewed, rolling out r200686.

Caused a lot of layout test failures

Reverted changeset:

"Sites served over insecure connections should not be allowed
to use geolocation."
https://bugs.webkit.org/show_bug.cgi?id=157423
http://trac.webkit.org/changeset/200686

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

4 years agoOptimize DataDetection's searchForLinkRemovingExistingDDLinks()
cdumez@apple.com [Wed, 11 May 2016 16:25:53 +0000 (16:25 +0000)]
Optimize DataDetection's searchForLinkRemovingExistingDDLinks()
https://bugs.webkit.org/show_bug.cgi?id=157561

Reviewed by Ryosuke Niwa.

Optimize DataDetection's searchForLinkRemovingExistingDDLinks():
1. The first loop was using Node::childNodes() to iterate over the child
   elements. Because of the recursive call, we may end up prepending
   children as we iterate over them. This is an issue because the
   childCount was cached before the loop and vector it would blow away
   the cache inside the NodeList. Switch to using ElementTraversal which
   should be both safer and more efficient. I don't believe we can use
   our nice ElementChildIterator here unfortunately as we would hit
   assertions due the the DOM mutations while iterating.
2. The second loop was using again Node::childNodes() and kept calling
   item(0) to get the first child and move it to make it the previous
   sibling of its old parent. Again, using childNodes() here is super
   inefficient because we keep modifying the children and childNodes()
   returns a live NodeList. The call to NodeList::length() would cache
   all the children in a Vector, only to blow that cache away after
  removing the first child. Switch to using ContainerNode::firstChild().
3. Drop the parentElement parameter as we can just get it from the child.
4. Use tighter typing so we don't end up calling the implementations of
   insertBefore() / removeChild() that are on Node, thus unnecessarily
   doing a is<ContainerNode>() check every time.
5. Pass element by reference instead of pointer as it cannot be null.

* editing/cocoa/DataDetection.mm:
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):

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

4 years agopreprocess-idls.pl not ignoring comments during processing
commit-queue@webkit.org [Wed, 11 May 2016 16:24:31 +0000 (16:24 +0000)]
preprocess-idls.pl not ignoring comments during processing
https://bugs.webkit.org/show_bug.cgi?id=157559

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-05-11
Reviewed by Darin Adler.

Remove comments from IDL file before processing.

* bindings/scripts/preprocess-idls.pl:
(getInterfaceExtendedAttributesFromIDL):

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

4 years agoVideos allowed to play through the Main Content restriction should not pause when...
jer.noble@apple.com [Wed, 11 May 2016 16:20:20 +0000 (16:20 +0000)]
Videos allowed to play through the Main Content restriction should not pause when scrolled off-screen.
https://bugs.webkit.org/show_bug.cgi?id=157555

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-main-content-allow-then-scroll.html

* html/MediaElementSession.cpp:
(WebCore::isMainContent):

LayoutTests:

* media/video-main-content-allow-then-scroll-expected.txt: Added.
* media/video-main-content-allow-then-scroll.html: Added.

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

4 years ago[curl] curl_easy_setopt(CURLOPT_CONNECT_ONLY) should take a long parameter
commit-queue@webkit.org [Wed, 11 May 2016 16:18:41 +0000 (16:18 +0000)]
[curl] curl_easy_setopt(CURLOPT_CONNECT_ONLY) should take a long parameter
https://bugs.webkit.org/show_bug.cgi?id=157562

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-05-11
Reviewed by Darin Adler.

The third argument of a calling curl_easy_setopt is missing.

* platform/network/curl/SocketStreamHandleCurl.cpp:
(WebCore::SocketStreamHandle::startThread): Give the third
argument of curl_easy_setopt.

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

4 years agoSites served over insecure connections should not be allowed to use geolocation.
bfulgham@apple.com [Wed, 11 May 2016 15:52:09 +0000 (15:52 +0000)]
Sites served over insecure connections should not be allowed to use geolocation.
https://bugs.webkit.org/show_bug.cgi?id=157423
<rdar://problem/23751632>

Patch by Pranjal Jumde <pjumde@apple.com> on 2016-05-11
Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/security/insecure-geolocation.html
       http/tests/security/mixedcontent-geolocation-block-insecure-content.html
       http/tests/security/mixedcontent-geolocation.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::logError):
(WebCore::Geolocation::startRequest):
Access to Geolocation will be blocked if site is not secure. An error will be logged when access to Geolocation is blocked.
(WebCore::Geolocation::shouldBlockGeolocationRequests)
Returns true if the access to the geolocation should be blocked.
* Modules/geolocation/Geolocation.h:
* dom/SecurityContext.h:
(WebCore::SecurityContext::foundMixedContent):
Returns true if insecure content was accessed over secure connection.
(WebCore::SecurityContext::setFoundMixedContent):
Sets m_foundMixedContent to true if insecure content is accessed over secure connection.
(WebCore::SecurityContext::geolocationAccessed):
Returns true if geolocation was accessed
(WebCore::SecurityContext::setGeolocationAccessed):
Sets m_geolocationAccessed to true if geolocation was accessed.
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::canDisplayInsecureContent):
Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
(WebCore::MixedContentChecker::canRunInsecureContent):
Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.

LayoutTests:

* http/tests/security/geolocation-over-insecure-content.html: Added.
* http/tests/security/geolocation-over-mixed-content-block.html: Added.
* http/tests/security/geolocation-over-mixed-content.html: Added.
* http/tests/security/insecure-geolocation-expected.txt: Added.
* http/tests/security/insecure-geolocation.html: Added.
* http/tests/security/mixedcontent-geolocation-block-insecure-content-expected.txt: Added.
* http/tests/security/mixedcontent-geolocation-block-insecure-content.html: Added.
* http/tests/security/mixedcontent-geolocation-expected.txt: Added.
* http/tests/security/mixedcontent-geolocation.html: Added.

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

4 years agoEnsure DOM iterators remain done
youenn.fablet@crf.canon.fr [Wed, 11 May 2016 07:50:49 +0000 (07:50 +0000)]
Ensure DOM iterators remain done
https://bugs.webkit.org/show_bug.cgi?id=157453

Reviewed by Darin Adler.

Source/WebCore:

Covered by updated test.

Making DOMWrapped::Iterator an Optional.
Setting it to Nullopt on the first time Iterator is returning null.

For set iterators, incrementing a counter which value is used in forEach callbacks and entries iterators.

* bindings/js/JSDOMIterator.h:
(WebCore::JSDOMIterator<JSWrapper>::asJS):
(WebCore::appendForEachArguments):
(WebCore::iteratorForEach):
(WebCore::JSDOMIterator<JSWrapper>::next):

LayoutTests:

* fast/dom/nodeListIterator-expected.txt:
* fast/text/font-face-set-javascript-expected.txt:

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

4 years ago[GTK] accessibility/aria-readonly.html is failing
jdiggs@igalia.com [Wed, 11 May 2016 07:14:31 +0000 (07:14 +0000)]
[GTK] accessibility/aria-readonly.html is failing
https://bugs.webkit.org/show_bug.cgi?id=98357

Reviewed by Chris Fleizach.

Source/WebCore:

Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
as an AtkObject attribute. In order to eliminate duplicate checks, remove
isReadOnly() and just use canSetAttributeValue(), moving all the logic into
AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
that we can explicitly expose the implicit value for aria-readonly on roles
which support this property. Also add support for ATK_STATE_CHECKABLE, both
because this state was missing and because it serves a similar function to
ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
elements that are not read-only.

Test: accessibility/form-control-value-settable.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute):
(WebCore::AccessibilityNodeObject::isRequired): Deleted.
(WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAReadOnly):
(WebCore::AccessibilityObject::ariaReadOnlyValue):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isUnvisited): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::clickPoint):
(WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
(WebCore::AccessibilityRenderObject::anchorElement): Deleted.
(WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
(WebCore::AccessibilityRenderObject::textChanged): Deleted.
(WebCore::AccessibilityRenderObject::clearChildren): Deleted.
(WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):
(getInterfaceMaskFromObject):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Source/WebKit/win:

Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY
should be added and if editable text should be supported.

* AccessibleBase.cpp:
(AccessibleBase::state):
* AccessibleTextImpl.cpp:
(AccessibleText::deleteText):
(AccessibleText::insertText):
(AccessibleText::cutText):
(AccessibleText::pasteText):
(AccessibleText::replaceText):

Tools:

Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly'
AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements,
ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined
with range verification for inputs which implement AtkValue. The latter two
additions are admittedly a heuristic workaround for platform accessibility
API differences. But they should be sufficient to facilitate cross-platform
testing of isAttributeSettable() for form elements which lack ARIA attributes.

Bump the minimum version of at-spi2-core and at-spi2-atk
to 2.15.4 (earliest version that supports STATE_READ_ONLY).

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::isAttributeSettable):
* gtk/jhbuild.modules:

LayoutTests:

As part of this change, a new AtkObject attribute and state are being exposed.
Update two tests accordingly. Also unskip the previously-failing test. Lastly,
move the Mac form-control-value-settable.html test to the shared test set,
with a minor tweak to check the platform for several elements' expectations.

* accessibility/form-control-value-settable.html: Moved to shared tests.
* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/TestExpectations: Unskipped previously-failing test.
* platform/gtk/accessibility/form-control-value-settable-expected.txt: Added.
* platform/gtk/accessibility/table-detection-expected.txt: Updated.
* platform/mac/accessibility/form-control-value-settable-expected.txt: Moved.

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

4 years agoDon't update media duration at playback end while seeking.
commit-queue@webkit.org [Wed, 11 May 2016 05:40:23 +0000 (05:40 +0000)]
Don't update media duration at playback end while seeking.
https://bugs.webkit.org/show_bug.cgi?id=157557

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-05-10
Reviewed by Jer Noble.

If JavaScript initiates a media element seek just as the media playback ends, don't update duration
to the current time as the current time is now the new seek time, not the time when playback ended.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::didEnd):

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

4 years agoTest gardening after r200646
mmaxfield@apple.com [Wed, 11 May 2016 05:10:38 +0000 (05:10 +0000)]
Test gardening after r200646

Unreviewed.

* TestExpectations:
* fast/text/unicode-range-download.html:

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

4 years agoFix typo CaptionUserPreferences::updateCaptionStyleSheetOveride
commit-queue@webkit.org [Wed, 11 May 2016 05:03:30 +0000 (05:03 +0000)]
Fix typo CaptionUserPreferences::updateCaptionStyleSheetOveride
https://bugs.webkit.org/show_bug.cgi?id=157544

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

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
(WebCore::CaptionUserPreferences::updateCaptionStyleSheetOverride):
(WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): Deleted.
* page/CaptionUserPreferences.h:
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::updateTimerFired):
(WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):

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

4 years ago[OS X] Compatible with gnu sed grammar due to compile error with gnu sed
commit-queue@webkit.org [Wed, 11 May 2016 04:52:59 +0000 (04:52 +0000)]
[OS X] Compatible with gnu sed grammar due to compile error with gnu sed
https://bugs.webkit.org/show_bug.cgi?id=157526

Patch by Shaw rich <richshaw@126.com> on 2016-05-10
Reviewed by Darin Adler.

* MigrateHeaders.make:

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

4 years agoRemove scrolledContentOffset() from rendering code
simon.fraser@apple.com [Wed, 11 May 2016 04:48:08 +0000 (04:48 +0000)]
Remove scrolledContentOffset() from rendering code
https://bugs.webkit.org/show_bug.cgi?id=157552

Reviewed by Zalan Bujtas.

scrolledContentOffset() is misleading because it returns a scrollPosition().
Just use the name scrollPosition(), returning a ScrollPosition (IntPoint),
and fix callers that need to convert to layout size.

* editing/VisibleUnits.cpp:
(WebCore::absoluteLineDirectionPointToLocalPointInBlock):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::selectionGapRectsForRepaint):
(WebCore::RenderBlock::paintSelection):
(WebCore::RenderBlock::nodeAtPoint):
(WebCore::RenderBlock::offsetForContents):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::scrollPosition):
(WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):
(WebCore::isCandidateForOpaquenessTest):
(WebCore::RenderBox::offsetFromContainer):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
(WebCore::RenderBox::scrolledContentOffset): Deleted.
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::offsetFromContainer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::mapLocalToContainer):
(WebCore::RenderObject::pushMappingToContainer):
(WebCore::RenderObject::mapAbsoluteToLocalPoint):
(WebCore::RenderObject::offsetFromContainer):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::hitInnerTextElement):

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

4 years agoAnother attempt to fix the build after r200668.
ryanhaddad@apple.com [Wed, 11 May 2016 04:26:04 +0000 (04:26 +0000)]
Another attempt to fix the build after r200668.

Unreviewed build fix.

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

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

4 years agoTried to fix the Mac build after r200668.
mitz@apple.com [Wed, 11 May 2016 03:57:13 +0000 (03:57 +0000)]
Tried to fix the Mac build after r200668.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

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

4 years agoOnly expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
weinig@apple.com [Wed, 11 May 2016 03:37:30 +0000 (03:37 +0000)]
Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
for now, since we don't have it fully implemented on Mac.

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(fromWKDataDetectorTypes):
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):

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

4 years agoTypedArray.prototype.slice should use the byteLength of passed array for memmove
keith_miller@apple.com [Wed, 11 May 2016 02:04:19 +0000 (02:04 +0000)]
TypedArray.prototype.slice should use the byteLength of passed array for memmove
https://bugs.webkit.org/show_bug.cgi?id=157551
<rdar://problem/26179914>

Reviewed by Michael Saboff.

The TypedArray.prototype.slice function would use the byteLength of the passed array
to determine the amount of data to copy. It should have been using the passed length
times the size of each element. This fixes a crash on JavaPoly.com

* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::set):
* tests/stress/typedarray-slice.js:

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

4 years agoREGRESSION(r200447): Unable to build C_LOOP with clang version 800.0.12 or higher
msaboff@apple.com [Wed, 11 May 2016 01:56:00 +0000 (01:56 +0000)]
REGRESSION(r200447): Unable to build C_LOOP with clang version 800.0.12 or higher
https://bugs.webkit.org/show_bug.cgi?id=157549

Reviewed by Keith Miller.

Disable debug annotations for C_LOOP builds.  They are inline assembly directives,
unnecessary and they cause syntax errors.

* offlineasm/asm.rb:

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

4 years agoHorizontally-scrollable items with a 3d transform are rendered incorrectly in RTL...
simon.fraser@apple.com [Wed, 11 May 2016 01:55:47 +0000 (01:55 +0000)]
Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
https://bugs.webkit.org/show_bug.cgi?id=157482
rdar://problem/26204794

Reviewed by Zalan Bujtas.
Source/WebCore:

The compositing code was confused about scroll offsets vs. scroll positions, because
of the badly named scrolledContentOffset(); we used that in one place, and scrollOffset()
lower down. Change both to use scrollOffset().

Test: compositing/rtl/rtl-with-transformed-descendants.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):

LayoutTests:

This can't be a ref test because on iOS ref test snapshots are doing by drawing, not by snapshotting layers.

* compositing/rtl/rtl-with-transformed-descendants-expected.txt: Added.
* compositing/rtl/rtl-with-transformed-descendants.html: Added.

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

4 years ago[iOS WK1] text autosizing was on for all layout tests
simon.fraser@apple.com [Wed, 11 May 2016 01:55:42 +0000 (01:55 +0000)]
[iOS WK1] text autosizing was on for all layout tests
https://bugs.webkit.org/show_bug.cgi?id=157541

Reviewed by Tim Horton.

Make sure that we transfer the WK1 text autosizing preference to Settings.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

4 years agoUnreviewed EFL Gardening on 10th May.
hs85.jeong@samsung.com [Wed, 11 May 2016 01:49:18 +0000 (01:49 +0000)]
Unreviewed EFL Gardening on 10th May.

Rebaseline missing results.

* platform/efl/TestExpectations: Removed non existing tests.
* platform/efl/accessibility/content-editable-as-textarea-expected.txt: Added.
* platform/efl/accessibility/generated-content-with-display-table-crash-expected.txt: Added.
* platform/efl/accessibility/w3c-svg-content-language-attribute-expected.txt: Added.
* platform/efl/fast/text/hyphenate-avoid-orphaned-word-expected.txt: Added.
* platform/efl/mathml/presentation/menclose-notation-values-expected.txt: Added.

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

4 years agoAdd SPI for Data Detectors to get ranges of text around an existing range.
weinig@apple.com [Wed, 11 May 2016 01:11:13 +0000 (01:11 +0000)]
Add SPI for Data Detectors to get ranges of text around an existing range.
<rdar://problem/26009749>

Reviewed by Enrica Casucci.

* WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):

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

4 years agoWeb Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
commit-queue@webkit.org [Wed, 11 May 2016 00:56:45 +0000 (00:56 +0000)]
Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
https://bugs.webkit.org/show_bug.cgi?id=157535

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-10
Reviewed by Timothy Hatcher.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.capturingStarted):
(WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
Don't re-tickle if we tickled in the last 10ms.

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

4 years agoNumerous block selection issues on iOS.
enrica@apple.com [Wed, 11 May 2016 00:20:10 +0000 (00:20 +0000)]
Numerous block selection issues on iOS.
https://bugs.webkit.org/show_bug.cgi?id=157490
rdar://problem/25717977
rdar://problem/23042215

Reviewed by Tim Horton.

Source/WebCore:

* rendering/style/RenderStyle.h:
Exporting method.

Source/WebKit2:

This patch fixes a number of issues with block selection on iOS.
We no longer eagerly choose block selection vs text selection and we
make sure we are capable of switching back to text selection from block
under every circumstance. The patch also fixes the logic used to decide
when to switch to block selection. It now computes the rectangle for the
paragraph containing the initial text selection to decide when we are
actually dragging outside the boundaries of the paragraph block.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::gestureCallback):
(WebKit::WebPageProxy::touchesCallback):
(WebKit::WebPageProxy::autocorrectionDataCallback):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::selectionBoxForRange):
(WebKit::canShrinkToTextSelection):
(WebKit::hasCustomLineHeight):
(WebKit::WebPage::rangeForWebSelectionAtPosition):
(WebKit::WebPage::contractedRangeFromHandle):
(WebKit::WebPage::updateBlockSelectionWithTouch):
(WebKit::WebPage::clearSelection):
(WebKit::WebPage::switchToBlockSelectionAtPoint):
(WebKit::WebPage::shouldSwitchToBlockModeForHandle):
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::selectWithTwoTouches):

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

4 years agoTweak underline style for data detected links
weinig@apple.com [Wed, 11 May 2016 00:16:14 +0000 (00:16 +0000)]
Tweak underline style for data detected links
https://bugs.webkit.org/show_bug.cgi?id=157546

Reviewed by Tim Horton.

Source/WebCore:

Added API Tests in Color.cpp.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Tweak the underline's opacity based on the text color. White-ish text gets
46% opacity, everything else gets 26% opacity.

* platform/graphics/Color.cpp:
(WebCore::Color::getHSV):
* platform/graphics/Color.h:
Add support for getting the HSV (also know as HSB) computation of the color
to help determine the "whiteness" of a color.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/Color.cpp: Added.
(TestWebKitAPI::TEST):
Add tests for the new Color::getHSV() function.

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

4 years agoInternal JSC profiler should have a timestamped log of events for each code block
fpizlo@apple.com [Wed, 11 May 2016 00:08:50 +0000 (00:08 +0000)]
Internal JSC profiler should have a timestamped log of events for each code block
https://bugs.webkit.org/show_bug.cgi?id=157538

Reviewed by Benjamin Poulain.
Source/JavaScriptCore:

For example, in 3d-cube, I can query the events for MMulti and I get:

1462917476.17083  MMulti#DTZ7qc                          installCode
1462917476.179663 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline installCode
1462917476.179664 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline osrEntry           at bc#49
1462917476.185651 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 1011.214233/1717.000000, -707
1462917476.187913 MMulti#DTZ7qc MMulti#DTZ7qc-2-DFG      installCode
1462917476.187917 MMulti#DTZ7qc MMulti#DTZ7qc-2-DFG      osrEntry           at bc#49
1462917476.205365 MMulti#DTZ7qc MMulti#DTZ7qc-2-DFG      jettison           due to OSRExit, counting = true, detail = (null)
1462917476.205368 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline frequentExit       bc#65: BadCache/FromDFG
1462917476.205369 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline installCode
1462917476.205482 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 1013.000000/3434.000000, -1000
1462917476.211547 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 2013.000000/3434.000000, -1000
1462917476.213721 MMulti#DTZ7qc MMulti#DTZ7qc-3-DFG      installCode
1462917476.213726 MMulti#DTZ7qc MMulti#DTZ7qc-3-DFG      osrEntry           at bc#49
1462917476.223976 MMulti#DTZ7qc MMulti#DTZ7qc-3-DFG      jettison           due to OSRExit, counting = true, detail = (null)
1462917476.223981 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline frequentExit       bc#77: BadCache/FromDFG
1462917476.223982 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline frequentExit       bc#94: BadCache/FromDFG
1462917476.223982 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline installCode
1462917476.224064 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 1013.000000/6868.000000, -1000
1462917476.224151 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 2013.000000/6868.000000, -1000
1462917476.224258 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 3013.000000/6868.000000, -1000
1462917476.224337 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 4023.000000/6868.000000, -1000
1462917476.224425 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 5023.000000/6868.000000, -1000
1462917476.224785 MMulti#DTZ7qc MMulti#DTZ7qc-1-Baseline delayOptimizeToDFG counter = 6023.396484/6868.000000, -862
1462917476.227669 MMulti#DTZ7qc MMulti#DTZ7qc-4-DFG      installCode
1462917476.227675 MMulti#DTZ7qc MMulti#DTZ7qc-4-DFG      osrEntry           at bc#0

The output is ugly but useful. We can make it less ugly later.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::jettison):
* bytecode/CodeBlock.h:
(JSC::ScriptExecutable::forEachCodeBlock):
* bytecode/DFGExitProfile.cpp:
(JSC::DFG::ExitProfile::add):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalizeCommon):
* dfg/DFGOperations.cpp:
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeFunction):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::entryOSR):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::Compilation):
(JSC::Profiler::Compilation::setJettisonReason):
(JSC::Profiler::Compilation::dump):
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerCompilation.h:
(JSC::Profiler::Compilation::uid):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::ensureBytecodesFor):
(JSC::Profiler::Database::notifyDestruction):
(JSC::Profiler::Database::addCompilation):
(JSC::Profiler::Database::toJS):
(JSC::Profiler::Database::registerToSaveAtExit):
(JSC::Profiler::Database::logEvent):
(JSC::Profiler::Database::addDatabaseToAtExit):
* profiler/ProfilerDatabase.h:
* profiler/ProfilerEvent.cpp: Added.
(JSC::Profiler::Event::dump):
(JSC::Profiler::Event::toJS):
* profiler/ProfilerEvent.h: Added.
(JSC::Profiler::Event::Event):
(JSC::Profiler::Event::operator bool):
(JSC::Profiler::Event::time):
(JSC::Profiler::Event::bytecodes):
(JSC::Profiler::Event::compilation):
(JSC::Profiler::Event::summary):
(JSC::Profiler::Event::detail):
* profiler/ProfilerUID.cpp: Added.
(JSC::Profiler::UID::create):
(JSC::Profiler::UID::dump):
(JSC::Profiler::UID::toJS):
* profiler/ProfilerUID.h: Added.
(JSC::Profiler::UID::UID):
(JSC::Profiler::UID::fromInt):
(JSC::Profiler::UID::toInt):
(JSC::Profiler::UID::operator==):
(JSC::Profiler::UID::operator!=):
(JSC::Profiler::UID::operator bool):
(JSC::Profiler::UID::isHashTableDeletedValue):
(JSC::Profiler::UID::hash):
(JSC::Profiler::UIDHash::hash):
(JSC::Profiler::UIDHash::equal):
* runtime/CommonIdentifiers.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::installCode):
* runtime/VM.h:
(JSC::VM::bytecodeIntrinsicRegistry):
(JSC::VM::shadowChicken):
* runtime/VMInlines.h:
(JSC::VM::shouldTriggerTermination):
(JSC::VM::logEvent):

Source/WTF:

* wtf/PrintStream.h:
(WTF::PrintStream::print):

Tools:

* Scripts/display-profiler-output:

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

4 years agoWeb Inspector: Can't select record bar in Frames timeline
mattbaker@apple.com [Tue, 10 May 2016 23:51:47 +0000 (23:51 +0000)]
Web Inspector: Can't select record bar in Frames timeline
https://bugs.webkit.org/show_bug.cgi?id=156963
<rdar://problem/25898256>

Reviewed by Timothy Hatcher.

Sync record selection between the Rendering Frames grid and overview graph.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGridNode.prototype.hasAncestor):
Add helper function needed by TimelineView.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WebInspector.RenderingFrameTimelineOverviewGraph.prototype._mouseClicked):
Don't deselect the selected record when clicked. Initially this seemed
like a good idea but it complicates the UI for no added value.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
Get path components from the current TimelineView instead of the
TimelineRecordingContentView, now that the selected record appears
in the bottom ContentBrowser's navigation bar.

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

4 years agoHandle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
achristensen@apple.com [Tue, 10 May 2016 23:49:01 +0000 (23:49 +0000)]
Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
https://bugs.webkit.org/show_bug.cgi?id=157354
rdar://problem/25842107

Reviewed by Darin Adler.

Source/WebCore:

No new tests.  This cannot be tested with a self-signed certificate.
This needs to be tested once we use real ssl certificates for testing.

* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
* platform/network/mac/WebCoreURLResponse.h:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
Take the NSURLRequest instead of the NSURLConnection as a parameter so we can share this code with the NSURLSession loader,
which has an NSURLSessionDataTask.  Both have the currentRequest, which is all we need in this function anyway.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
When we make a request to a http url and CFNetwork determines that that url would have redirected to an HSTS site
and it is going to change the request to an https request, this delegate callback is called.  We need to call the
redirection code to have the same behavior as the NSURLConnection-based loader.

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

4 years agobmalloc should automatically disable itself when ThreadSanitizer is used
ddkilzer@apple.com [Tue, 10 May 2016 23:47:10 +0000 (23:47 +0000)]
bmalloc should automatically disable itself when ThreadSanitizer is used
<https://webkit.org/b/157527>

Reviewed by Michael Catanzaro.

* bmalloc/Environment.cpp:
(bmalloc::isASanEnabled): Rename to isSanitizerEnabled.
(bmalloc::isSanitizerEnabled): Rename from isASanEnabled. Add
support for detecting ThreadSanitizer.
(bmalloc::Environment::computeIsBmallocEnabled): Switch from
isASanEnabled to isSanitizerEnabled.

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

4 years agoiOS rebaseline after r200464.
rniwa@webkit.org [Tue, 10 May 2016 23:38:55 +0000 (23:38 +0000)]
iOS rebaseline after r200464.

* fast/shadow-dom/touch-event-ios-expected.txt:

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

4 years agoWeb Inspector: Backend should initiate timeline recordings on page navigations to...
commit-queue@webkit.org [Tue, 10 May 2016 23:38:04 +0000 (23:38 +0000)]
Web Inspector: Backend should initiate timeline recordings on page navigations to ensure nothing is missed
https://bugs.webkit.org/show_bug.cgi?id=157504
<rdar://problem/26188642>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-10
Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Timeline.json:
Add protocol commands to enable/disable auto capture and list the
instruments that should be enabled when auto capture starts.
Add protocol event for when the backend starts an auto capture.

Source/WebCore:

Test: inspector/timeline/setAutoCaptureInstruments-errors.html

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
Pass other agents into the TimelineAgent constructor.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
Inform the TimelineAgent whenever the main frame starts a new load.

* inspector/InspectorTimelineAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
Initialize new members.

(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
Cleanup auto capture state when tearing down.

(WebCore::InspectorTimelineAgent::setAutoCaptureEnabled):
(WebCore::InspectorTimelineAgent::setAutoCaptureInstruments):
Set and validate new auto capture state from the frontend.

(WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
When page navigates start an auto capture if needed.

Source/WebInspectorUI:

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WebInspector.TimelineManager.prototype.set enabledTimelineTypes):
(WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
For backends that support it, enable/disable auto capture and the instruments to use.

(WebInspector.TimelineManager.prototype.autoCaptureStarted):
New event, stop and start a new recording. Set a flag that we should
detect the auto capturing resource so we know when the stop the
auto capture.

(WebInspector.TimelineManager.prototype._loadNewRecording):
(WebInspector.TimelineManager.prototype._addRecord):
(WebInspector.TimelineManager.prototype._startAutoCapturing): Renamed.
(WebInspector.TimelineManager.prototype._attemptAutoCapturingForFrame):
(WebInspector.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WebInspector.TimelineManager.prototype._stopAutoRecordingSoon):
(WebInspector.TimelineManager.prototype._resetAutoRecordingMaxTimeTimeout):
(WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WebInspector.TimelineManager.prototype._mainResourceDidChange):
(WebInspector.TimelineManager.prototype._mergeScriptProfileRecords):
Factor out the new path, old path, and shared code for auto capturing.
Renamed _startAutoCapturing to _attemptAutoCapturingForFrame which
better matches what it tries to do.

* UserInterface/Protocol/TimelineObserver.js:
(WebInspector.TimelineObserver.prototype.autoCaptureStarted):
Inform TimelineManager.

LayoutTests:

* inspector/timeline/setAutoCaptureInstruments-errors-expected.txt: Added.
* inspector/timeline/setAutoCaptureInstruments-errors.html: Added.

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

4 years agoVersioning.
bshafiei@apple.com [Tue, 10 May 2016 23:21:14 +0000 (23:21 +0000)]
Versioning.

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

4 years agoWeb Inspector: Debugger sidebar should refresh when Debug UI enabled/disabled
mattbaker@apple.com [Tue, 10 May 2016 23:18:12 +0000 (23:18 +0000)]
Web Inspector: Debugger sidebar should refresh when Debug UI enabled/disabled
https://bugs.webkit.org/show_bug.cgi?id=157540
<rdar://problem/26207064>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved.removeScript):
(WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved):
Remove element from both tree outlines, if it exists.

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

4 years agoMake the different evaluateWithScopeExtension implementations more consistent
commit-queue@webkit.org [Tue, 10 May 2016 23:11:52 +0000 (23:11 +0000)]
Make the different evaluateWithScopeExtension implementations more consistent
https://bugs.webkit.org/show_bug.cgi?id=157536

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-10
Reviewed by Timothy Hatcher.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
Throw the exception consistent with JSJavaScriptCallFrame.

* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
Better error message consistent with InjectedScriptHost.

* runtime/Completion.h:
* runtime/Completion.cpp:
(JSC::evaluateWithScopeExtension):
Give this an Exception out parameter like other evaluations
so the caller can decide what to do with it.

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

4 years agoMarking fast/text/unicode-range-download.html as flaky
ryanhaddad@apple.com [Tue, 10 May 2016 21:43:00 +0000 (21:43 +0000)]
Marking fast/text/unicode-range-download.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=42154

Unreviewed test gardening.

* TestExpectations:

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

4 years ago[JSC] FTL can produce GetByVal nodes without proper bounds checking
commit-queue@webkit.org [Tue, 10 May 2016 21:35:32 +0000 (21:35 +0000)]
[JSC] FTL can produce GetByVal nodes without proper bounds checking
https://bugs.webkit.org/show_bug.cgi?id=157502
rdar://problem/26027027

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-05-10
Reviewed by Filip Pizlo.

It was possible for FTL to generates GetByVal on arbitrary offsets
without any bounds checking.

The bug is caused by the order of optimization phases:
-First, the Integer Range Optimization proves that a CheckInBounds
 test can never fail.
 This proof is based on control flow or preceeding instructions
 inside a loop.
-The Loop Invariant Code Motion phase finds that the GetByVal does not
 depend on anything in the loop and hoist it out of the loop.
-> As a result, the conditions that were necessary to eliminate
   the CheckInBounds are no longer met before the GetByVal.

This patch just moves the Integer Range Optimization phase after
Loop Invariant Code Motion to make sure no code is moved after
its integer ranges bounds proofs have been used.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* tests/stress/bounds-check-not-eliminated-by-licm.js: Added.
(testInLoopTests):

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

4 years agoWeb Inspector: TimelineOverview assertion failed: Missing overview graph for timeline...
mattbaker@apple.com [Tue, 10 May 2016 21:30:09 +0000 (21:30 +0000)]
Web Inspector: TimelineOverview assertion failed: Missing overview graph for timeline type undefined
https://bugs.webkit.org/show_bug.cgi?id=157533
<rdar://problem/26204033>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._recordWasFiltered):
The OverviewTimelineView's represented object is the entire recording,
and TimelineOverview.recordWasFiltered expects a timeline. Return early
since no graph in the overview needs updating.

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

4 years agoWeb Inspector: Call Trees and Memory view blank
mattbaker@apple.com [Tue, 10 May 2016 21:26:00 +0000 (21:26 +0000)]
Web Inspector: Call Trees and Memory view blank
https://bugs.webkit.org/show_bug.cgi?id=157486
<rdar://problem/26178404>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
(WebInspector.TimelineRecordingContentView.prototype._updateTimes):
Setting current time now handled by _updateTimelineViewTimes.
(WebInspector.TimelineRecordingContentView.prototype._capturingStopped):
Update times for the current TimelineView when the recording ends.
This ensures that views that don't call TimelineView.setupDataGrid are
able to update state that depends on the ruler selection.

(WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
(WebInspector.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
Renamed from _updateTimelineViewSelection. Sets start, end, and current times.

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

4 years agoFix the !ENABLE(SHADOW_DOM) && !ENABLE(DETAILS_ELEMENT) build
ossy@webkit.org [Tue, 10 May 2016 20:45:28 +0000 (20:45 +0000)]
Fix the !ENABLE(SHADOW_DOM) && !ENABLE(DETAILS_ELEMENT) build
https://bugs.webkit.org/show_bug.cgi?id=157514

Reviewed by Ryosuke Niwa.

* dom/Element.cpp:
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):

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

4 years agoFix the !ENABLE(VIDEO) build
ossy@webkit.org [Tue, 10 May 2016 20:44:43 +0000 (20:44 +0000)]
Fix the !ENABLE(VIDEO) build
https://bugs.webkit.org/show_bug.cgi?id=157518

Reviewed by Alex Christensen.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

4 years agoFix the !ENABLE(WEB_TIMING) build
ossy@webkit.org [Tue, 10 May 2016 20:42:33 +0000 (20:42 +0000)]
Fix the !ENABLE(WEB_TIMING) build
https://bugs.webkit.org/show_bug.cgi?id=157515

Reviewed by Alex Christensen.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::loadDone):

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

4 years agoFix the !ENABLE(INDEXED_DATABASE) build
ossy@webkit.org [Tue, 10 May 2016 20:41:49 +0000 (20:41 +0000)]
Fix the !ENABLE(INDEXED_DATABASE) build
https://bugs.webkit.org/show_bug.cgi?id=157517

Reviewed by Alex Christensen.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):

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

4 years agoReturn a Promise from HTMLMediaElement.play()
jer.noble@apple.com [Tue, 10 May 2016 20:32:02 +0000 (20:32 +0000)]
Return a Promise from HTMLMediaElement.play()
https://bugs.webkit.org/show_bug.cgi?id=157400

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline web-platform-tests/html/dom/interfaces-expected.txt with new (failing) result.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Tests: media/media-play-promise-reject-error-notsupported.html
       media/media-play-promise-reject-load-abort.html
       media/media-play-promise-reject-pause-abort.html
       media/media-play-promise-reject-play-notallowed.html
       media/media-play-promise-reject-play-notsupported.html
       media/media-play-promise-resolve-when-playing.html
       media/media-play-promise-resolve.html

The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
(5 May 2016) adds support for a Promise to be returned by the play() method, to be resolved
or rejected at defined points during loading and playback.

Add utility methods which encapsulate the definitions of the equivalent algorithms from the
HTML Spec.  Add a new, overloaded play() method on HTMLMediaElement which takes a DeferredWrapper
reference.

After the change to use scheduleNotifyAboutPlaying() instead of enqueueing the "playing" event
directly, we must ensure that the notifyAboutPlaying() task does not get fired before the
"play" event preceeding it does. So re-implement GenericEventQueue (which previously used
a timer to dispatch events) to use a GenericTaskQueue instead. This ensures that all tasks and
events are interleaved in the order in which they were enqueued.

Additionally, the new pauseAfterDetachedTimerFired() event was firing out of microtask order, which
broke some W3C tests after the changes to GenericEventQueue. Move GenericEventQueue and
GenericTaskQueue to the same timing source (namely, a WebCore Timer) and interleave Events
and Tasks by having GenericEventQueue use GenericTaskQueue to issue its Events. Because
Document::postTask() cannot ensure ordering with Timer-based events, switch HTMLMediaElement
over to Timer-backed GenericTaskQueues.

Use a WeakPtr to track the destruction of TaskDispatcher<Timer> objects in pendingDispatchers().

* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::GenericEventQueue):
(WebCore::GenericEventQueue::enqueueEvent):
(WebCore::GenericEventQueue::close):
(WebCore::GenericEventQueue::cancelAllEvents):
(WebCore::GenericEventQueue::suspend):
(WebCore::GenericEventQueue::resume):
(WebCore::GenericEventQueue::sharedTimer): Deleted.
(WebCore::GenericEventQueue::sharedTimerFired): Deleted.
(WebCore::GenericEventQueue::pendingQueues): Deleted.
* dom/GenericEventQueue.h:
* platform/GenericTaskQueue.cpp: Added.
(WebCore::TaskDispatcher<Timer>::~TaskDispatcher):
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedTimer):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher<Timer>::TaskDispatcher): Deleted.
(WebCore::TaskDispatcher<Timer>::postTask): Deleted.
(WebCore::TaskDispatcher<Timer>::timerFired): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
(WebCore::HTMLMediaElement::resolvePendingPlayPromises):
(WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
(WebCore::HTMLMediaElement::notifyAboutPlaying):
(WebCore::HTMLMediaElement::noneSupported):
(WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::pauseAfterDetachedTask): Renamed from pauseAfterDetachedTimerFired.
(WebCore::HTMLMediaElement::removedFrom):
(WebCore::HTMLMediaElement::contextDestroyed):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* media/media-play-promise-reject-error-notsupported-expected.txt: Added.
* media/media-play-promise-reject-error-notsupported.html: Added.
* media/media-play-promise-reject-load-abort-expected.txt: Added.
* media/media-play-promise-reject-load-abort.html: Added.
* media/media-play-promise-reject-pause-abort-expected.txt: Added.
* media/media-play-promise-reject-pause-abort.html: Added.
* media/media-play-promise-reject-play-notallowed-expected.txt: Added.
* media/media-play-promise-reject-play-notallowed.html: Added.
* media/media-play-promise-reject-play-notsupported-expected.txt: Added.
* media/media-play-promise-reject-play-notsupported.html: Added.
* media/media-play-promise-resolve-expected.txt: Added.
* media/media-play-promise-resolve-when-playing-expected.txt: Added.
* media/media-play-promise-resolve-when-playing.html: Added.
* media/media-play-promise-resolve.html: Added.

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

4 years agoUnreviewed, rolling out r200627.
ryanhaddad@apple.com [Tue, 10 May 2016 20:21:45 +0000 (20:21 +0000)]
Unreviewed, rolling out r200627.
https://bugs.webkit.org/show_bug.cgi?id=157531

This change has caused crashes in existing LayoutTests
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"Return a Promise from HTMLMediaElement.play()"
https://bugs.webkit.org/show_bug.cgi?id=157400
http://trac.webkit.org/changeset/200627

Patch by Commit Queue <commit-queue@webkit.org> on 2016-05-10

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

4 years agoFix scrolling tree dumping
simon.fraser@apple.com [Tue, 10 May 2016 19:31:22 +0000 (19:31 +0000)]
Fix scrolling tree dumping
https://bugs.webkit.org/show_bug.cgi?id=157529

Reviewed by Tim Horton.

Source/WebCore:

Scrolling tree dumps cannot contain layerIDs because they are not stable between
runs. Fix by adding ScrollingStateTreeAsTextBehavior flags, and not dumping
the layerID for tests.

Sadly RemoteScrollingCoordinatorTransaction has a lot of duplicated code for dumping
the scrolling state tree, which should be converted to dumpProperties() at some point.

Fix the one test that suffered from this problem, and unskip it.

Test: fast/scrolling/ios/remove-scrolling-role.html

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::dumpProperties):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::dump):
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateOverflowScrollingNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):
* page/scrolling/ScrollingStateStickyNode.h:

LayoutTests:

* fast/scrolling/ios/remove-scrolling-role-expected.txt: Renamed from LayoutTests/platform/ios-simulator-wk2/scrolling/remove-scrolling-role-expected.txt.
* fast/scrolling/ios/remove-scrolling-role.html: Renamed from LayoutTests/platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html.
* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoMark fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html as flakey.
simon.fraser@apple.com [Tue, 10 May 2016 19:31:16 +0000 (19:31 +0000)]
Mark fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html as flakey.

* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

4 years agoWeb Inspector: Eliminate the crazy code for evaluateOnCallFrame
joepeck@webkit.org [Tue, 10 May 2016 19:16:19 +0000 (19:16 +0000)]
Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
https://bugs.webkit.org/show_bug.cgi?id=157510
<rdar://problem/26191332>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
Set and clear an optional scope extension object.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.evaluate):
(InjectedScript.prototype._evaluateOn):
(InjectedScript.prototype.evaluateOnCallFrame):
Unify the code to use the passed in evaluate function and object.
When evaluating on a call frame the evaluate function ends up being
DebuggerCallFrame::evaluateWithScopeExtension. When evaluating globally
this ends up being JSInjectedScriptHost::evaluateWithScopeExtension.
In both cases "object" is the preferred this object to use.

* debugger/DebuggerCallFrame.h:
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
(Inspector::JSJavaScriptCallFrame::evaluate): Deleted.
* inspector/JSJavaScriptCallFrame.h:
* inspector/JSJavaScriptCallFramePrototype.cpp:
(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
(Inspector::jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension):
* inspector/JavaScriptCallFrame.h:
(Inspector::JavaScriptCallFrame::evaluateWithScopeExtension):
(Inspector::JavaScriptCallFrame::evaluate): Deleted.
Pass through to DebuggerCallFrame with the proper arguments.

* debugger/Debugger.cpp:
(JSC::Debugger::hasBreakpoint):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction):
Use the new evaluate on call frame method name and no scope extension object.

LayoutTests:

* inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt: Added.
* inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html: Added.

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

4 years agoFix the !ENABLE(CSS_REGIONS) build after r198990
ossy@webkit.org [Tue, 10 May 2016 19:08:27 +0000 (19:08 +0000)]
Fix the !ENABLE(CSS_REGIONS) build after r198990
https://bugs.webkit.org/show_bug.cgi?id=157516

Reviewed by Ryosuke Niwa.

* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):

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

4 years agoMake super-property-access.js test run for less time because it was timing out in...
sbarati@apple.com [Tue, 10 May 2016 18:56:33 +0000 (18:56 +0000)]
Make super-property-access.js test run for less time because it was timing out in debug builds.

Rubber stamped by Filip Pizlo.

* tests/stress/super-property-access.js:
(test):
(test.value):
(test.foo):
(test.B.prototype.bar):
(test.B):

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

4 years agoFix more deprecation warnings.
andersca@apple.com [Tue, 10 May 2016 18:34:52 +0000 (18:34 +0000)]
Fix more deprecation warnings.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(NetworkServiceInitializer):
* PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
(PluginServiceInitializer):
* WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
(WebContentServiceInitializer):

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

4 years ago[SpeculativeValidation] Do not start a preload if there is already one pending
cdumez@apple.com [Tue, 10 May 2016 17:45:47 +0000 (17:45 +0000)]
[SpeculativeValidation] Do not start a preload if there is already one pending
https://bugs.webkit.org/show_bug.cgi?id=157522
<rdar://problem/26156083>

Reviewed by Alex Christensen.

Do not start a preload if there is already one pending. We failed to check in
SpeculativeLoadManager::preloadEntry() if there was already a pending preload.
As a result, we would sometimes cancel an already pending preload and start
one from scratch which is inefficient. It would also sometimes lead to hitting
an assertion in the SpeculativeLoad destructor because we could destroy the
SpeculativeLoad without finishing or cancelling the load.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):

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

4 years agoWeb Inspector: Cleanup super getter/setter now that underlying issue is fixed
commit-queue@webkit.org [Tue, 10 May 2016 17:42:58 +0000 (17:42 +0000)]
Web Inspector: Cleanup super getter/setter now that underlying issue is fixed
https://bugs.webkit.org/show_bug.cgi?id=157488
<rdar://problem/26179120>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-05-10
Reviewed by Brian Burg.

Addressed FIXMEs for bug 147064:
<https://webkit.org/b/147064> Getter and setter on super are called with wrong "this" object

* UserInterface/Views/VisualStyleKeywordPicker.js:
(WebInspector.VisualStyleKeywordPicker.prototype.get value):
(WebInspector.VisualStyleKeywordPicker.prototype.set value):
(WebInspector.VisualStyleKeywordPicker.prototype.get synthesizedValue):
(WebInspector.VisualStyleKeywordPicker.prototype._getValue): Deleted.
(WebInspector.VisualStyleKeywordPicker.prototype._setValue): Deleted.
(WebInspector.VisualStyleKeywordPicker.prototype._generateSynthesizedValue): Deleted.

* UserInterface/Views/VisualStyleNumberInputBox.js:
(WebInspector.VisualStyleNumberInputBox.prototype.set specialPropertyPlaceholderElementText):

* UserInterface/Views/VisualStyleTimingEditor.js:
(WebInspector.VisualStyleTimingEditor.prototype.get value):
(WebInspector.VisualStyleTimingEditor.prototype.set value):
(WebInspector.VisualStyleTimingEditor.prototype.get synthesizedValue):
(WebInspector.VisualStyleTimingEditor.prototype._getValue): Deleted.
(WebInspector.VisualStyleTimingEditor.prototype._setValue): Deleted.
(WebInspector.VisualStyleTimingEditor.prototype._generateSynthesizedValue): Deleted.

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

4 years agoFix a deprecation warning.
andersca@apple.com [Tue, 10 May 2016 17:32:52 +0000 (17:32 +0000)]
Fix a deprecation warning.

* DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
(DatabaseServiceInitializer):

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

4 years agoReturn a Promise from HTMLMediaElement.play()
jer.noble@apple.com [Tue, 10 May 2016 17:27:12 +0000 (17:27 +0000)]
Return a Promise from HTMLMediaElement.play()
https://bugs.webkit.org/show_bug.cgi?id=157400

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline web-platform-tests/html/dom/interfaces-expected.txt with new (failing) result.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Tests: media/media-play-promise-reject-error-notsupported.html
       media/media-play-promise-reject-load-abort.html
       media/media-play-promise-reject-pause-abort.html
       media/media-play-promise-reject-play-notallowed.html
       media/media-play-promise-reject-play-notsupported.html
       media/media-play-promise-resolve-when-playing.html
       media/media-play-promise-resolve.html

The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
(5 May 2016) adds support for a Promise to be returned by the play() method, to be resolved
or rejected at defined points during loading and playback.

Add utility methods which encapsulate the definitions of the equivalent algorithms from the
HTML Spec.  Add a new, overloaded play() method on HTMLMediaElement which takes a DeferredWrapper
reference.

After the change to use scheduleNotifyAboutPlaying() instead of enqueueing the "playing" event
directly, we must ensure that the notifyAboutPlaying() task does not get fired before the
"play" event preceeding it does. So re-implement GenericEventQueue (which previously used
a timer to dispatch events) to use a GenericTaskQueue instead. This ensures that all tasks and
events are interleaved in the order in which they were enqueued.

Additionally, the new pauseAfterDetachedTimerFired() event was firing out of microtask order, which
broke some W3C tests after the changes to GenericEventQueue. Move GenericEventQueue and
GenericTaskQueue to the same timing source (namely, a WebCore Timer) and interleave Events
and Tasks by having GenericEventQueue use GenericTaskQueue to issue its Events. Because
Document::postTask() cannot ensure ordering with Timer-based events, switch HTMLMediaElement
over to Timer-backed GenericTaskQueues.

* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::GenericEventQueue):
(WebCore::GenericEventQueue::enqueueEvent):
(WebCore::GenericEventQueue::close):
(WebCore::GenericEventQueue::cancelAllEvents):
(WebCore::GenericEventQueue::suspend):
(WebCore::GenericEventQueue::resume):
(WebCore::GenericEventQueue::sharedTimer): Deleted.
(WebCore::GenericEventQueue::sharedTimerFired): Deleted.
(WebCore::GenericEventQueue::pendingQueues): Deleted.
* dom/GenericEventQueue.h:
* platform/GenericTaskQueue.cpp: Added.
(WebCore::TaskDispatcher<Timer>::~TaskDispatcher):
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedTimer):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher<Timer>::TaskDispatcher): Deleted.
(WebCore::TaskDispatcher<Timer>::postTask): Deleted.
(WebCore::TaskDispatcher<Timer>::timerFired): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
(WebCore::HTMLMediaElement::resolvePendingPlayPromises):
(WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
(WebCore::HTMLMediaElement::notifyAboutPlaying):
(WebCore::HTMLMediaElement::noneSupported):
(WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::pauseAfterDetachedTask): Renamed from pauseAfterDetachedTimerFired.
(WebCore::HTMLMediaElement::removedFrom):
(WebCore::HTMLMediaElement::contextDestroyed):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* media/media-play-promise-reject-error-notsupported-expected.txt: Added.
* media/media-play-promise-reject-error-notsupported.html: Added.
* media/media-play-promise-reject-load-abort-expected.txt: Added.
* media/media-play-promise-reject-load-abort.html: Added.
* media/media-play-promise-reject-pause-abort-expected.txt: Added.
* media/media-play-promise-reject-pause-abort.html: Added.
* media/media-play-promise-reject-play-notallowed-expected.txt: Added.
* media/media-play-promise-reject-play-notallowed.html: Added.
* media/media-play-promise-reject-play-notsupported-expected.txt: Added.
* media/media-play-promise-reject-play-notsupported.html: Added.
* media/media-play-promise-resolve-expected.txt: Added.
* media/media-play-promise-resolve-when-playing-expected.txt: Added.
* media/media-play-promise-resolve-when-playing.html: Added.
* media/media-play-promise-resolve.html: Added.

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

4 years agoGet rid of a lot of calls to RefPtr::release()
cdumez@apple.com [Tue, 10 May 2016 17:23:09 +0000 (17:23 +0000)]
Get rid of a lot of calls to RefPtr::release()
https://bugs.webkit.org/show_bug.cgi?id=157505

Reviewed by Alex Christensen.

Get rid of a lot of calls to RefPtr::release() and use WTFMove() instead.

Source/WebCore:

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::addKeyTimerFired):
(WebCore::MediaKeySession::sendMessage):
(WebCore::MediaKeySession::sendError):
* Modules/geolocation/Geolocation.cpp:
(WebCore::createGeoposition):
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createMultiEntryArray):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::scheduleEvent):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::scheduleEvent):
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::scheduleEvent):
* Modules/notifications/DOMWindowNotifications.cpp:
(WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabaseBackend):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::unwrap):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::enqueueTextFrame):
(WebCore::WebSocketChannel::enqueueRawFrame):
(WebCore::WebSocketChannel::enqueueBlobFrame):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::createPositionOptions):
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* css/CSSBasicShapes.cpp:
(WebCore::buildSerializablePositionOffset):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForNinePieceImageRepeat):
(WebCore::counterToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* css/CSSFilterImageValue.h:
* css/CSSGrammar.y.in:
* css/CSSNamedImageValue.cpp:
(WebCore::CSSNamedImageValue::image):
* css/CSSNamedImageValue.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseAnimationProperty):
(WebCore::CSSParser::parseInsetRoundedCorners):
(WebCore::ShadowParseContext::commitLength):
(WebCore::CSSParser::parseShadow):
(WebCore::BorderImageSliceParseContext::commitNumber):
(WebCore::BorderImageQuadParseContext::commitNumber):
(WebCore::CSSParser::parseBorderRadius):
(WebCore::CSSParser::parseCounter):
(WebCore::CSSParser::parseDeprecatedGradient):
(WebCore::CSSParser::parseDeprecatedLinearGradient):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::parseLinearGradient):
(WebCore::CSSParser::parseRadialGradient):
(WebCore::CSSParser::parseTransformValue):
(WebCore::CSSParser::parseBuiltinFilterArguments):
(WebCore::CSSParser::parseTextIndent):
(WebCore::CSSParser::popRuleData):
(WebCore::CSSParser::markRuleHeaderStart):
(WebCore::CSSParser::createViewportRule):
* css/CSSParser.h:
* css/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue):
* css/CSSParserValues.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::copy):
* css/CSSValueList.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):
(WebCore::StyleBuilderConverter::convertReflection):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::cachedOrPendingFromValue):
(WebCore::StyleResolver::setOrPendingFromValue):
(WebCore::StyleResolver::cursorOrPendingFromValue):
* css/StyleResolver.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::createCSSOMWrapper):
* css/StyleRule.h:
* dom/Attr.cpp:
(WebCore::Attr::create):
* dom/Attr.h:
* dom/ContainerNode.h:
(WebCore::ChildNodesLazySnapshot::nextNode):
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
(WebCore::Document::takeDOMWindowFrom):
(WebCore::Document::updateHoverActiveState):
* dom/Element.cpp:
(WebCore::Element::detachAttribute):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::ensureAttr):
* dom/Element.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::entanglePorts):
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::nextNode):
(WebCore::NodeIterator::previousNode):
* dom/Range.cpp:
(WebCore::Range::processContentsBetweenOffsets):
* dom/StyledElement.cpp:
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::createBlockElement):
* editing/ApplyBlockElementCommand.h:
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::applyCommandToComposite):
(WebCore::CompositeEditCommand::appendBlockPlaceholder):
(WebCore::CompositeEditCommand::insertBlockPlaceholder):
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
(WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt):
(WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::wrappingStyleForSerialization):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::extractPropertiesNotIn):
(WebCore::backgroundColorInEffect):
* editing/EditingStyle.h:
* editing/Editor.cpp:
(WebCore::Editor::increaseSelectionListLevel):
(WebCore::Editor::increaseSelectionListLevelOrdered):
(WebCore::Editor::increaseSelectionListLevelUnordered):
(WebCore::Editor::findStringAndScrollToVisible):
(WebCore::Editor::rangeOfString):
* editing/Editor.h:
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
* editing/InsertParagraphSeparatorCommand.h:
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doUnapply):
* editing/ModifySelectionListLevel.cpp:
(WebCore::IncreaseSelectionListLevelCommand::doApply):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
* editing/ModifySelectionListLevel.h:
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doUnapply):
* editing/RemoveNodePreservingChildrenCommand.cpp:
(WebCore::RemoveNodePreservingChildrenCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::insertFragmentForTestRendering):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::doApply):
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::DictionaryLookup::rangeForSelection):
(WebCore::DictionaryLookup::rangeAtHitTestResult):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::finishRequestAutocomplete):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleEvent):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::addTextTrack):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
* html/HTMLMediaElement.h:
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::createVertexArrayOES):
* html/canvas/OESVertexArrayObject.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getContextAttributes):
* html/canvas/WebGLRenderingContextBase.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getCueAsHTML):
(WebCore::VTTCue::createCueRenderingTree):
* html/track/VTTCue.h:
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::createEquivalentHTMLElement):
* html/track/WebVTTElement.h:
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):
(WebCore::WebVTTParser::createDocumentFragmentFromCueText):
* html/track/WebVTTParser.h:

Source/WTF:

* wtf/text/AtomicStringImpl.cpp:
(WTF::HashAndUTF8CharactersTranslator::translate):
* wtf/text/CString.cpp:
(WTF::CString::copyBufferIfNeeded):
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBuffer):
(WTF::StringBuilder::allocateBufferUpConvert):
(WTF::StringBuilder::shrinkToFit):
* wtf/text/WTFString.cpp:
(WTF::String::append):
(WTF::String::insert):
(WTF::String::removeInternal):
* wtf/text/WTFString.h:
(WTF::String::String):
(WTF::String::operator=):
(WTF::String::releaseImpl):
(WTF::String::isNull): Deleted.

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

4 years agoAllow some leeway after page load before throttling, to allow post load events to...
barraclough@apple.com [Tue, 10 May 2016 17:05:50 +0000 (17:05 +0000)]
Allow some leeway after page load before throttling, to allow post load events to complete.
https://bugs.webkit.org/show_bug.cgi?id=157499

Reviewed by Ryosuke Niwa

* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
    - m_pageLoadActivityCounter now affects activity state indirecty, via m_pageLoadActivityHysteresis.
(WebCore::PageThrottler::pageLoadActivityCounterChanged):
    - counter updates hysteresis object, which in turn will affect activity state.
* page/PageThrottler.h:
    - added m_pageLoadActivityHysteresis, pageLoadActivityCounterChanged.

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

4 years agoClicks do not work in Safari after pressing the Track package button in Gmail
timothy_horton@apple.com [Tue, 10 May 2016 17:05:29 +0000 (17:05 +0000)]
Clicks do not work in Safari after pressing the Track package button in Gmail
https://bugs.webkit.org/show_bug.cgi?id=157508
<rdar://problem/22646404>

Reviewed by Anders Carlsson.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::viewDidMoveToWindow):
Explicitly cancel the force-click animation when we're removing the gesture
recognizer due to the WK*View being unparented. This works around a bug
where we don't get the cancellation callback in this situation, causing
Safari to be left in an inconsistent and unexpected state.

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

4 years ago[JSC] Fix the !ENABLE(DFG_JIT) build
ossy@webkit.org [Tue, 10 May 2016 16:34:26 +0000 (16:34 +0000)]
[JSC] Fix the !ENABLE(DFG_JIT) build
https://bugs.webkit.org/show_bug.cgi?id=157512

Reviewed by Mark Lam.

* jit/Repatch.cpp:

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

4 years agoREGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
zalan@apple.com [Tue, 10 May 2016 15:27:02 +0000 (15:27 +0000)]
REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
https://bugs.webkit.org/show_bug.cgi?id=157445

Reviewed by Simon Fraser.

When we don't run transitions (becasuse of to/from 'auto' values) we should also not
report the 'from' value and behave as if we finished the transition already.

Source/WebCore:

Test: fast/animation/height-auto-transition-computed-value.html

* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of
looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe).

* platform/Length.cpp:
(WebCore::blend):

LayoutTests:

* fast/animation/height-auto-transition-computed-value-expected.html: Added.
* fast/animation/height-auto-transition-computed-value.html: Added.
* imported/blink/transitions/transition-not-interpolable-expected.txt:

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

4 years ago[Linux] Remove seccomp filters support
mcatanzaro@igalia.com [Tue, 10 May 2016 14:56:00 +0000 (14:56 +0000)]
[Linux] Remove seccomp filters support
https://bugs.webkit.org/show_bug.cgi?id=157380

Reviewed by Darin Adler.

.:

* Source/cmake/FindLibSeccomp.cmake: Removed.
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebKit2:

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Deleted.
(WebKit::NetworkProcessCreationParameters::decode): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.h:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Deleted.
(WebKit::WebProcessCreationParameters::decode): Deleted.
* Shared/WebProcessCreationParameters.h:
* Shared/linux/SeccompFilters/OpenSyscall.cpp: Removed.
* Shared/linux/SeccompFilters/OpenSyscall.h: Removed.
* Shared/linux/SeccompFilters/SeccompBroker.cpp: Removed.
* Shared/linux/SeccompFilters/SeccompBroker.h: Removed.
* Shared/linux/SeccompFilters/SeccompFilters.cpp: Removed.
* Shared/linux/SeccompFilters/SeccompFilters.h: Removed.
* Shared/linux/SeccompFilters/SigactionSyscall.cpp: Removed.
* Shared/linux/SeccompFilters/SigactionSyscall.h: Removed.
* Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Removed.
* Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Removed.
* Shared/linux/SeccompFilters/Syscall.cpp: Removed.
* Shared/linux/SeccompFilters/Syscall.h: Removed.
* Shared/linux/SeccompFilters/SyscallPolicy.cpp: Removed.
* Shared/linux/SeccompFilters/SyscallPolicy.h: Removed.
* Shared/linux/SeccompFilters/XDGBaseDirectory.h: Removed.
* Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Removed.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess): Deleted.
(WebKit::WebProcessPool::createNewWebProcess): Deleted.
(WebKit::WebProcessPool::cookieStorageDirectory): Deleted.
* UIProcess/WebProcessPool.h:
* WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Removed.
* WebProcess/efl/SeccompFiltersWebProcessEfl.h: Removed.
* WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Removed.
* WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Removed.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Deleted.

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp: Removed.
* efl/jhbuild.modules:
* gtk/jhbuild.modules:

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

4 years ago[iOS] <select> elements should render right-aligned when in RTL mode
dino@apple.com [Tue, 10 May 2016 11:41:26 +0000 (11:41 +0000)]
[iOS] <select> elements should render right-aligned when in RTL mode
https://bugs.webkit.org/show_bug.cgi?id=157501
<rdar://problem/26187870>

Reviewed by Antoine Quint.

Source/WebCore:

This is the equivalent of http://webkit.org/b/157112 for iOS.
Handle <select> elements when we're in RTL mode. This means
drawing the button with the drop-down arrow on the left
side, and the button text right-aligned.

Test: fast/forms/select-non-native-rendering-direction.html
plus a bunch of other ones that needed rebaselining.

* rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter.
(WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions.
(WebCore::adjustInputElementButtonStyle):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in
RTL mode.

LayoutTests:

Rebaseline now that iOS is doing the right thing.

* platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt:
* platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt:
* platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt:
* platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:

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

4 years agoNodeList should be iterable
youenn.fablet@crf.canon.fr [Tue, 10 May 2016 09:47:44 +0000 (09:47 +0000)]
NodeList should be iterable
https://bugs.webkit.org/show_bug.cgi?id=131443
<rdar://problem/25731519>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/dom/nodeListIterator.html

Updating JSKeyValueIterator to support map and set iterators,
depending on the signature of the result type of DOMClass::Iterator::next method.
Symbol.iterator method is made the same as values method for set iterators.

Adding support for NodeList.
Updating FontFaceSet to take benefit of that.

* bindings/js/JSDOMBinding.h:
(WebCore::jsPair):.
* bindings/js/JSKeyValueIterator.h:
(WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator.
(WebCore::IteratorInspector::test):
(WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator.
(WebCore::iteratorValueToJS): Ditto.
(WebCore::keyValueIteratorForEach):
(WebCore::JSKeyValueIterator<JSWrapper>::next):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions): Removed the line forbidding set iterators.
Making Symbol.iterator function equal to values for set iterators.
* bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions.
* bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names.
* bindings/scripts/test/TestNode.idl: Making TestNode set iterable.
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator.
* css/FontFaceSet.h:
* css/FontFaceSet.idl:
* dom/NodeList.h: Making NodeList iterable.
(WebCore::NodeList::Iterator::Iterator):
(WebCore::NodeList::Iterator::next):
(WebCore::NodeList::createIterator):
* dom/NodeList.idl:

LayoutTests:

* fast/dom/domListEnumeration-expected.txt:
* fast/dom/nodeListIterator-expected.txt: Added.
* fast/dom/nodeListIterator.html: Added.
* fast/dom/script-tests/domListEnumeration.js:
* fast/text/font-face-set-javascript-expected.txt:
* fast/text/font-face-set-javascript.html:

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

4 years ago[css-grid] Implement auto-repeat computation
svillar@igalia.com [Tue, 10 May 2016 07:46:08 +0000 (07:46 +0000)]
[css-grid] Implement auto-repeat computation
https://bugs.webkit.org/show_bug.cgi?id=157473

Reviewed by Darin Adler.

Source/WebCore:

We added support for parsing and style for the new auto-repeat syntax. This patch actually
implements the feature by computing the number of auto-repeat tracks that will be part of
the explicit grid depending on the available size on the corresponding axis.

Note that we still do not drop the empty tracks, i.e., auto-fit will work exactly as
auto-fill until the empty track removal is implemented.

Some test results are not totally correct yet because we need to add the line names to the
computed style. As that requires a rather large piece of code it will be done in a follow up
patch. Track sizes are correct though.

Tests: fast/css-grid-layout/grid-auto-fill-columns.html
       fast/css-grid-layout/grid-auto-fill-rows.html
       fast/css-grid-layout/grid-change-auto-repeat-tracks.html
       fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001.html
       fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002.html
       fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003.html
       fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004.html
       fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTrackRepeatFunction): Add the CSSAutoRepeatValue directly
instead of adding the track size.
* css/StyleBuilderCustom.h: Store the insertion point in style.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::guttersSize): Replaced size_t by unsigned.
(WebCore::RenderGrid::rawGridTrackSize): New function which retrieves the track size from
either explicit (including auto-repeat tracks) or implicit tracks.
(WebCore::RenderGrid::gridTrackSize): Use rawGridTrackSize().
(WebCore::RenderGrid::computeAutoRepeatTracksCount): This is the core of the patch. This
method computes the number of auto-repeat tracks that fits on the available size for a given
axis (or 1 if that's indefinite).
* rendering/RenderGrid.h:

LayoutTests:

Apart from some home made tests I'm importing 5 patches from Mozilla's test suite as they
perfectly test the behavior of auto-repeat with positioned items. I've commented auto-fit
tests as that feature isn't implemented yet.

* fast/css-grid-layout/grid-auto-fill-columns-expected.txt: Added.
* fast/css-grid-layout/grid-auto-fill-columns.html: Added.
* fast/css-grid-layout/grid-auto-fill-rows-expected.txt: Added.
* fast/css-grid-layout/grid-auto-fill-rows.html: Added.
* fast/css-grid-layout/grid-change-auto-repeat-tracks-expected.txt: Added.
* fast/css-grid-layout/grid-change-auto-repeat-tracks.html: Added.
* fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
* fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001-expected.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002-expected.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003-expected.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004-expected.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005-expected.html: Added.
* fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005.html: Added.

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

4 years agoWeb Inspector: CRASH under JSC::DebuggerCallFrame::thisValue when hitting breakpoint
commit-queue@webkit.org [Tue, 10 May 2016 06:36:42 +0000 (06:36 +0000)]
Web Inspector: CRASH under JSC::DebuggerCallFrame::thisValue when hitting breakpoint
https://bugs.webkit.org/show_bug.cgi?id=157442
<rdar://problem/24172015>

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

Source/JavaScriptCore:

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::thisValueForCallFrame):
When the thisValue is JSValue() return undefined and avoid calling
toThisValue which would lead to a crash. Having `this` be an empty
JSValue could happen inside an ES6 class constructor, before
calling super.

LayoutTests:

* inspector/debugger/break-in-constructor-before-super-expected.txt: Added.
* inspector/debugger/break-in-constructor-before-super.html: Added.

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

4 years agoFix GTK build after r200607
achristensen@apple.com [Tue, 10 May 2016 05:04:24 +0000 (05:04 +0000)]
Fix GTK build after r200607

* Modules/notifications/Notification.h:
dir and replaceId are used in WebNotificationManager with NOTIFICATIONS and with LEGACY_NOTIFICATIONS

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

4 years agoUnreviewed, fix cloop.
fpizlo@apple.com [Tue, 10 May 2016 04:58:30 +0000 (04:58 +0000)]
Unreviewed, fix cloop.

* bytecode/ValueProfile.cpp:
(JSC::ResultProfile::emitDetectNumericness):
(JSC::ResultProfile::emitSetNonNumber):
* bytecode/ValueProfile.h:
(JSC::ResultProfile::addressOfFlags):
(JSC::ResultProfile::addressOfSpecialFastPathCount):
(JSC::ResultProfile::detectNumericness):
(JSC::ResultProfile::hasBits):

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

4 years agoFix the Windows build after r200602, and do some minor tidyup.
simon.fraser@apple.com [Tue, 10 May 2016 04:52:31 +0000 (04:52 +0000)]
Fix the Windows build after r200602, and do some minor tidyup.

* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::contentsHidden):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::contentsHidden):
(PlatformCALayerWin::setContentsHidden):
* platform/graphics/ca/win/PlatformCALayerWin.h:

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

4 years agoREGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
timothy_horton@apple.com [Tue, 10 May 2016 03:40:58 +0000 (03:40 +0000)]
REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
https://bugs.webkit.org/show_bug.cgi?id=157503
<rdar://problem/23736297>

Reviewed by Anders Carlsson.

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
Restore a requiresUnifiedScaleFactor that was lost in r191922.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
because the PluginView doesn't exist at this point, so it can't answer
the handlesPageScaleGesture question correctly (or at all).
Instead, we'll send the message when the main-frame PluginView is initialized.

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

4 years agoCrash beneath ObjCCallbackFunctionImpl::call
msaboff@apple.com [Tue, 10 May 2016 03:22:39 +0000 (03:22 +0000)]
Crash beneath ObjCCallbackFunctionImpl::call
https://bugs.webkit.org/show_bug.cgi?id=157491

Reviewed by Saam Barati.

Clear any exceptions after the micro task runs.

Tried creating a test case, but I don't have source for the app.
I can't seem to find the right combination of Promises and ObjC code.

* runtime/JSJob.cpp:
(JSC::JSJobMicrotask::run):

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

4 years agoiOS-scrolling test cleanup.
simon.fraser@apple.com [Tue, 10 May 2016 02:55:20 +0000 (02:55 +0000)]
iOS-scrolling test cleanup.

Move iOS scrolling tests from platform/ios-simulator/fast/scrolling/ios to fast/scrolling/ios/.
Rebaseline those that need it. Enable some in iOS WK1 if they pass.

Try to make fast/scrolling/ios/touch-scroll-visibility-hidden.html not flakey

* fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt.
* fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/clipping-ancestor-with-accelerated-scrolling-ancestor.html.
* fast/scrolling/ios/iframe-inside-overflow-clipping-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/iframe-inside-overflow-clipping-expected.txt.
* fast/scrolling/ios/iframe-inside-overflow-clipping.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/iframe-inside-overflow-clipping.html.
* fast/scrolling/ios/overflow-clip-with-accelerated-scrolling-ancestor-expected.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-clip-with-accelerated-scrolling-ancestor-expected.html.
* fast/scrolling/ios/overflow-clip-with-accelerated-scrolling-ancestor.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-clip-with-accelerated-scrolling-ancestor.html.
* fast/scrolling/ios/overflow-div-scrolling-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-div-scrolling-expected.txt.
* fast/scrolling/ios/overflow-div-scrolling.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-div-scrolling.html.
* fast/scrolling/ios/overflow-scroll-inherited-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scroll-inherited-expected.txt.
* fast/scrolling/ios/overflow-scroll-inherited.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scroll-inherited.html.
* fast/scrolling/ios/overflow-scroll-touch-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scroll-touch-expected.txt.
* fast/scrolling/ios/overflow-scroll-touch.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scroll-touch.html.
* fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip-expected.txt.
* fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip-size-expected.txt.
* fast/scrolling/ios/overflow-scrolling-ancestor-clip-size.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip-size.html.
* fast/scrolling/ios/overflow-scrolling-ancestor-clip.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip.html.
* fast/scrolling/ios/remove-overflow-crash-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/remove-overflow-crash-expected.txt.
* fast/scrolling/ios/remove-overflow-crash.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/remove-overflow-crash.html.
* fast/scrolling/ios/resources/jump-back.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/resources/jump-back.html.
* fast/scrolling/ios/script-tests/TEMPLATE.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/script-tests/TEMPLATE.html.
* fast/scrolling/ios/script-tests/overflow-div-scrolling.js: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/script-tests/overflow-div-scrolling.js.
(verifyScrollOffset):
* fast/scrolling/ios/scroll-event-from-scrollTo-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-event-from-scrollTo-expected.txt.
* fast/scrolling/ios/scroll-event-from-scrollTo.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-event-from-scrollTo.html.
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-events-back-forward-after-pageshow-expected.txt.
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-events-back-forward-after-pageshow.html.
* fast/scrolling/ios/scroll-events-back-forward-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-events-back-forward-expected.txt.
* fast/scrolling/ios/scroll-events-back-forward.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scroll-events-back-forward.html.
* fast/scrolling/ios/scrollTo-at-page-load-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrollTo-at-page-load-expected.txt.
* fast/scrolling/ios/scrollTo-at-page-load.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrollTo-at-page-load.html.
* fast/scrolling/ios/scrollbar-hiding-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/scrollbar-hiding-expected.txt.
* fast/scrolling/ios/scrollbar-hiding.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrollbar-hiding.html.
* fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/scrolling-content-clip-to-viewport-expected.txt.
* fast/scrolling/ios/scrolling-content-clip-to-viewport.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrolling-content-clip-to-viewport.html.
* fast/scrolling/ios/table-cell-touch-scrolling-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/table-cell-touch-scrolling-expected.txt.
* fast/scrolling/ios/table-cell-touch-scrolling.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/table-cell-touch-scrolling.html.
* fast/scrolling/ios/textarea-scroll-touch-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/textarea-scroll-touch-expected.txt.
* fast/scrolling/ios/textarea-scroll-touch.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/textarea-scroll-touch.html.
* fast/scrolling/ios/touch-scroll-back-forward-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/touch-scroll-back-forward-expected.txt.
* fast/scrolling/ios/touch-scroll-back-forward.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/touch-scroll-back-forward.html.
* fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* fast/scrolling/ios/touch-stacking-expected.txt: Copied from LayoutTests/platform/ios-simulator/ios/scrolling/touch-stacking-expected.txt.
* fast/scrolling/ios/touch-stacking.html: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/touch-stacking.html.
* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png: Added.
* platform/ios-simulator/fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/overflow-scrolling-ancestor-clip-size-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/scrollbar-hiding-expected.png: Added.
* platform/ios-simulator/fast/scrolling/ios/scrollbar-hiding-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrollbar-hiding-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/scrolling-content-clip-to-viewport-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/textarea-scroll-touch-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/textarea-scroll-touch-expected.txt.
* platform/ios-simulator/fast/scrolling/ios/touch-stacking-expected.png: Added.
* platform/ios-simulator/fast/scrolling/ios/touch-stacking-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/scrolling/touch-stacking-expected.txt.

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

4 years agoWeb Inspector: Filtering by Errors/Warnings should not filter Breakpoints list
mattbaker@apple.com [Tue, 10 May 2016 02:45:14 +0000 (02:45 +0000)]
Web Inspector: Filtering by Errors/Warnings should not filter Breakpoints list
https://bugs.webkit.org/show_bug.cgi?id=157481
<rdar://problem/26177346>

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
New UI strings.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.showResourcesWithIssuesOnlyFilterFunction):
Only filter tree elements belonging to the scripts tree outline.
(WebInspector.DebuggerSidebarPanel):
Drive-by cleanup of Issues filter button tooltips.

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

4 years agoChange Notification constructor to take an IDL dictionary instead of a WebCore::Dicti...
darin@apple.com [Tue, 10 May 2016 02:31:03 +0000 (02:31 +0000)]
Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=157466

Reviewed by Alex Christensen.

* Modules/notifications/Notification.cpp: Got rid of unneeded includes.
(WebCore::Notification::Notification): Deleted the unused default constructor. Changed
NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the
ScriptExecutionContext arguments to be a Document since the code relies on that already.
Used the lambda form of timer creation instead of the class member form. Added a FIXME
about when m_notificationCenter can be null.
(WebCore::Notification::create): Changed NotificationCenter argument to be reference
rather than PassRefPtr. Changed options argument to be Options rather than Dictionary.
(WebCore::directionString): Added. Helper because the class still wants to store the
direction as a string, at least for now.
(WebCore::Notification::show): Streamlined the code a bit.
(WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda
inside the constructor.
(WebCore::Notification::permission): Removed unneeded const from return type.
(WebCore::Notification::permissionString): Ditto.

* Modules/notifications/Notification.h: Used pragma once, updated for changes above.
Removed a number of unused functions, including cancel, setIconURL, setLang,
stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and
taskTimerFired.

* Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead
of Dictionary to the constructor. Note that this is only a subset of what is
currently specified in the Notifications API document. The latest document specifies
a much more complex feature with lots more options.

* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::createNotification): Pass a reference rather than a
pointer to this.
* Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded
includes and forward declarations. Fixed #if to be easier to read.

* bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and
DefaultConverter structs so we can do partial specialization in the future and so
we can get custom types for optional values. Used this to make an optional String
just be a null String, so it won't try to use Optional<String> instead. Might get
more complex latter when we add support for nullable.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent): Generate a blank line to make the output
slightly clearer. Tweaked a comment.
(GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax
needed in C++ code.
(GenerateDefaultValueWithLeadingComma): Added. Helper for use below.
(GenerateDictionaryImplementationContent): Use GenerateDefaultValue and
GenerateDefaultValueWithLeadingComma to make default values.
(GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code
path. This is a step in the direction of being able to make the whole thing more
generic in the future.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
Regenerated.

* bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases
to cover more combinations of the dictionary and enumeration support.

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

4 years agoPolymorphic operands in operators coerces downstream values to double.
fpizlo@apple.com [Tue, 10 May 2016 02:01:28 +0000 (02:01 +0000)]
Polymorphic operands in operators coerces downstream values to double.
https://bugs.webkit.org/show_bug.cgi?id=151793

Reviewed by Mark Lam.
Source/JavaScriptCore:

Previously if an object flowed into arithmetic, the prediction propagation phase would either
assume that the output of the arithmetic had to be double or sometimes it would assume that it
couldn't be double. We want it to only assume that the output is double if it actually had been.

The first part of this patch is to roll out http://trac.webkit.org/changeset/200502. That removed
some of the machinery that we had in place to detect whether the output of an operation is int or
double. That changeset claimed that the machinery was "fundamentally broken". It actually wasn't.
The reason why it didn't work was that ByteCodeParser was ignoring it if likelyToTakeSlowCase was
false. I think this was a complete goof-up: the code in ByteCodeParser::makeSafe was structured
in a way that made it non-obvious that the method is a no-op if !likelyToTakeSlowCase. So, this
change rolls out r200502 and makes ResultProfile do its job by reshaping how makeSafe processes
it.

This also makes two other changes to shore up ResultProfile:
- OSR exit can now refine a ResultProfile the same way that it refines ValueProfile.
- Baseline JIT slow paths now set bits in ResultProfile.

Based on this stuff, the DFG now predicts int/double/string in op_add/op_sub/op_mul based on
ResultProfiles. To be conservative, we still only use the ResultProfiles if the incoming
prediction is not number-or-boolean. This ensures that we exactly retain our old behavior in
those cases for which it was tuned. But I hope to remove this soon. I believe that ResultProfile
is already strictly better than what prediction propagation was doing before.

This can be an enormous win. This patch adds some simple microbenchmarks that demonstrate the
problem of assuming that arithmetic on objects returns double. The most extreme of these speeds
up 8x with this change (object-int-add-array).

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::addFrequentExitSite):
(JSC::CodeBlock::hasExitSite):
* bytecode/DFGExitProfile.cpp:
(JSC::DFG::FrequentExitSite::dump):
(JSC::DFG::ExitProfile::ExitProfile):
(JSC::DFG::ExitProfile::~ExitProfile):
(JSC::DFG::ExitProfile::add):
* bytecode/DFGExitProfile.h:
(JSC::DFG::FrequentExitSite::isHashTableDeletedValue):
* bytecode/MethodOfGettingAValueProfile.cpp:
(JSC::MethodOfGettingAValueProfile::fromLazyOperand):
(JSC::MethodOfGettingAValueProfile::emitReportValue):
(JSC::MethodOfGettingAValueProfile::getSpecFailBucket): Deleted.
* bytecode/MethodOfGettingAValueProfile.h:
(JSC::MethodOfGettingAValueProfile::MethodOfGettingAValueProfile):
(JSC::MethodOfGettingAValueProfile::operator bool):
(JSC::MethodOfGettingAValueProfile::operator!): Deleted.
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/ValueProfile.cpp:
(JSC::ResultProfile::emitDetectBitsLight):
(JSC::ResultProfile::emitSetDouble):
(JSC::ResultProfile::emitSetNonNumber):
(WTF::printInternal):
* bytecode/ValueProfile.h:
(JSC::ResultProfile::ResultProfile):
(JSC::ResultProfile::bytecodeOffset):
(JSC::ResultProfile::specialFastPathCount):
(JSC::ResultProfile::didObserveNonInt32):
(JSC::ResultProfile::didObserveDouble):
(JSC::ResultProfile::didObserveNonNegZeroDouble):
(JSC::ResultProfile::didObserveNegZeroDouble):
(JSC::ResultProfile::didObserveNonNumber):
(JSC::ResultProfile::didObserveInt32Overflow):
(JSC::ResultProfile::didObserveInt52Overflow):
(JSC::ResultProfile::setObservedNonNegZeroDouble):
(JSC::ResultProfile::setObservedNegZeroDouble):
(JSC::ResultProfile::setObservedNonNumber):
(JSC::ResultProfile::setObservedInt32Overflow):
(JSC::ResultProfile::addressOfFlags):
(JSC::ResultProfile::addressOfSpecialFastPathCount):
(JSC::ResultProfile::detectBitsLight):
(JSC::ResultProfile::hasBits):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::ensureNaturalLoops):
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
(JSC::DFG::Graph::valueProfileFor): Deleted.
* dfg/DFGGraph.h:
(JSC::DFG::Graph::hasExitSite):
(JSC::DFG::Graph::numBlocks):
* dfg/DFGNode.h:
(JSC::DFG::Node::arithNodeFlags):
(JSC::DFG::Node::mayHaveNonIntResult):
(JSC::DFG::Node::mayHaveDoubleResult):
(JSC::DFG::Node::mayHaveNonNumberResult):
(JSC::DFG::Node::hasConstantBuffer):
* dfg/DFGNodeFlags.cpp:
(JSC::DFG::dumpNodeFlags):
* dfg/DFGNodeFlags.h:
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfEqual):
(JSC::AssemblyHelpers::branchIfNotCell):
(JSC::AssemblyHelpers::branchIfNotNumber):
(JSC::AssemblyHelpers::branchIfNotDoubleKnownNotInt32):
(JSC::AssemblyHelpers::branchIfBoolean):
(JSC::AssemblyHelpers::branchIfEmpty):
(JSC::AssemblyHelpers::branchStructure):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::CCallHelpers):
(JSC::CCallHelpers::setupArguments):
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/IntrinsicEmitter.cpp:
(JSC::AccessCase::emitIntrinsicGetter):
* jit/JIT.h:
* jit/JITAddGenerator.cpp:
(JSC::JITAddGenerator::generateFastPath):
* jit/JITAddGenerator.h:
(JSC::JITAddGenerator::JITAddGenerator):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_add):
(JSC::JIT::emitSlow_op_add):
(JSC::JIT::emit_op_div):
(JSC::JIT::emit_op_mul):
(JSC::JIT::emitSlow_op_mul):
(JSC::JIT::emit_op_sub):
(JSC::JIT::emitSlow_op_sub):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
(JSC::JIT::callOperationNoExceptionCheck):
* jit/JITMulGenerator.cpp:
(JSC::JITMulGenerator::generateFastPath):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITSubGenerator.cpp:
(JSC::JITSubGenerator::generateFastPath):
* jit/JITSubGenerator.h:
(JSC::JITSubGenerator::JITSubGenerator):
* jit/TagRegistersMode.cpp: Added.
(WTF::printInternal):
* jit/TagRegistersMode.h: Added.
* runtime/CommonSlowPaths.cpp:
(JSC::updateResultProfileForBinaryArithOp):

LayoutTests:

* js/regress/object-int-add-array-expected.txt: Added.
* js/regress/object-int-add-array.html: Added.
* js/regress/object-int-add-expected.txt: Added.
* js/regress/object-int-add.html: Added.
* js/regress/object-int-mul-array-expected.txt: Added.
* js/regress/object-int-mul-array.html: Added.
* js/regress/object-int-sub-array-expected.txt: Added.
* js/regress/object-int-sub-array.html: Added.
* js/regress/object-int-sub-expected.txt: Added.
* js/regress/object-int-sub.html: Added.
* js/regress/script-tests/object-int-add-array.js: Added.
(i.o.valueOf):
* js/regress/script-tests/object-int-add.js: Added.
(i.o.valueOf):
* js/regress/script-tests/object-int-mul-array.js: Added.
(i.o.valueOf):
* js/regress/script-tests/object-int-sub-array.js: Added.
(i.o.valueOf):
* js/regress/script-tests/object-int-sub.js: Added.
(i.o.valueOf):

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

4 years agoREGRESSION: Web Inspector: DOM path bar blinks when modifying inline styles
nvasilyev@apple.com [Tue, 10 May 2016 01:40:26 +0000 (01:40 +0000)]
REGRESSION: Web Inspector: DOM path bar blinks when modifying inline styles
https://bugs.webkit.org/show_bug.cgi?id=149258
<rdar://problem/22737843>

Reviewed by Timothy Hatcher.

* UserInterface/Base/Utilities.js:
(Array.shallowEqual):
* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._updateContentViewNavigationItems):
(WebInspector.ContentBrowser.prototype._removeAllNavigationItems):
Don't re-render the navigation bar when all new navigation items match the previous ones.

* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WebInspector.HierarchicalPathNavigationItem.set components.let.componentsEqual):
(WebInspector.HierarchicalPathNavigationItem.prototype.set components):
Don't re-render HierarchicalPathComponent when all new path components match the previous ones.

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

4 years agoLand correct result for a recently added test.
simon.fraser@apple.com [Tue, 10 May 2016 01:35:48 +0000 (01:35 +0000)]
Land correct result for a recently added test.

* fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt:

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

4 years agoModern IDB: Have server database connections remember the OpenDB request that spawned...
beidson@apple.com [Tue, 10 May 2016 00:59:33 +0000 (00:59 +0000)]
Modern IDB: Have server database connections remember the OpenDB request that spawned them.
https://bugs.webkit.org/show_bug.cgi?id=157498

Reviewed by Tim Horton.

No new tests (No testable change in behavior, debug only for now).

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::create):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::openRequestIdentifier):

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

4 years ago[iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with...
simon.fraser@apple.com [Tue, 10 May 2016 00:20:27 +0000 (00:20 +0000)]
[iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
https://bugs.webkit.org/show_bug.cgi?id=157496
Source/WebCore:

Reviewed by Tim Horton.

UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.

Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
user interaction on these views.

Test: fast/scrolling/ios/touch-scroll-visibility-hidden.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsVisibility): We have to tell the scrolling layer
if we have visibility:hidden.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::contentsHidden):
(PlatformCALayerCocoa::setContentsHidden):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):

Source/WebKit2:

rdar://problem/22963278

Reviewed by Tim Horton.

UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.

Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
user interaction on these views.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit
test needs to take view.isUserInteractionEnabled into account.
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setHidden):
(WebKit::PlatformCALayerRemote::contentsHidden):
(WebKit::PlatformCALayerRemote::setContentsHidden):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

Tools:

rdar://problem/22963278

Reviewed by Tim Horton.

Enhance UIScriptController to generate a drag, which is useful for scrolling.

* WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:
* WebKitTestRunner/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::dragFromPointToPoint):
* WebKitTestRunner/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator dragWithStartPoint:endPoint:duration:completionBlock:]):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::dragFromPointToPoint):

LayoutTests:

rdar://problem/22963278

Reviewed by Tim Horton.

Add a fast/scrolling/ios directory, disable it everywhere except on iOS.

* TestExpectations:
* fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt: Added.
* fast/scrolling/ios/touch-scroll-visibility-hidden.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoWeb Font is downloaded even when all the characters in the document are outside its...
mmaxfield@apple.com [Tue, 10 May 2016 00:13:01 +0000 (00:13 +0000)]
Web Font is downloaded even when all the characters in the document are outside its unicode-range
https://bugs.webkit.org/show_bug.cgi?id=42154
<rdar://problem/17779042>

Reviewed by Darin Adler.

Source/WebCore:

Fonts are requested in two stages:
- For a given font family, all the relevant @font-face rules are consulted. We build up a
mapping of unicode-range -> Font object. This result is cached.
- Then, when we have the mapping, we look up the character we are trying to render to
find the appropriate Font object.

However, we are not supposed to create any Font objects (because that causes a download to
be triggered) until we consult with the character we're trying to render. Therefore, this
patch swaps out the Font objects with a FontAccessor. This FontAccessor is essentially a
lazily-created Font. When step 2 starts looking up the appropriate character, the
FontAccessor will be asked to start the download.

Test: fast/text/unicode-range-download.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::removeClient):
as a client from all its CSSFontFaces.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::clear): Clearing the CSSFontFaceSet needs to remove itself as a
client from all its CSSFontFaces.
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSFontAccessor::create): The lazy Font object.
(WebCore::CSSFontAccessor::CSSFontAccessor): Ditto.
(WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Appends a FontAccessor.
(WebCore::CSSSegmentedFontFace::fontRanges): Create the FontAccessor and use it instead.
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::determinePitch): Use the fontForFirstRange() convenience
function.
(WebCore::glyphPageFromFontRanges): font() may now return nullptr. Update this function to
handle that.
* platform/graphics/FontRanges.cpp:
(WebCore::FontRanges::Range::font): Trigger the lazy initialization.
(WebCore::TrivialFontAccessor::create): Used in the case where there is only one font in
the Ranges object and it has a full unicode-range.
(WebCore::TrivialFontAccessor::TrivialFontAccessor):
(WebCore::FontRanges::FontRanges): Use TrivialFontAccessor.
(WebCore::FontRanges::glyphDataForCharacter): font() may now return nullptr. Update this
function to handle that. This is where the magic happens: this is where we trigger
downloads only if the character falls within the unicode-range.
(WebCore::FontRanges::fontForFirstRange): Add ASSERT.
(WebCore::FontRanges::isLoading): Update to use the new FontAccessor.
* platform/graphics/FontRanges.h: Ditto.
(WebCore::FontRanges::Range::Range):
(WebCore::FontRanges::Range::fontAccessor):
(WebCore::FontRanges::appendRange):
(WebCore::FontRanges::Range::font): Deleted.
* platform/graphics/FontSelector.h: The virtual base class of FontAccessor. This is
necessary because it must be shared between platform code and non-platform code.
(WebCore::FontAccessor::~FontAccessor):

LayoutTests:

* fast/text/unicode-range-download-expected.txt: Added.
* fast/text/unicode-range-download.html: Added.
* fast/text/resources/unicode-range-download-Ahem.otf: Added.
* fast/text/resources/unicode-range-download-Ahem.ttf: Added.
* fast/text/resources/unicode-range-download-Ahem.woff: Added.
* imported/blink/svg/custom/resources/graffiti.svg: Added.
imported/blink/svg/custom/svg-fonts-unloaded-segment.html requires this font.

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

4 years agoWeb Inspector: Remove Global Breakpoints folder
mattbaker@apple.com [Tue, 10 May 2016 00:02:30 +0000 (00:02 +0000)]
Web Inspector: Remove Global Breakpoints folder
https://bugs.webkit.org/show_bug.cgi?id=157478
<rdar://problem/26176524>

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
Remove UI string.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement):
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
Remove references to folder tree element.

(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
Top level comparison should check for "special" breakpoints.

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

4 years ago[WebKit1] Invoking a link preview on a complex link (e.g. an image) results in an...
timothy_horton@apple.com [Tue, 10 May 2016 00:00:06 +0000 (00:00 +0000)]
[WebKit1] Invoking a link preview on a complex link (e.g. an image) results in an empty TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=157497
<rdar://problem/25872773>

Reviewed by Anders Carlsson.

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _defaultAnimationController]):
r198578 fixed this for WebKit2, but forgot about WebKit1.

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

4 years agoModern IDB: Prevent the same transaction from being commited/aborted twice.
beidson@apple.com [Mon, 9 May 2016 23:59:55 +0000 (23:59 +0000)]
Modern IDB: Prevent the same transaction from being commited/aborted twice.
https://bugs.webkit.org/show_bug.cgi?id=157494

Reviewed by Tim Horton.

When a page navigates or a worker terminates, in rare cases with specific unfortunate timing, the IDBServer
might receive a request to commit/abort a transaction that is already in the process of committing/aborting.

By moving transactions that are finishing into their own map we can at least detect this situation and
return an error. This seems like an improvement over some mysterious ASSERTs/timeouts.

No new tests:
While apparent that this is at least partially to blame for some existing timeouts/ASSERTs, I could not nail
down a reliable way to reproduce this with a dedicated test.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions):
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted): Renamed from inProgressTransactionCompleted.
(WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

4 years agoCallObjectConstructor should not call operationToThis in the FTL
keith_miller@apple.com [Mon, 9 May 2016 23:51:20 +0000 (23:51 +0000)]
CallObjectConstructor should not call operationToThis in the FTL
https://bugs.webkit.org/show_bug.cgi?id=157492
<rdar://problem/26149904>

Reviewed by Mark Lam.

At some point when I was working on intrinsifying the Object
constructor, I realized that the Object constructor was different
from the ToObject operation. I fixed the DFG but I guess I didn't
fix the FTL.

This patch fixes an issue with www.wunderground.com not loading
the 10-day forecast and local map.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallObjectConstructor):
* tests/stress/call-object-constructor.js: Added.
(test):
(assert):

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

4 years agoDraw border and correct icon for placeholder attachments
timothy_horton@apple.com [Mon, 9 May 2016 23:48:17 +0000 (23:48 +0000)]
Draw border and correct icon for placeholder attachments
https://bugs.webkit.org/show_bug.cgi?id=157495
rdar://problem/19982510

Reviewed by Anders Carlsson.

* Resources/AttachmentPlaceholder.png: Added.
* Resources/AttachmentPlaceholder@2x.png: Added.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::attachmentPlaceholderBorderColor):
(WebCore::paintAttachmentIconPlaceholder):
(WebCore::paintAttachmentProgress):
(WebCore::paintAttachmentPlaceholderBorder):
(WebCore::RenderThemeMac::paintAttachment):
If progress is set, but set to 0, draw a dashed border around the attachment
and use the placeholder "download" artwork.

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

4 years agoIntroduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and...
adachan@apple.com [Mon, 9 May 2016 22:50:34 +0000 (22:50 +0000)]
Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=157493

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen):

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):

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

4 years agoWeb Inspector: Heap Snapshot Timeline view can be live
mattbaker@apple.com [Mon, 9 May 2016 22:01:30 +0000 (22:01 +0000)]
Web Inspector: Heap Snapshot Timeline view can be live
https://bugs.webkit.org/show_bug.cgi?id=157487
<rdar://problem/26178439>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView.prototype.get showsLiveRecordingData): Deleted.
Don't override, should return true.

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

4 years agoClean up iOS text autosizing code
simon.fraser@apple.com [Mon, 9 May 2016 21:57:43 +0000 (21:57 +0000)]
Clean up iOS text autosizing code
https://bugs.webkit.org/show_bug.cgi?id=157489

Reviewed by Zalan Bujtas.

Change the TraverseNextInclusionFunction and HeightTypeTraverseNextInclusionFunction
to take references.

Use downcast<> more.

Whitespace cleanup.

* rendering/RenderBlockFlow.cpp:
(WebCore::isNonBlocksOrNonFixedHeightListItems):
* rendering/RenderElement.cpp:
(WebCore::includeNonFixedHeight):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::traverseNext):
* rendering/RenderObject.h:
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustNodeSizes):
(WebCore::TextAutoSizingValue::reset):

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

4 years agoAdd WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
adachan@apple.com [Mon, 9 May 2016 21:53:43 +0000 (21:53 +0000)]
Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
https://bugs.webkit.org/show_bug.cgi?id=157434

Reviewed by Darin Adler.

* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageIsPlayingVideoInEnhancedFullscreen):
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
* UIProcess/WebPageProxy.h:

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

4 years agoAdd injected bundle SPI for getting favicon and touch icon URLs
andersca@apple.com [Mon, 9 May 2016 20:41:31 +0000 (20:41 +0000)]
Add injected bundle SPI for getting favicon and touch icon URLs
https://bugs.webkit.org/show_bug.cgi?id=157435

Reviewed by Darin Adler.

Source/WebCore:

* CMakeLists.txt:
Add new files.

* WebCore.xcodeproj/project.pbxproj:
Add new files.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::iconType):
* html/HTMLLinkElement.h:
Rename LinkRelAttribute::IconType to LinkIconType.

* html/LinkIconCollector.cpp: Added.
(WebCore::iconSize):
New helper function that returns the icon size for an icon.

(WebCore::compareIcons):
Icon comparison function, to be used by for sorting.

(LinkIconCollector::iconsOfTypes):
Gather the right icons, sort them (descending by size) and return them.

* html/LinkIconCollector.h:
Added.

* html/LinkIconType.h:
Move icon type declarations here and arrange them so we can use them in an OptionSet.

* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute):
* html/LinkRelAttribute.h:
* loader/icon/IconController.cpp:
(WebCore::iconFromLinkElements):
Rename IconType to LinkIconType.

Source/WebKit2:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(collectIcons):
New helper function that calls into the WebCore LinkCollector.

(-[WKWebProcessPlugInFrame appleTouchIconURLs]):
Call collectIcons.

(-[WKWebProcessPlugInFrame faviconURLs]):
Ditto.

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

4 years agoRemove testRunner.setTextAutosizingEnabled and migrate the one test that uses it
simon.fraser@apple.com [Mon, 9 May 2016 20:22:58 +0000 (20:22 +0000)]
Remove testRunner.setTextAutosizingEnabled and migrate the one test that uses it
https://bugs.webkit.org/show_bug.cgi?id=157480

Reviewed by Zalan Bujtas.

Migrate the one test that used testRunner.setTextAutosizingEnabled() to window.internals.settings.setTextAutosizingEnabled()
and move it next to the other iOS text autosizing tests.
Tools:

Remove testRunner.setTextAutosizingEnabled(), which was only implemented in DumpRenderTree.

* DumpRenderTree/TestRunner.cpp:
(setTextAutosizingEnabledCallback): Deleted.
(TestRunner::staticFunctions): Deleted.
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setTextAutosizingEnabled): Deleted.

LayoutTests:

* fast/text-autosizing/ios/textarea-auto-sizing-disable-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/fast/html/textarea-auto-sizing-disable-expected.txt.
* fast/text-autosizing/ios/textarea-auto-sizing-disable.html: Renamed from LayoutTests/platform/ios-simulator/ios/fast/html/textarea-auto-sizing-disable.html.
* platform/ios-simulator/TestExpectations:

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

4 years agoUpstream some iOS text autosizing tests.
simon.fraser@apple.com [Mon, 9 May 2016 20:22:54 +0000 (20:22 +0000)]
Upstream some iOS text autosizing tests.

* fast/text-autosizing/ios/anonymous-block.html: Added.
* fast/text-autosizing/ios/contenteditable.html: Added.
* fast/text-autosizing/ios/first-letter.html: Added.
* fast/text-autosizing/ios/font-family-case-insensitive-expected.txt: Added.
* fast/text-autosizing/ios/font-family-case-insensitive.html: Added.
* fast/text-autosizing/ios/lists.html: Added.
* fast/text-autosizing/ios/overflow.html: Added.
* fast/text-autosizing/ios/percent-adjust-length-line-height-expected.txt: Added.
* fast/text-autosizing/ios/percent-adjust-length-line-height.html: Added.
* fast/text-autosizing/ios/percent-adjust-number-line-height-expected.txt: Added.
* fast/text-autosizing/ios/percent-adjust-number-line-height.html: Added.
* fast/text-autosizing/ios/percent-adjust-percent-line-height-expected.txt: Added.
* fast/text-autosizing/ios/percent-adjust-percent-line-height.html: Added.
* platform/ios-simulator/fast/text-autosizing/ios/anonymous-block-expected.txt: Added.
* platform/ios-simulator/fast/text-autosizing/ios/contenteditable-expected.txt: Added.
* platform/ios-simulator/fast/text-autosizing/ios/first-letter-expected.txt: Added.
* platform/ios-simulator/fast/text-autosizing/ios/lists-expected.txt: Added.
* platform/ios-simulator/fast/text-autosizing/ios/overflow-expected.txt: Added.
* platform/mac/fast/text-autosizing/ios/anonymous-block-expected.txt: Added.
* platform/mac/fast/text-autosizing/ios/contenteditable-expected.txt: Added.
* platform/mac/fast/text-autosizing/ios/first-letter-expected.txt: Added.
* platform/mac/fast/text-autosizing/ios/lists-expected.txt: Added.
* platform/mac/fast/text-autosizing/ios/overflow-expected.txt: Added.

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

4 years ago[iOS WK2] Font size increases on some pages after navigating then going back
simon.fraser@apple.com [Mon, 9 May 2016 20:22:47 +0000 (20:22 +0000)]
[iOS WK2] Font size increases on some pages after navigating then going back
https://bugs.webkit.org/show_bug.cgi?id=157441
rdar://problem/22873240

Reviewed by Darin Adler.

Source/WebCore:

Sometimes I want to dump ViewportConfigurations from WebKit2 so export dump().

Test: fast/text-autosizing/ios/text-autosizing-after-back.html

* page/ViewportConfiguration.h:

Source/WebKit2:

There's an ordering dependency between setting the viewport configuration and doing
layouts when going back to a page from the page cache that is incorrectly handled.

In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under
updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates
the viewport arguments via ViewportConfiguration::setViewportArguments().

This issue is not addressed by the current commit. But a second problem is:
if the inputs to text autosizing change, we need to invalidate the autosizing state.
The relevant input here is the fixed layout width (which is determined from the viewport
configuration).

The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize()
changed, but the correct behavior is to invalidate based on fixed layout size changing.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::setFixedLayoutSize):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetTextAutosizing):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
(WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted.

LayoutTests:

* fast/text-autosizing/ios/text-autosizing-after-back-expected.html: Added.
* fast/text-autosizing/ios/text-autosizing-after-back.html: Added.

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