WebKit-https.git
2 years ago[CSS Parser] Support the -webkit-letterpress value for text-decoration
hyatt@apple.com [Fri, 2 Dec 2016 18:31:54 +0000 (18:31 +0000)]
[CSS Parser] Support the -webkit-letterpress value for text-decoration
https://bugs.webkit.org/show_bug.cgi?id=165313

Reviewed by Dean Jackson.

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

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

2 years agoMarking media/modern-media-controls/pip-support/pip-support-click.html as flaky on...
ryanhaddad@apple.com [Fri, 2 Dec 2016 18:21:47 +0000 (18:21 +0000)]
Marking media/modern-media-controls/pip-support/pip-support-click.html as flaky on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=165311

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[CSS Parser] Fix invalid gradients test
hyatt@apple.com [Fri, 2 Dec 2016 18:05:33 +0000 (18:05 +0000)]
[CSS Parser] Fix invalid gradients test
https://bugs.webkit.org/show_bug.cgi?id=165310

Reviewed by Zalan Bujtas.

* fast/gradients/generated-gradients.html:
The content property here is using invalid syntax. It's supposed to be
space-separated, not comma-separated. The old parser was finding the first
value and then bailing when it saw the comma, but not rejecting. The new parser
properly rejected. To keep the test working, just drop all the extra invalid
gradients and keep the first one.

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

2 years agoWebAssembly: revert patch causing odd breakage
jfbastien@apple.com [Fri, 2 Dec 2016 17:55:32 +0000 (17:55 +0000)]
WebAssembly: revert patch causing odd breakage
https://bugs.webkit.org/show_bug.cgi?id=165308

Unreviewed.

Bug #164724 seems to cause build issues which I haven't tracked down yet. WasmOps.h can't be found:
./Source/JavaScriptCore/wasm/WasmFormat.h:34:10: fatal error: 'WasmOps.h' file not found

It's weird since the file is auto-generated and has been for a while. #164724 merely includes it in WasmFormat.h.

JSTests:

* wasm/Builder.js:
(const._normalizeFunctionSignature):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Type):
(const.emitters.Code):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.inline_signature_type):
(export.default.LowLevelBinary.prototype.block_type): Deleted.
* wasm/WASM.js:
* wasm/js-api/test_basic_api.js:
* wasm/self-test/test_BuilderWebAssembly.js:
(EmptyModule):
(CustomSection):
* wasm/self-test/test_WASM.js:
* wasm/wasm.json:

Source/JavaScriptCore:

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::zeroForType):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::createJSWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::marshallArgument):
* wasm/WasmFormat.cpp:
(JSC::Wasm::toString):
* wasm/WasmFormat.h:
(JSC::Wasm::toB3Type):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
(JSC::Wasm::ModuleParser::parseType):
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseResultType):
* wasm/generateWasm.py:
(Wasm.__init__):
* wasm/generateWasmOpsHeader.py:
(cppMacro):
(opcodeMacroizer):
(typeMacroizer): Deleted.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/wasm.json:

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

2 years ago[CSS Parser] Fix the color-gamut media query evaluator
hyatt@apple.com [Fri, 2 Dec 2016 17:27:08 +0000 (17:27 +0000)]
[CSS Parser] Fix the color-gamut media query evaluator
https://bugs.webkit.org/show_bug.cgi?id=165309

Reviewed by Zalan Bujtas).

* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
Unknown values should result in a failed match, not a successful match.

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

2 years agoRemove use of WebCore::Dictionary in MediaSession
darin@apple.com [Fri, 2 Dec 2016 17:16:17 +0000 (17:16 +0000)]
Remove use of WebCore::Dictionary in MediaSession
https://bugs.webkit.org/show_bug.cgi?id=165296

Reviewed by Chris Dumez.

I am not exactly sure of the status of this code. When I enabled it to test my
changes it did not compile until I fixed some things, and it's far out of date
of the latest draft of the Media Session Standard. But despite that I updated it.

* DerivedSources.make: Removed a line that was breaking the build for some
configurations, perhaps only for programmers from Apple, after r209198.

* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::MediaSession): Fixed so it compiles.
(WebCore::MediaSession::setMetadata): Changed argument to use a struct rather
htan a WebCore::Dictionary.
* Modules/mediasession/MediaSession.h: Added a Metadata struct, and used it.
Also fixed the arguments to the constructor.
* Modules/mediasession/MediaSession.idl: Added MediaMetadata and used it instead
of Dictionary.

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

2 years ago[CSS Parser] Make sure margin and font set the implicit flag properly
hyatt@apple.com [Fri, 2 Dec 2016 16:44:23 +0000 (16:44 +0000)]
[CSS Parser] Make sure margin and font set the implicit flag properly
https://bugs.webkit.org/show_bug.cgi?id=165306

Reviewed by Zalan Bujtas.

Source/WebCore:

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::consume4Values):

LayoutTests:

* TestExpectations:

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

2 years ago[CSS Parser] Make sure the templatized consumeIdent uses CSSValuePool
hyatt@apple.com [Fri, 2 Dec 2016 16:32:10 +0000 (16:32 +0000)]
[CSS Parser] Make sure the templatized consumeIdent uses CSSValuePool
https://bugs.webkit.org/show_bug.cgi?id=165302

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParserHelpers.h:
(WebCore::CSSPropertyParserHelpers::consumeIdent):

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

2 years ago[CSS Parser] Fix font-variant parsing
hyatt@apple.com [Fri, 2 Dec 2016 16:31:14 +0000 (16:31 +0000)]
[CSS Parser] Fix font-variant parsing
https://bugs.webkit.org/show_bug.cgi?id=165301

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariantEastAsian):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
Fix a bug with font-variant-east-asian parsing where the id
was getting improperly consumed even when it didn't match.

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

2 years ago[CSS Parser] Fix animation property parsing
hyatt@apple.com [Fri, 2 Dec 2016 16:29:00 +0000 (16:29 +0000)]
[CSS Parser] Fix animation property parsing
https://bugs.webkit.org/show_bug.cgi?id=165305

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationPropertyList):
Match the old parser by only creating a list for animation properties if there
are two or more comma-separated values. Otherwise just return the CSSValue for
the singleton without creating a list.

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

2 years agoFix build break when disabling some features.
commit-queue@webkit.org [Fri, 2 Dec 2016 16:21:35 +0000 (16:21 +0000)]
Fix build break when disabling some features.
https://bugs.webkit.org/show_bug.cgi?id=165254

Source/WebCore:

Patch by Gustavo Sverzut Barbieri <barbieri@profusion.mobi> on 2016-12-02
Reviewed by Michael Catanzaro.

If we disable SVG_FONTS or XSLT, then
WebCore::CachedResource::isCORSSameOrigin() would have assertions
on non-existent members. These should be isolated within "#if" as
the other places.

If we're in DEVELOPER_MODE but did not provide
TEST_HYPHENATAION_PATH, then we must mark UNUSED_PARAM() if we're
not on GTK port (ie: EFL).

No new tests as this is a build fix.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin):
 - missing #if ENABLED(SVG_FONTS)
 - missing #if ENABLED(XSLT)
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanTestDictionariesDirectoryIfNecessary):
 - missing UNUSED_PARAM()

Source/WebKit2:

The EFL port was broken if SPELLCHECK was disabled or
PLUGIN_ARCHITECTURE is not x11.

Patch by Gustavo Sverzut Barbieri <barbieri@profusion.mobi> on 2016-12-02
Reviewed by Michael Catanzaro.

* UIProcess/efl/TextCheckerEfl.cpp:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::checkSpellingOfString):
Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
* UIProcess/efl/WebPageProxyEfl.cpp:
Isolate methods within #if PLUGIN_ARCHITECTURE(X11).

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

2 years ago[GTK] Use an OpenGL < 3.0 compliant way to request the OpenGL version
magomez@igalia.com [Fri, 2 Dec 2016 13:22:51 +0000 (13:22 +0000)]
[GTK] Use an OpenGL < 3.0 compliant way to request the OpenGL version
https://bugs.webkit.org/show_bug.cgi?id=165253

Reviewed by Carlos Garcia Campos.

Use glGetString(GL_VERSION) to get the OpenGL version, as glGetIntegerv with GL_MAJOR_VERSION
and GL_MINOR_VERSION is only supported from 3.0 on.

Covered by existent tests.

* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):

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

2 years agoFix WinCairo build after r208997
commit-queue@webkit.org [Fri, 2 Dec 2016 08:24:08 +0000 (08:24 +0000)]
Fix WinCairo build after r208997
https://bugs.webkit.org/show_bug.cgi?id=165283

Patch by Alex Christensen <achristensen@webkit.org> on 2016-12-02
Reviewed by Carlos Garcia Campos.

* platform/graphics/GLContext.cpp:
glGetIntegerv is defined in gl2.h.
GL_MAJOR_VERSION is defined in gl3.h.
These are not included in the WinCairo build.

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

2 years agoRemote Inspector: fix weird typo in generated ObjC protocol type initializer implemen...
bburg@apple.com [Fri, 2 Dec 2016 06:08:30 +0000 (06:08 +0000)]
Remote Inspector: fix weird typo in generated ObjC protocol type initializer implementations
https://bugs.webkit.org/show_bug.cgi?id=165295
<rdar://problem/29427778>

Reviewed by Joseph Pecoraro.

Remove a stray semicolon appended after custom initializer signatures.
This is a syntax error when building with less lenient compiler warnings.

* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_required_members):
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

2 years agoStop using WebCore::Dictionary in bindings for Fetch
darin@apple.com [Fri, 2 Dec 2016 05:31:07 +0000 (05:31 +0000)]
Stop using WebCore::Dictionary in bindings for Fetch
https://bugs.webkit.org/show_bug.cgi?id=165241

Reviewed by Chris Dumez.

* Modules/fetch/DOMWindowFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy): Deleted. Bindings handle this now.
(WebCore::setMode): Ditto.
(WebCore::setCredentials): Ditto.
(WebCore::setCache): Ditto.
(WebCore::setRedirect): Ditto.
(WebCore::setReferrer): Changed argument from Dictionary to String.
(WebCore::buildOptions): Changed argument from Dictionary to FetchRequest::Init,
and simplified the code accordingly.
(WebCore::FetchRequest::initializeOptions): Ditto.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above changes. Also added the Init struct.

* Modules/fetch/FetchRequest.idl: Added missing "only-if-cached" value to RequestCache.
Added RequestInit dictionary and used it instead of Dictionary. Used more-specific string
types for the method and referrer attributes; no effect at runtime, since the code for
getters is the same for ByteString, USVString, and DOMString and these are read-only.

* Modules/fetch/WorkerGlobalScopeFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.

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

2 years agoAdd a runtime flag for SubtleCrypto
jiewen_tan@apple.com [Fri, 2 Dec 2016 03:30:37 +0000 (03:30 +0000)]
Add a runtime flag for SubtleCrypto
https://bugs.webkit.org/show_bug.cgi?id=164982

Reviewed by Brent Fulgham.

Source/WebCore:

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled):
(WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled):
* page/Crypto.idl:

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences subtleCryptoEnabled]):
(-[WebPreferences setSubtleCryptoEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSubtleCryptoEnabled):
(WKPreferencesGetSubtleCryptoEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setSubtleCryptoEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

2 years agoRename CallFrame::callee() to CallFrame::jsCallee()
sbarati@apple.com [Fri, 2 Dec 2016 02:38:23 +0000 (02:38 +0000)]
Rename CallFrame::callee() to CallFrame::jsCallee()
https://bugs.webkit.org/show_bug.cgi?id=165293

Reviewed by Keith Miller.

Source/JavaScriptCore:

Wasm will soon have its own Callee that doesn't derive
from JSObject, but derives from JSCell. I want to introduce
a new function like:
```
CalleeBase* CallFrame::callee()
```

once we have a Wasm callee. It only makes sense to name that
function callee() and rename the current one turn to:
```
JSObject* CallFrame::jsCallee()
```

* API/APICallbackFunction.h:
(JSC::APICallbackFunction::call):
(JSC::APICallbackFunction::construct):
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::construct):
(JSC::JSCallbackObject<Parent>::call):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::type):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::friendlyFunctionName):
* interpreter/CallFrame.h:
(JSC::ExecState::jsCallee):
(JSC::ExecState::callee): Deleted.
* interpreter/Interpreter.cpp:
(JSC::Interpreter::dumpRegisters):
(JSC::notifyDebuggerOfUnwinding):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::update):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::readNonInlinedFrame):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::traceFunctionPrologue):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):
* runtime/AsyncFunctionConstructor.cpp:
(JSC::callAsyncFunctionConstructor):
(JSC::constructAsyncFunctionConstructor):
* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createWithInlineFrame):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::arityCheckFor):
* runtime/DateConstructor.cpp:
(JSC::constructWithDateConstructor):
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::createByCopying):
* runtime/Error.h:
(JSC::StrictModeTypeErrorFunction::constructThrowTypeError):
(JSC::StrictModeTypeErrorFunction::callThrowTypeError):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::constructWithFunctionConstructor):
(JSC::callFunctionConstructor):
* runtime/GeneratorFunctionConstructor.cpp:
(JSC::callGeneratorFunctionConstructor):
(JSC::constructGeneratorFunctionConstructor):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
* runtime/IntlCollatorConstructor.cpp:
(JSC::constructIntlCollator):
(JSC::callIntlCollator):
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::constructIntlDateTimeFormat):
(JSC::callIntlDateTimeFormat):
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::constructIntlNumberFormat):
(JSC::callIntlNumberFormat):
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList):
(JSC::defaultLocale):
(JSC::lookupSupportedLocales):
(JSC::intlObjectFuncGetCanonicalLocales):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSBoundFunction.cpp:
(JSC::boundThisNoArgsFunctionCall):
(JSC::boundFunctionCall):
(JSC::boundThisNoArgsFunctionConstruct):
(JSC::boundFunctionConstruct):
* runtime/JSCellInlines.h:
(JSC::ExecState::vm):
* runtime/JSCustomGetterSetterFunction.cpp:
(JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall):
* runtime/JSFunction.cpp:
(JSC::callHostFunctionAsConstructor):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* runtime/JSInternalPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::createPair):
(JSC::JSMapIterator::clone):
* runtime/JSNativeStdFunction.cpp:
(JSC::runStdFunction):
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::clone):
* runtime/JSScope.h:
(JSC::ExecState::lexicalGlobalObject):
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::createPair):
(JSC::JSSetIterator::clone):
* runtime/JSStringIterator.cpp:
(JSC::JSStringIterator::clone):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/MapPrototype.cpp:
(JSC::mapProtoFuncValues):
(JSC::mapProtoFuncEntries):
(JSC::mapProtoFuncKeys):
(JSC::privateFuncMapIterator):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
(JSC::Interpreter::callNativeErrorConstructor):
* runtime/ObjectConstructor.cpp:
(JSC::constructObject):
* runtime/ProxyObject.cpp:
(JSC::performProxyCall):
(JSC::performProxyConstruct):
* runtime/ProxyRevoke.cpp:
(JSC::performProxyRevoke):
* runtime/RegExpConstructor.cpp:
(JSC::constructWithRegExpConstructor):
(JSC::callRegExpConstructor):
* runtime/ScopedArguments.cpp:
(JSC::ScopedArguments::createByCopying):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/SetPrototype.cpp:
(JSC::setProtoFuncValues):
(JSC::setProtoFuncEntries):
(JSC::privateFuncSetIterator):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncIterator):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):

Source/WebCore:

* bindings/js/JSDOMConstructor.h:
(WebCore::JSBuiltinConstructor<JSClass>::construct):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::construct):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::construct):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors3):
(WebCore::constructJSTestOverloadedConstructors4):
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
(WebCore::constructJSTestOverloadedConstructorsWithSequence2):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeObject):
(JSC::Bindings::callRuntimeConstructor):

Source/WebKit2:

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::callMethod):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::callNPJSObject):
(WebKit::constructWithConstructor):

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

2 years ago[Modern Media Controls] Fade controls in when entering and exiting fullscreen
graouts@webkit.org [Fri, 2 Dec 2016 02:11:05 +0000 (02:11 +0000)]
[Modern Media Controls] Fade controls in when entering and exiting fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165287

Reviewed by Dean Jackson.

Fade controls in when we enter and leave fullscreen.

Test: media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls.fade-in):
(@keyframes fade-in):
(to):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.presentInElement):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.buttonWasClicked):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):

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

2 years ago[Modern Media Controls] Show and populate the tracks panel
graouts@webkit.org [Fri, 2 Dec 2016 02:07:35 +0000 (02:07 +0000)]
[Modern Media Controls] Show and populate the tracks panel
https://bugs.webkit.org/show_bug.cgi?id=165284

Reviewed by Dean Jackson.

We added a TracksPanel in https://bugs.webkit.org/show_bug.cgi?id=165239 which allows to
show a list of media tracks and text tracks to choose from. We now show this panel when
clicking on the tracks button in the controls bar and populate its content with the
list of audio and text tracks for the media element. As an item is picked from the tracks
panel, we toggle the represented track's enabled state and dismiss the panel.

We also pick up the text track container display mostly unchanged from current media controls.

Tests: media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html
       media/modern-media-controls/tracks-support/tracks-support-show-and-populate-panel.html

* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/controls/text-tracks.css: Added.
(video::-webkit-media-text-track-container):
(video::cue):
(video::-webkit-media-text-track-display):
(video::-webkit-media-text-track-display-backdrop):
(video::cue(:future)):
(video::-webkit-media-text-track-container b):
(video::-webkit-media-text-track-container u):
(video::-webkit-media-text-track-container i):
(video::-webkit-media-text-track-container .hidden):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport):
(TracksSupport.prototype.destroy):
(TracksSupport.prototype.buttonWasClicked):
(TracksSupport.prototype.tracksPanelNumberOfSections):
(TracksSupport.prototype.tracksPanelTitleForSection):
(TracksSupport.prototype.tracksPanelNumberOfTracksInSection):
(TracksSupport.prototype.tracksPanelTitleForTrackInSection):
(TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
(TracksSupport.prototype.tracksPanelSelectionDidChange):
(TracksSupport.prototype.syncControl):
(TracksSupport.prototype._textTracks):
(TracksSupport.prototype._audioTracks):
(TracksSupport.prototype._canPickAudioTracks):
(TracksSupport.prototype._canPickTextTracks):
(TracksSupport.prototype._sortedTrackList):

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

2 years agoRare crash when preparing to print
bfulgham@apple.com [Fri, 2 Dec 2016 01:30:46 +0000 (01:30 +0000)]
Rare crash when preparing to print
https://bugs.webkit.org/show_bug.cgi?id=165280
<rdar://problem/28240254>

Reviewed by Dean Jackson.

* page/Frame.cpp:
(WebCore::Frame::setPrinting): Only manipulate the FrameView if it is non-null.
(WebCore::Frame::documentAtPoint): Drive-by fix to change a 0 return to nullptr.

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

2 years agoRemoving Release-only flag from flaky test http/tests/cache/disk-cache/disk-cache...
ryanhaddad@apple.com [Fri, 2 Dec 2016 01:24:30 +0000 (01:24 +0000)]
Removing Release-only flag from flaky test http/tests/cache/disk-cache/disk-cache-request-max-stale.html
https://bugs.webkit.org/show_bug.cgi?id=159840

Unreviewed test gardening..

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoPut an obvious debug border on layers with backdrop filters
simon.fraser@apple.com [Fri, 2 Dec 2016 01:21:46 +0000 (01:21 +0000)]
Put an obvious debug border on layers with backdrop filters
https://bugs.webkit.org/show_bug.cgi?id=165291

Reviewed by Tim Horton.

Put a wide magenta border on layers with backdrop filters, to highlight their performance impact.

Change the "contents layer" color (used by WebGL, video etc) to blue.

Make the clipping layer border slightly narrower.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::getDebugBorderInfo):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setBackdropFilters):

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

2 years agoMarking media/modern-media-controls/tracks-panel/tracks-panel-hide-click-outside...
ryanhaddad@apple.com [Fri, 2 Dec 2016 01:01:33 +0000 (01:01 +0000)]
Marking media/modern-media-controls/tracks-panel/tracks-panel-hide-click-outside.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=165290

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoWeb Inspector: generated code should use a framework-style import for *ProtocolArrayC...
bburg@apple.com [Fri, 2 Dec 2016 00:52:22 +0000 (00:52 +0000)]
Web Inspector: generated code should use a framework-style import for *ProtocolArrayConversions.h
https://bugs.webkit.org/show_bug.cgi?id=165281
<rdar://problem/29427778>

Reviewed by Joseph Pecoraro.

* inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py:
(ObjCProtocolTypeConversionsHeaderGenerator.generate_output):
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

2 years agoFix the Windows Release build after r209198
bburg@apple.com [Fri, 2 Dec 2016 00:47:45 +0000 (00:47 +0000)]
Fix the Windows Release build after r209198
https://bugs.webkit.org/show_bug.cgi?id=165285

Unreviewed build fix.

* Modules/webdriver/NavigatorWebDriver.cpp:
Brute force include all the inlines to work around a JSC issue.

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

2 years agoSourceCodeKey should use unlinked source code
ggaren@apple.com [Fri, 2 Dec 2016 00:24:17 +0000 (00:24 +0000)]
SourceCodeKey should use unlinked source code
https://bugs.webkit.org/show_bug.cgi?id=165286

Reviewed by Saam Barati.

This patch splits out UnlinkedSourceCode from SourceCode, and deploys
UnlinkedSourceCode in SourceCodeKey.

It's misleading to store SourceCode in SourceCodeKey because SourceCode
has an absolute location whereas unlinked cached code has no location.

I plan to deploy UnlinkedSourceCode in more places, to indicate code
that has no absolute location.

* JavaScriptCore.xcodeproj/project.pbxproj:
* parser/SourceCode.cpp:
(JSC::UnlinkedSourceCode::toUTF8):
(JSC::SourceCode::toUTF8): Deleted.
* parser/SourceCode.h:
(JSC::SourceCode::SourceCode):
(JSC::SourceCode::startColumn):
(JSC::SourceCode::isHashTableDeletedValue): Deleted.
(JSC::SourceCode::hash): Deleted.
(JSC::SourceCode::view): Deleted.
(JSC::SourceCode::providerID): Deleted.
(JSC::SourceCode::isNull): Deleted.
(JSC::SourceCode::provider): Deleted.
(JSC::SourceCode::startOffset): Deleted.
(JSC::SourceCode::endOffset): Deleted.
(JSC::SourceCode::length): Deleted. Move a bunch of stuff in to a new
base class, UnlinkedSourceCode.

* parser/SourceCodeKey.h:
(JSC::SourceCodeKey::SourceCodeKey): Use UnlinkedSourceCode since code
in the cache has no location.

* parser/UnlinkedSourceCode.h: Copied from Source/JavaScriptCore/parser/SourceCode.h.
(JSC::UnlinkedSourceCode::UnlinkedSourceCode):
(JSC::UnlinkedSourceCode::provider):
(JSC::SourceCode::SourceCode): Deleted.
(JSC::SourceCode::isHashTableDeletedValue): Deleted.
(JSC::SourceCode::hash): Deleted.
(JSC::SourceCode::view): Deleted.
(JSC::SourceCode::providerID): Deleted.
(JSC::SourceCode::isNull): Deleted.
(JSC::SourceCode::provider): Deleted.
(JSC::SourceCode::firstLine): Deleted.
(JSC::SourceCode::startColumn): Deleted.
(JSC::SourceCode::startOffset): Deleted.
(JSC::SourceCode::endOffset): Deleted.
(JSC::SourceCode::length): Deleted.
(JSC::makeSource): Deleted.
(JSC::SourceCode::subExpression): Deleted.

* runtime/CodeCache.h: Use UnlinkedSourceCode in the cache.

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

2 years agoSkip flaky test ChakraCore/test/fieldopts/objtypespec-newobj-invalidation.1.js
ryanhaddad@apple.com [Fri, 2 Dec 2016 00:04:13 +0000 (00:04 +0000)]
Skip flaky test ChakraCore/test/fieldopts/objtypespec-newobj-invalidation.1.js
https://bugs.webkit.org/show_bug.cgi?id=162567

Reviewed by Saam Barati.

* ChakraCore.yaml:

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

2 years ago[CSS Parser] Only allow a single font-family in @font-face
hyatt@apple.com [Thu, 1 Dec 2016 22:54:52 +0000 (22:54 +0000)]
[CSS Parser] Only allow a single font-family in @font-face
https://bugs.webkit.org/show_bug.cgi?id=165278

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamilyDescriptor):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):

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

2 years agoRemove webkitpy dependency on Eliza
ap@apple.com [Thu, 1 Dec 2016 22:53:36 +0000 (22:53 +0000)]
Remove webkitpy dependency on Eliza
https://bugs.webkit.org/show_bug.cgi?id=164979

Reviewed by Daniel Bates.

This module is not on pypi, so installing it is a challenge. The jokes feel pretty old too!

* Scripts/webkitpy/thirdparty/__init__.py:
* Scripts/webkitpy/thirdparty/__init___unittest.py: Changed mock import hook to
test buildbot instead of eliza.
* Scripts/webkitpy/tool/bot/ircbot.py:
* Scripts/webkitpy/tool/bot/ircbot_unittest.py:

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

2 years agoSource/WebKit2:
cdumez@apple.com [Thu, 1 Dec 2016 22:48:55 +0000 (22:48 +0000)]
Source/WebKit2:
[iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
https://bugs.webkit.org/show_bug.cgi?id=165270
<rdar://problem/29224355>

Reviewed by Simon Fraser.

Tapping an element generates a 'click' event that has 0 as timeStamp
instead of having a proper timeStamp value. This is breaking some
sites.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completeSyntheticClick):

LayoutTests:
[iOS] Tapping an element generates a 'click' event that has 0 as timeStamp
https://bugs.webkit.org/show_bug.cgi?id=165270
<rdar://problem/29224355>

Reviewed by Simon Fraser.

Add layout test coverage.

* fast/events/ios/click-event-timestamp-expected.txt: Added.
* fast/events/ios/click-event-timestamp.html: Added.

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

2 years agoTry to fix the EFL/Gtk build
timothy_horton@apple.com [Thu, 1 Dec 2016 22:36:22 +0000 (22:36 +0000)]
Try to fix the EFL/Gtk build

* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):

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

2 years agoWeb Inspector: Show async stack traces for workers
mattbaker@apple.com [Thu, 1 Dec 2016 22:32:33 +0000 (22:32 +0000)]
Web Inspector: Show async stack traces for workers
https://bugs.webkit.org/show_bug.cgi?id=165235
<rdar://problem/29450172>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline > .children > .item.call-frame.async-boundary):
(.tree-outline:not(.single-thread) > .children > .item.call-frame.async-boundary):
(.tree-outline .item.call-frame.async-boundary::before):
(.tree-outline.single-thread .item.call-frame.async-boundary::before):
(.tree-outline .item.call-frame.async-boundary): Deleted.
Style changes for single/multiple-thread call stacks.
Padding changes to account for Thread tree element.
Make selectors more specific where needed.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .tree-outline.single-thread > .item.thread):
(.sidebar > .panel.navigation.debugger .tree-outline.single-thread):
Style changes for single/multiple-thread call stacks.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
Use a single tree outline for showing a single thread or multiple threads.
For single-threaded, hide Thread tree element and un-indent children.

(WebInspector.DebuggerSidebarPanel.prototype._targetAdded):
(WebInspector.DebuggerSidebarPanel.prototype._targetRemoved):
(WebInspector.DebuggerSidebarPanel.prototype._updateCallStackTreeOutline):
Update tree style and whether Thread tree element is selectable.
(WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
Remove support for second tree outline.

(WebInspector.DebuggerSidebarPanel.prototype._updateSingleThreadCallStacks): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._selectActiveCallFrameTreeElement): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._showSingleThreadCallStacks): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._showMultipleThreadCallStacks): Deleted.
No longer needed after unifying tree outlines.

* UserInterface/Views/ThreadTreeElement.js:
(WebInspector.ThreadTreeElement.prototype.refresh):
Append call frames from the async stack trace.

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

2 years agoEvery WKWebView initialization spends a few milliseconds hitting the disk
timothy_horton@apple.com [Thu, 1 Dec 2016 22:31:01 +0000 (22:31 +0000)]
Every WKWebView initialization spends a few milliseconds hitting the disk
https://bugs.webkit.org/show_bug.cgi?id=165268
<rdar://problem/29010113>

Reviewed by Brady Eidson.

Every WKWebView init currently involves doing directory creation and
symlink resolution for a number of paths (to create sandbox extensions
for all of our storage directories), which means touching the disk a
lot during init. All of these paths are immutable per-WebProcessPool,
so, instead, cache them on WebProcessPool and create sandbox extensions
from the already-resolved paths. This is a sizable (~4x) speedup when
initializing subsequent web views.

* Shared/SandboxExtension.h:
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
Add createHandleWithoutResolvingPath, which makes a sandbox extension
handle without doing symlink resolution.

(WebKit::resolvePathForSandboxExtension):
(WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
Add two functions that do the same resolution that SandboxExtension::createHandle
and ::createHandleForReadWriteDirectory do, but just return the paths,
for later use with createHandleWithoutResolvingPath.

* Shared/mac/SandboxExtensionMac.mm:
(WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
(WebKit::resolvePathForSandboxExtension):
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
(WebKit::SandboxExtension::createHandle):
(WebKit::SandboxExtension::createHandleForReadWriteDirectory):
Implement the aforementioned functions, and reimplement the existing
createHandle{ForReadWriteDirectory} functions in terms of them.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath):
Stop wasting time generating and resolving a platform default icon
database path, since we don't actually use it for anything anymore except
to determine whether the icon database is enabled, and we only want to
enable it if the client has provided a path.

(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::createNewWebProcess):
* UIProcess/WebProcessPool.h:
Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
paths along with createHandleWithoutResolvingPath in order to effectively
cache the resolution operation.

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

2 years agoBlacklist Netflix for TouchBar support
bdakin@apple.com [Thu, 1 Dec 2016 22:14:09 +0000 (22:14 +0000)]
Blacklist Netflix for TouchBar support
https://bugs.webkit.org/show_bug.cgi?id=165104

Rubber-stamped by Tim Horton.

Meant to not have the www. in the first case because that is covered by the second
case.

* html/HTMLMediaElement.cpp:
(WebCore::needsPlaybackControlsManagerQuirk):

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

2 years ago[CSS Parser] Support -webkit-overflow-scrolling: touch
hyatt@apple.com [Thu, 1 Dec 2016 22:07:10 +0000 (22:07 +0000)]
[CSS Parser] Support -webkit-overflow-scrolling: touch
https://bugs.webkit.org/show_bug.cgi?id=165275

Reviewed by Zalan Bujtas.

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

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

2 years agoAdd wasm int to floating point opcodes
keith_miller@apple.com [Thu, 1 Dec 2016 22:00:23 +0000 (22:00 +0000)]
Add wasm int to floating point opcodes
https://bugs.webkit.org/show_bug.cgi?id=165252

Reviewed by Geoffrey Garen.

JSTests:

Add tests for Wasm integral to floating point conversion opcodes.

* wasm/function-tests/int-to-floating-point.js: Added.
* wasm/wasm.json:

Source/JavaScriptCore:

This patch adds support for the Wasm integral type => floating point
type conversion opcodes. Most of these were already supported by B3
however there was no support for uint64 to float/double. Unfortunately,
AFAIK x86_64 does not have a single instruction that performs this
conversion. Since there is a signed conversion instruction on x86 we
use that for all uint64s that don't have the top bit set. If they do have
the top bit set we need to divide by 2 (rounding up) then convert the number
with the signed conversion then double the result.

* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::convertUInt64ToDouble):
(JSC::MacroAssemblerX86_64::convertUInt64ToFloat):
* jsc.cpp:
(valueWithTypeOfWasmValue):
(box):
(functionTestWasmModuleFunctions):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addOp<F64ConvertUI64>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::F32ConvertUI64>):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/wasm.json:

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

2 years agoLand a test case for <rdar://problem/27889416>
ggaren@apple.com [Thu, 1 Dec 2016 21:58:30 +0000 (21:58 +0000)]
Land a test case for <rdar://problem/27889416>
https://bugs.webkit.org/show_bug.cgi?id=165272

Reviewed by Saam Barati.

* stress/marked-argument-buffer.js: Added.
(allocate):
(test.o.toString):
(test):

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

2 years ago[CSS Parser] Fix an invalid shadow DOM test
hyatt@apple.com [Thu, 1 Dec 2016 21:57:33 +0000 (21:57 +0000)]
[CSS Parser] Fix an invalid shadow DOM test
https://bugs.webkit.org/show_bug.cgi?id=165273

Reviewed by Zalan Bujtas.

* fast/shadow-dom/css-scoping-slot-with-id.html:
Pseudo-element needs to be rightmost. The rule is illegal, but our old parser
incorrectly allowed it. Fix the test by just flipping the order so that ::slotted(*)
occurs last.

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

2 years agoRenamed EvalCodeCache => DirectEvalCodeCache
ggaren@apple.com [Thu, 1 Dec 2016 21:47:34 +0000 (21:47 +0000)]
Renamed EvalCodeCache => DirectEvalCodeCache
https://bugs.webkit.org/show_bug.cgi?id=165271

Reviewed by Saam Barati.

We only use this cache for DirectEval, not IndirectEval.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::DirectEvalCodeCache::visitAggregate):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::EvalCodeCache::visitAggregate): Deleted.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::directEvalCodeCache):
(JSC::CodeBlock::evalCodeCache): Deleted.
* bytecode/DirectEvalCodeCache.h: Copied from Source/JavaScriptCore/bytecode/EvalCodeCache.h.
(JSC::EvalCodeCache::CacheKey::CacheKey): Deleted.
(JSC::EvalCodeCache::CacheKey::hash): Deleted.
(JSC::EvalCodeCache::CacheKey::isEmptyValue): Deleted.
(JSC::EvalCodeCache::CacheKey::operator==): Deleted.
(JSC::EvalCodeCache::CacheKey::isHashTableDeletedValue): Deleted.
(JSC::EvalCodeCache::CacheKey::Hash::hash): Deleted.
(JSC::EvalCodeCache::CacheKey::Hash::equal): Deleted.
(JSC::EvalCodeCache::tryGet): Deleted.
(JSC::EvalCodeCache::set): Deleted.
(JSC::EvalCodeCache::isEmpty): Deleted.
(JSC::EvalCodeCache::clear): Deleted.
* bytecode/EvalCodeCache.h: Removed.
* interpreter/Interpreter.cpp:
(JSC::eval):
* runtime/DirectEvalExecutable.cpp:
(JSC::DirectEvalExecutable::create):

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

2 years agoUpdate SubtleCrypto::unwrapKey to match the latest spec
jiewen_tan@apple.com [Thu, 1 Dec 2016 21:45:31 +0000 (21:45 +0000)]
Update SubtleCrypto::unwrapKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164747
<rdar://problem/29258198>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::unwrapKey method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-unwrapKey.
2. It implements unwrapKey operations of the following algorithms: AES-KW.

Tests: crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-private.html
       crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public.html
       crypto/subtle/aes-kw-generate-key-wrap-key-unwrap-key.html
       crypto/subtle/aes-kw-import-key-unwrap-raw-key.html
       crypto/subtle/rsa-oaep-import-key-unwrap-jwk-oct-key.html
       crypto/subtle/unwrapKey-malformed-parameters.html
       crypto/workers/subtle/aes-cbc-import-key-unwrap-key.html
       crypto/workers/subtle/aes-kw-import-key-unwrap-key.html
       crypto/workers/subtle/rsa-oaep-import-key-unwrap-key.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
Add some comments.
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
(WebCore::JSSubtleCrypto::unwrapKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::unwrapKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::unwrapKeyAES_KW):
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformDecrypt):

LayoutTests:

* crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-private-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-private.html: Added.
* crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public.html: Added.
* crypto/subtle/aes-kw-generate-key-wrap-key-unwrap-key-expected.txt: Added.
* crypto/subtle/aes-kw-generate-key-wrap-key-unwrap-key.html: Added.
* crypto/subtle/aes-kw-import-key-unwrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-kw-import-key-unwrap-raw-key.html: Added.
* crypto/subtle/rsa-oaep-import-key-unwrap-jwk-oct-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-unwrap-jwk-oct-key.html: Added.
* crypto/subtle/unwrapKey-malformed-parameters-expected.txt: Added.
* crypto/subtle/unwrapKey-malformed-parameters.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-unwrap-key.html: Added.
* crypto/workers/subtle/aes-kw-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-kw-import-key-unwrap-key.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/resources/aes-kw-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-unwrap-key.html: Added.

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

2 years ago[CSS Parser] Fix font-variant parsing
hyatt@apple.com [Thu, 1 Dec 2016 21:41:28 +0000 (21:41 +0000)]
[CSS Parser] Fix font-variant parsing
https://bugs.webkit.org/show_bug.cgi?id=165266

Reviewed by Dean Jackson.

Source/WebCore:

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariantEastAsian):
(WebCore::consumeFontVariantAlternates):
(WebCore::consumeFontVariantPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
(WebCore::consumeFontVariantList): Deleted.

LayoutTests:

* TestExpectations:

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

2 years agoWeb Automation: expose navigator.webdriver if the page is controlled by automation
bburg@apple.com [Thu, 1 Dec 2016 21:39:18 +0000 (21:39 +0000)]
Web Automation: expose navigator.webdriver if the page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=165245
<rdar://problem/29449874>

Reviewed by Joseph Pecoraro.

Move the implementation into OpenSource. It's in Modules/webdriver/.

* CMakeLists.txt:
* DerivedSources.make:
Add new paths and files.

* Modules/webdriver/NavigatorWebDriver.cpp: Added.
(WebCore::NavigatorWebDriver::NavigatorWebDriver):
(WebCore::NavigatorWebDriver::~NavigatorWebDriver):
(WebCore::NavigatorWebDriver::supplementName):
(WebCore::NavigatorWebDriver::isControlledByAutomation):
(WebCore::NavigatorWebDriver::from):
(WebCore::JSNavigator::webdriver):
* Modules/webdriver/NavigatorWebDriver.h: Added.
* Modules/webdriver/NavigatorWebDriver.idl: Added.
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoIndexedDB 2.0: Implement IDBObjectStore.getKey().
beidson@apple.com [Thu, 1 Dec 2016 21:33:17 +0000 (21:33 +0000)]
IndexedDB 2.0: Implement IDBObjectStore.getKey().
https://bugs.webkit.org/show_bug.cgi?id=165256

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/idbobjectstore-getkey-1-private.html
       storage/indexeddb/modern/idbobjectstore-getkey-1.html

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

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

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::didGetRecordOnServer):

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/server/IDBBackingStore.h:

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

* Modules/indexeddb/server/MemoryObjectStore.h:

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

LayoutTests:

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

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

2 years agoRemoved some unnecessary indirection in code generation
ggaren@apple.com [Thu, 1 Dec 2016 21:23:27 +0000 (21:23 +0000)]
Removed some unnecessary indirection in code generation
https://bugs.webkit.org/show_bug.cgi?id=165264

Reviewed by Keith Miller.

There's no need to route through JSGlobalObject when producing code --
it just made the code harder to read.

This patch moves functions from JSGlobalObject to their singleton
call sites.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedEvalCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalEvalCodeBlock): Deleted.
* runtime/CodeCache.h:
* runtime/DirectEvalExecutable.cpp:
(JSC::DirectEvalExecutable::create):
* runtime/IndirectEvalExecutable.cpp:
(JSC::IndirectEvalExecutable::create):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createProgramCodeBlock): Deleted.
(JSC::JSGlobalObject::createLocalEvalCodeBlock): Deleted.
(JSC::JSGlobalObject::createGlobalEvalCodeBlock): Deleted.
(JSC::JSGlobalObject::createModuleProgramCodeBlock): Deleted.
* runtime/JSGlobalObject.h:
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::create):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/ProgramExecutable.h:

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

2 years agoMisc. cleanup in Modules/fetch
commit-queue@webkit.org [Thu, 1 Dec 2016 21:22:07 +0000 (21:22 +0000)]
Misc. cleanup in Modules/fetch
https://bugs.webkit.org/show_bug.cgi?id=165240

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

* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyConsumer.cpp:
* Modules/fetch/FetchBodyOwner.cpp:
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchInternals.js:
(consumeStream):
* Modules/fetch/FetchLoader.cpp:
* Modules/fetch/FetchResponse.h:
Remove unnecessary includes and forward declarations.

* Modules/fetch/DOMWindowFetch.js:
(fetch):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
* Modules/fetch/WorkerGlobalScopeFetch.js:
(fetch):
Improve style.

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

2 years ago[Modern Media Controls] Turn off text selection
graouts@webkit.org [Thu, 1 Dec 2016 21:10:16 +0000 (21:10 +0000)]
[Modern Media Controls] Turn off text selection
https://bugs.webkit.org/show_bug.cgi?id=165261

Reviewed by Dean Jackson.

We turn off text selection and force a non-text cursor for all text in media controls.

Tests: media/modern-media-controls/airplay-placard/airplay-placard-text-section.html
       media/modern-media-controls/pip-placard/pip-placard-text-section.html
       media/modern-media-controls/status-label/status-label-text-selection.html

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):

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

2 years agoParameter to DOMStringList.contains() should be mandatory
cdumez@apple.com [Thu, 1 Dec 2016 20:33:05 +0000 (20:33 +0000)]
Parameter to DOMStringList.contains() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=165257

Reviewed by Alex Christensen.

Source/WebCore:

Parameter to DOMStringList.contains() should be mandatory.
Gecko and Blink have it mandatory but WebKit had it optional and the
string 'undefined" was used by default, which is not helpful.

No new tests, updated existing test.

* dom/DOMStringList.idl:

LayoutTests:

Extend layout test coverage.

* storage/indexeddb/database-basics-expected.txt:
* storage/indexeddb/resources/database-basics.js:
(checkObjectStore):

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

2 years agoForce clicking tests fail on some machines
bdakin@apple.com [Thu, 1 Dec 2016 20:12:38 +0000 (20:12 +0000)]
Force clicking tests fail on some machines
https://bugs.webkit.org/show_bug.cgi?id=165263

Reviewed by Tim Horton.

Initialize com.apple.trackpad.forceClick to 1 so that we don’t have to depend on
the user account having this feature enabled.
* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/mac/main.mm:
(setDefaultsToConsistentValuesForTesting):

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

2 years agoSubtleCrypto::deriveBits always return NOT_SUPPORTED_ERR for now
jiewen_tan@apple.com [Thu, 1 Dec 2016 19:42:30 +0000 (19:42 +0000)]
SubtleCrypto::deriveBits always return NOT_SUPPORTED_ERR for now
https://bugs.webkit.org/show_bug.cgi?id=164745
<rdar://problem/29258118>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Since we don't support any cryptography algorithms that has deriveBits operations,
SubtleCrypto::deriveBits will always return NOT_SUPPORTED_ERR for now.

Test: crypto/subtle/deriveBits-malformed-parameters.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveBitsPromise):
(WebCore::JSSubtleCrypto::deriveBits):
* crypto/SubtleCrypto.idl:

LayoutTests:

* crypto/subtle/deriveBits-malformed-parameters-expected.txt: Added.
* crypto/subtle/deriveBits-malformed-parameters.html: Added.

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

2 years agoMarking media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-keybo...
ryanhaddad@apple.com [Thu, 1 Dec 2016 19:33:47 +0000 (19:33 +0000)]
Marking media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-keyboard.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=165262

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoRevert r208931
antti@apple.com [Thu, 1 Dec 2016 19:31:06 +0000 (19:31 +0000)]
Revert r208931
https://bugs.webkit.org/show_bug.cgi?id=164924

PLT regression.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):
(WebKit::NetworkCache::makeSalt): Deleted.
(WebKit::NetworkCache::readOrMakeSalt): Deleted.
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::noPartitionString):
(WebKit::NetworkCache::Key::Key):
(WebKit::NetworkCache::Key::hasPartition):
(WebKit::NetworkCache::Key::computeHash):
(WebKit::NetworkCache::Key::hashAsString):
(WebKit::NetworkCache::Key::computePartitionHash): Deleted.
* NetworkProcess/cache/NetworkCacheKey.h:
(WebKit::NetworkCache::Key::hash):
(WebKit::NetworkCache::Key::partitionHash): Deleted.
(WebKit::NetworkCache::Key::hashAsString): Deleted.
(WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::makeSaltFilePath): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt): Deleted.

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

2 years ago[MediaStream][Mac] Video presets sometimes don't work
eric.carlson@apple.com [Thu, 1 Dec 2016 19:27:25 +0000 (19:27 +0000)]
[MediaStream][Mac] Video presets sometimes don't work
https://bugs.webkit.org/show_bug.cgi?id=165214
<rdar://problem/29444533>

Reviewed by Jer Noble.

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setPreset): Set videoSettings width and height.
(WebCore::AVVideoCaptureSource::setupCaptureSession): Store videoSettings object for later use.
  Set videoSettings width and height.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::sizeForPreset): New.

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

2 years ago[Modern Media Controls] Promote the "on" property from AirPlayButton to IconButton
graouts@webkit.org [Thu, 1 Dec 2016 18:41:08 +0000 (18:41 +0000)]
[Modern Media Controls] Promote the "on" property from AirPlayButton to IconButton
https://bugs.webkit.org/show_bug.cgi?id=165260

Reviewed by NOBODY (OOPS!).

With the fix for https://bugs.webkit.org/show_bug.cgi?id=165239 we now set the "on"
property for the TracksButton as well, so it makes sense to provide that property
for all IconButton subclasses, not just AirplayButton.

Test: media/modern-media-controls/icon-button/icon-button-on.html

* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on):
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton):
(AirplayButton.prototype.get on): Deleted.
(AirplayButton.prototype.set on): Deleted.
* Modules/modern-media-controls/controls/icon-button.css:
(button.icon:active,):
(button.icon:active): Deleted.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.get on):
(IconButton.prototype.set on):

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

2 years ago[Modern Media Controls] Fix media/modern-media-controls/status-label/status-label...
graouts@webkit.org [Thu, 1 Dec 2016 18:38:51 +0000 (18:38 +0000)]
[Modern Media Controls] Fix media/modern-media-controls/status-label/status-label.html
https://bugs.webkit.org/show_bug.cgi?id=165259

Reviewed by Dean Jackson.

We broke the test at media/modern-media-controls/status-label/status-label.html with the
fix for https://bugs.webkit.org/show_bug.cgi?id=165239 since the test would test the
font-family for a StatusLabel which would only inherited to be -apple-system when hosted
in a MediaControls instance. We now remove this assertion and added a dedicated test
for when a StatusLabel is hosted in a MediaControls.

* media/modern-media-controls/status-label/status-label-expected.txt:
* media/modern-media-controls/status-label/status-label-font-expected.txt: Added.
* media/modern-media-controls/status-label/status-label-font.html: Added.
* media/modern-media-controls/status-label/status-label.html:

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

2 years agoMarking media/modern-media-controls/media-controller/media-controller-fullscreen...
ryanhaddad@apple.com [Thu, 1 Dec 2016 18:35:44 +0000 (18:35 +0000)]
Marking media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=165258

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years ago[WebIDL] Remove custom bindings for File and Blob constructors
weinig@apple.com [Thu, 1 Dec 2016 18:04:58 +0000 (18:04 +0000)]
[WebIDL] Remove custom bindings for File and Blob constructors
https://bugs.webkit.org/show_bug.cgi?id=165218

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/request-headers-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
Update results (still failing) to account for stricter rules about dictionary default values.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add/remove new files.

* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob): Deleted.
* bindings/js/JSFileCustom.cpp: Removed.
Remove custom constructors.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GenerateParametersCheck):
Add support for optional sequences without default values. Move string default value
optimizations into GenerateDefaultValue.

* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/Blob.idl:
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
* fileapi/File.idl:
Add support for the generated constructors.

* fileapi/BlobBuilder.cpp: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.cpp.
* fileapi/BlobBuilder.h: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.h.
* fileapi/WebKitBlobBuilder.cpp: Removed.
* fileapi/WebKitBlobBuilder.h: Removed.
Rename WebKitBlobBuilder to BlobBuilder, and update to work with generated constructor.

* fileapi/BlobPropertyBag.h: Added.
* fileapi/BlobPropertyBag.idl: Added.
Added.

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Avoid copies of the BlobPart Vector.

* platform/network/BlobPart.h:
Replace header-guards with #pragma once.

Source/WebKit2:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
Avoid copies of the BlobPart Vector.

LayoutTests:

* fast/files/blob-constructor-expected.txt:
* fast/files/file-constructor-expected.txt:
* fast/files/file-constructor.html:
* fast/files/script-tests/blob-constructor.js:
Update for stricter parsing and changed error text. (The error text
is regressed, but consistent with all generated bindings. I will work
on making improvements on this soon.)

* http/tests/fetch/fetch-as-blob.js:
Update to account for stricter rules about dictionary default values.

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

2 years agoMarking media/modern-media-controls/audio/audio-controls-buttons.html as a timeout.
ryanhaddad@apple.com [Thu, 1 Dec 2016 17:48:28 +0000 (17:48 +0000)]
Marking media/modern-media-controls/audio/audio-controls-buttons.html as a timeout.
https://bugs.webkit.org/show_bug.cgi?id=165234

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[Modern Media Controls] Provide a UI object to show a list of tracks
graouts@webkit.org [Thu, 1 Dec 2016 16:16:38 +0000 (16:16 +0000)]
[Modern Media Controls] Provide a UI object to show a list of tracks
https://bugs.webkit.org/show_bug.cgi?id=165239

Reviewed by Dean Jackson.

We add a new TracksPanel object which we will be using to display a list of
audio and text tracks. The tracks panel can be shown by calling showTracksPanel()
on a MacOSMediaControls object and will be dismissed by hitting the Escape key
or mousing down outside of the panel's bounds. While the tracks panel is up,
arrows can be used to focus individual tracks which can be activated by either
pressing the Space bar or Enter key.

Activating a track will briefly animate its background to indicate selection and
dismissing the tracks panel is also animated with a quick fade-out animation.

Data for the tracks panel is provided by specifying a dataSource property and
implementing the required methods to provide the number of sections in the panel,
the number of tracks in each section, etc.

Tests: media/modern-media-controls/tracks-panel/tracks-panel-hide-click-outside.html
       media/modern-media-controls/tracks-panel/tracks-panel-hide-esc-key.html
       media/modern-media-controls/tracks-panel/tracks-panel-hide.html
       media/modern-media-controls/tracks-panel/tracks-panel-population.html
       media/modern-media-controls/tracks-panel/tracks-panel-right-x.html
       media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-keyboard.html
       media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-mouse.html
       media/modern-media-controls/tracks-panel/tracks-panel.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen):
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen .tracks-panel):
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .tracks-panel):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
(MacOSMediaControls.prototype.hideTracksPanel):
(MacOSMediaControls):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
* Modules/modern-media-controls/controls/placard.css:
(.placard):
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/tracks-panel.css: Added.
(.tracks-panel):
(.tracks-panel *):
(.tracks-panel.fade-out):
(.tracks-panel-section):
(.tracks-panel-section:first-of-type):
(.tracks-panel-section > h3):
(.tracks-panel-section > ul):
(.tracks-panel-section > ul > li):
(.tracks-panel-section > ul > li:focus):
(.tracks-panel-section > ul > li.selected:before):
(.tracks-panel-section > ul > li.animated):
(@keyframes tracks-panel-item-selection):
(22.22%):
* Modules/modern-media-controls/controls/tracks-panel.js: Added.
(TracksPanel.prototype.get presented):
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
(TracksPanel.prototype.get rightX):
(TracksPanel.prototype.set rightX):
(TracksPanel.prototype.trackNodeSelectionAnimationDidEnd):
(TracksPanel.prototype.mouseMovedOverTrackNode):
(TracksPanel.prototype.mouseExitedTrackNode):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype.handleEvent):
(TracksPanel.prototype._childrenFromDataSource.):
(TracksPanel.prototype._childrenFromDataSource):
(TracksPanel.prototype._handleMousedown):
(TracksPanel.prototype._handleKeydown):
(TracksPanel.prototype._dismiss):
(TracksPanel.prototype._focusTrackNode):
(TracksPanel.prototype._focusPreviousTrackNode):
(TracksPanel.prototype._focusNextTrackNode):
(TracksPanel.prototype._focusFirstTrackNode):
(TracksPanel.prototype._focusLastTrackNode):
(TrackNode):
(TrackNode.prototype.activate):
(TrackNode.prototype.handleEvent):
(TrackNode.prototype._animationDidEnd):
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoLog some basic memory usage stats at interesting points in time
akling@apple.com [Thu, 1 Dec 2016 16:15:27 +0000 (16:15 +0000)]
Log some basic memory usage stats at interesting points in time
<https://webkit.org/b/165206>

Reviewed by Antti Koivisto.

This patch adds a mechanism to mark points of interests where we might
want to do performance-related logging:

    class PerformanceLogging {
        enum PointOfInterest {
            MainFrameLoadStarted,
            MainFrameLoadCompleted,
        }
        void didReachPointOfInterest(PointOfInterest)
    }

You get to this object via MainFrame::performanceLogging().

We respond to these callbacks by logging some basic data about memory usage
to the PerformanceLogging channel.

More PointOfInterest values will be added soon.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::setState):
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
* page/PerformanceLogging.cpp: Added.
(WebCore::toString):
(WebCore::getMemoryUsageStatistics):
(WebCore::PerformanceLogging::PerformanceLogging):
(WebCore::writeLog):
(WebCore::PerformanceLogging::didReachPointOfInterest):
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* page/PerformanceLogging.h: Added.
* page/cocoa/PerformanceLoggingCocoa.mm: Added.
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* platform/Logging.h:

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

2 years ago[css-grid] Move more attributes from RenderGrid to the new Grid class
svillar@igalia.com [Thu, 1 Dec 2016 11:05:22 +0000 (11:05 +0000)]
[css-grid] Move more attributes from RenderGrid to the new Grid class
https://bugs.webkit.org/show_bug.cgi?id=165094

Reviewed by Darin Adler.

Moved more attributes from RenderGrid to Grid as they are not really part of the state of
the RenderGrid object. In particular m_autoRepeat{Columns|Rows},
m_autoRepeatEmpty{Columns|Rows} and m_orderIterator. All of them are now private attributes
of the Grid class so clients should use the getters/setters provided by this patch.

This change allows to definitely remove the grid{Column|Row}Count() methods from
RenderGrid. These two became Grid::numTracks() which returns the number of tracks in the
data structure used to represent the grid (currently a matrix). Contrary to that,
RenderGrid::numTracks() returns the actual size of the grid.

No new tests as this is a refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::numTracks):
(WebCore::RenderGrid::Grid::ensureGridSize):
(WebCore::RenderGrid::Grid::setAutoRepeatTracks):
(WebCore::RenderGrid::Grid::autoRepeatTracks):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows):
(WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack):
(WebCore::RenderGrid::Grid::autoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::gridItemSpan):
(WebCore::RenderGrid::Grid::clear):
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackSizesForDirection):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::rawGridTrackSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::numTracks):
(WebCore::RenderGrid::paintChildren):
(WebCore::RenderGrid::gridColumnCount): Deleted.
(WebCore::RenderGrid::gridRowCount): Deleted.
(WebCore::RenderGrid::hasAutoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::isEmptyAutoRepeatTrack): Deleted.
(WebCore::RenderGrid::cachedGridSpan): Deleted.
* rendering/RenderGrid.h:
(WebCore::RenderGrid::autoRepeatCountForDirection): Deleted.

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

2 years agoIntroduce StringImpl::StaticStringImpl with constexpr constructor
utatane.tea@gmail.com [Thu, 1 Dec 2016 09:24:21 +0000 (09:24 +0000)]
Introduce StringImpl::StaticStringImpl with constexpr constructor
https://bugs.webkit.org/show_bug.cgi?id=165093

Reviewed by Darin Adler.

Source/WTF:

This patch adds new class, StringImpl::StaticStringImpl.
By using this class, we can easily create static StringImpls.
This class has constexpr constructor. You can initialize instances
of this class as global static variables without invoking global
constructors.

We already have similar system, StaticASCIILiteral. But using it
requires some special perl script since we need to calculate
hash value. On the other hand, we can use StaticStringImpl without
any script supports since we implement constexpr hash function.
In the future, we will replace all the use of StaticASCIILiteral
with this StaticStringImpl.

We define empty / null strings as StaticStringImpl. And we make
StringImpl::empty() & StringImpl::null() inline functions.

* wtf/Hasher.h:
(WTF::StringHasher::hashWithTop8BitsMasked):
(WTF::StringHasher::hash):
(WTF::StringHasher::finalize):
(WTF::StringHasher::finalizeAndMaskTop8Bits):
(WTF::StringHasher::computeLiteralHash):
(WTF::StringHasher::computeLiteralHashAndMaskTop8Bits):
(WTF::StringHasher::avalancheBits3):
(WTF::StringHasher::avalancheBits2):
(WTF::StringHasher::avalancheBits1):
(WTF::StringHasher::avalancheBits0):
(WTF::StringHasher::avalancheBits):
(WTF::StringHasher::avoidZero):
(WTF::StringHasher::processPendingCharacter):
(WTF::StringHasher::calculateWithRemainingLastCharacter1):
(WTF::StringHasher::calculateWithRemainingLastCharacter0):
(WTF::StringHasher::calculateWithRemainingLastCharacter):
(WTF::StringHasher::calculate1):
(WTF::StringHasher::calculate0):
(WTF::StringHasher::calculate):
(WTF::StringHasher::computeLiteralHashImpl):
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
(WTF::StringImpl::StaticStringImpl::StaticStringImpl):
(WTF::StringImpl::null):
(WTF::StringImpl::empty):
* wtf/text/StringStatics.cpp:
(WTF::StringImpl::null): Deleted.
(WTF::StringImpl::empty): Deleted.

Tools:

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):

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

2 years ago[Win] Skip failing JSC tests.
pvollan@apple.com [Thu, 1 Dec 2016 09:22:51 +0000 (09:22 +0000)]
[Win] Skip failing JSC tests.
https://bugs.webkit.org/show_bug.cgi?id=165140

Reviewed by Mark Lam.

* ChakraCore.yaml:
* microbenchmarks/tan.js:

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

2 years ago[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
carlosgc@webkit.org [Thu, 1 Dec 2016 07:51:51 +0000 (07:51 +0000)]
[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
https://bugs.webkit.org/show_bug.cgi?id=164911

Reviewed by Michael Catanzaro.

The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
image. We only use the buffer to get the image size, so we could save the image size when the image is created,
and then we don't need to care about the buffer anymore.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:

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

2 years agoUnreviewed, rolling out r209168.
beidson@apple.com [Thu, 1 Dec 2016 07:05:42 +0000 (07:05 +0000)]
Unreviewed, rolling out r209168.

Caused 2 API tests to fail

Reverted changeset:

"IndexedDB: When doing puts, don't
"updateAllIndexesForAddRecord" if there are no indexes."
https://bugs.webkit.org/show_bug.cgi?id=165215
http://trac.webkit.org/changeset/209168

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

2 years agoWebAssembly: update binary format to 0xD version
jfbastien@apple.com [Thu, 1 Dec 2016 07:04:18 +0000 (07:04 +0000)]
WebAssembly: update binary format to 0xD version
https://bugs.webkit.org/show_bug.cgi?id=164724

Reviewed by Saam Barati.

As described in the following PR: https://github.com/WebAssembly/design/pull/836

JSTests:

* wasm/Builder.js:
(const._normalizeFunctionSignature):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Type):
(const.emitters.Code):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.block_type):
(export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
* wasm/WASM.js:
* wasm/js-api/test_basic_api.js:
* wasm/self-test/test_BuilderWebAssembly.js:
(EmptyModule):
(CustomSection):
* wasm/self-test/test_WASM.js:
* wasm/wasm.json:

Source/JavaScriptCore:

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::zeroForType):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::createJSWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::marshallArgument):
* wasm/WasmFormat.cpp:
(JSC::Wasm::toString): Deleted.
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
(JSC::Wasm::toB3Type): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
(JSC::Wasm::ModuleParser::parseType):
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseResultType):
* wasm/generateWasm.py:
(Wasm.__init__):
* wasm/generateWasmOpsHeader.py:
(cppMacro):
(typeMacroizer):
(opcodeMacroizer):
* wasm/wasm.json:

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

2 years agoBuild break when using --minimal
gyuyoung.kim@webkit.org [Thu, 1 Dec 2016 05:25:24 +0000 (05:25 +0000)]
Build break when using --minimal
https://bugs.webkit.org/show_bug.cgi?id=165238

Reviewed by Darin Adler.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Use #if ENABLE(VIDEO_TRACK) guard.

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

2 years agoRoll out StringBuilder changes from the previous patch.
darin@apple.com [Thu, 1 Dec 2016 04:32:50 +0000 (04:32 +0000)]
Roll out StringBuilder changes from the previous patch.
They were a slowdown on a Kraken JSON test.

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

2 years ago[JSC] Specifying same module entry point multiple times cause TypeError
utatane.tea@gmail.com [Thu, 1 Dec 2016 03:56:12 +0000 (03:56 +0000)]
[JSC] Specifying same module entry point multiple times cause TypeError
https://bugs.webkit.org/show_bug.cgi?id=164858

Reviewed by Saam Barati.

Source/JavaScriptCore:

Allow importing the same module multiple times. Previously, when specifying the same
module in the <script type="module" src="here">, it throws TypeError.

* builtins/ModuleLoaderPrototype.js:
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestSatisfy):

LayoutTests:

* js/dom/modules/module-load-same-module-from-different-entry-point-in-src-expected.txt: Added.
* js/dom/modules/module-load-same-module-from-different-entry-point-in-src.html: Added.

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

2 years agoWebAssembly JS API: export a module namespace object instead of a module environment
utatane.tea@gmail.com [Thu, 1 Dec 2016 03:54:24 +0000 (03:54 +0000)]
WebAssembly JS API: export a module namespace object instead of a module environment
https://bugs.webkit.org/show_bug.cgi?id=165121

Reviewed by Saam Barati.

This patch setup AbstractModuleRecord further for WebAssemblyModuleRecord.
For exported entries in a wasm instance, we set up exported entries for
AbstractModuleRecord. This allows us to export WASM exported functions in
the module handling code.

Since the exported entries in the abstract module record are correctly
instantiated, the module namespace object for WASM module also starts
working correctly. So we start exposing the module namespace object
as `instance.exports` instead of the module environment object.

And we move SourceCode, lexicalVariables, and declaredVariables fields to
JSModuleRecord since they are related to JS source code (in the spec words,
they are related to the source text module record).

* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::AbstractModuleRecord):
* runtime/AbstractModuleRecord.h:
(JSC::AbstractModuleRecord::sourceCode): Deleted.
(JSC::AbstractModuleRecord::declaredVariables): Deleted.
(JSC::AbstractModuleRecord::lexicalVariables): Deleted.
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::JSModuleRecord):
* runtime/JSModuleRecord.h:
(JSC::JSModuleRecord::sourceCode):
(JSC::JSModuleRecord::declaredVariables):
(JSC::JSModuleRecord::lexicalVariables):
* wasm/WasmFormat.cpp:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finishCreation):
* wasm/js/WebAssemblyFunction.cpp:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::create):
(JSC::WebAssemblyModuleRecord::WebAssemblyModuleRecord):
(JSC::WebAssemblyModuleRecord::finishCreation):
WebAssemblyModuleRecord::link should perform linking things.
So allocating exported entries should be done here.
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyModuleRecord.h:

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

2 years ago[Modern Media Controls] Add support for right-to-left layouts
commit-queue@webkit.org [Thu, 1 Dec 2016 03:20:30 +0000 (03:20 +0000)]
[Modern Media Controls] Add support for right-to-left layouts
https://bugs.webkit.org/show_bug.cgi?id=165229

Patch by Antoine Quint <graouts@apple.com> on 2016-11-30
Reviewed by Dean Jackson.

Source/WebCore:

We implement the "usesLTRUserInterfaceLayoutDirection" property which is set by HTMLMediaElement
and set a CSS class when the layout is left-to-right, flipping the fullscreen volume slider in the
case that it would not be present (right-to-left).

Test: media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get usesLTRUserInterfaceLayoutDirection):
(MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype._updateControlsIfNeeded):

LayoutTests:

Add a test that toggles the layout direction and checks we correctly flip the volume slider.

* media/modern-media-controls/media-controller/media-controller-fullscreen-ltr-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoWeb Inspector: Remove unused parameter of InspectorInstrumentation::didFinishXHRLoading
commit-queue@webkit.org [Thu, 1 Dec 2016 03:16:13 +0000 (03:16 +0000)]
Web Inspector: Remove unused parameter of InspectorInstrumentation::didFinishXHRLoading
https://bugs.webkit.org/show_bug.cgi?id=165233

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

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
Remove unused ThreadableLoaderClient parameter.

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

2 years agoIndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no...
beidson@apple.com [Thu, 1 Dec 2016 02:42:28 +0000 (02:42 +0000)]
IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes.
https://bugs.webkit.org/show_bug.cgi?id=165215

Reviewed by Alex Christensen.

No new tests (No observable behavior change).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes.
  Avoiding this saved us some IDBKey serialization and Javascript object manipulation.

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

2 years ago[Modern Media Controls] LayoutNode: only mark properties as dirty if different than...
commit-queue@webkit.org [Thu, 1 Dec 2016 02:33:04 +0000 (02:33 +0000)]
[Modern Media Controls] LayoutNode: only mark properties as dirty if different than current value
https://bugs.webkit.org/show_bug.cgi?id=165236

Patch by Antoine Quint <graouts@apple.com> on 2016-11-30
Reviewed by Simon Fraser.

Source/WebCore:

Check that the new value is different than the current value before marking the property as dirty.

* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set x):
(LayoutNode.prototype.set y):
(LayoutNode.prototype.set width):
(LayoutNode.prototype.set height):
(LayoutNode.prototype.set visible):
(performScheduledLayout):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.get hasScheduledLayoutCallbacks):

LayoutTests:

Update LayoutNode property tests to check that setting a given property to the
same value doesn't schedule an update.

* media/modern-media-controls/layout-node/height-expected.txt:
* media/modern-media-controls/layout-node/height.html:
* media/modern-media-controls/layout-node/visible-expected.txt:
* media/modern-media-controls/layout-node/visible.html:
* media/modern-media-controls/layout-node/width-expected.txt:
* media/modern-media-controls/layout-node/width.html:
* media/modern-media-controls/layout-node/x-expected.txt:
* media/modern-media-controls/layout-node/x.html:
* media/modern-media-controls/layout-node/y-expected.txt:
* media/modern-media-controls/layout-node/y.html:

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

2 years agoSubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
jiewen_tan@apple.com [Thu, 1 Dec 2016 01:11:11 +0000 (01:11 +0000)]
SubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
https://bugs.webkit.org/show_bug.cgi?id=164744
<rdar://problem/29258083>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Since we don't support any cryptography algorithms that has deriveKey operations,
SubtleCrypto::deriveKey will always return NOT_SUPPORTED_ERR for now.

Test: crypto/subtle/deriveKey-malformed-parameters.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveKeyPromise):
(WebCore::JSSubtleCrypto::deriveKey):
* crypto/SubtleCrypto.idl:

LayoutTests:

* crypto/subtle/deriveKey-malformed-parameters-expected.txt: Added.
* crypto/subtle/deriveKey-malformed-parameters.html: Added.

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

2 years agoWebAssembly builder: don't throw when checker not implemented
jfbastien@apple.com [Thu, 1 Dec 2016 01:03:02 +0000 (01:03 +0000)]
WebAssembly builder: don't throw when checker not implemented
https://bugs.webkit.org/show_bug.cgi?id=165219

Reviewed by Mark Lam.

We should perform whichever checks we've implemented, and assume the rest are OK until bug #163421 is fixed.

* wasm/Builder.js:
* wasm/README.md:
* wasm/function-tests/add-12.js:
* wasm/function-tests/br-if-loop-less-than.js:
* wasm/function-tests/brTableAsIf.js:
* wasm/function-tests/brTableManyValues.js:
* wasm/function-tests/brTableWithLoop.js:
* wasm/function-tests/dumb-eq-if-then-else.js:
* wasm/function-tests/dumb-less-than-fallthrough.js:
* wasm/function-tests/dumb-less-than-ite.js:
* wasm/function-tests/eqz.js:
* wasm/function-tests/factorial.js:
* wasm/function-tests/float-sub.js:
* wasm/function-tests/i32-load.js:
* wasm/function-tests/i32-load8-s.js:
* wasm/function-tests/if-then-else-fallthrough.js:
* wasm/function-tests/if-then-fallthrough.js:
* wasm/function-tests/loop-mult.js:
* wasm/function-tests/loop-sum.js:
* wasm/function-tests/max.js:
* wasm/function-tests/min.js:
* wasm/function-tests/ret5.js:
* wasm/function-tests/select.js:
* wasm/self-test/test_BuilderJSON.js:

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

2 years agoUpdate SubtleCrypto::digest to match the latest spec
jiewen_tan@apple.com [Thu, 1 Dec 2016 00:28:04 +0000 (00:28 +0000)]
Update SubtleCrypto::digest to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164742
<rdar://problem/29258037>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* WebCryptoAPI/digest/test_digest-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch updates the SubtleCrypto::digest method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-digest.
Currently supported digest algorithms are SHA-1, SHA-224, SHA-256, SHA-384,
and SHA-512.

Tests: crypto/subtle/digest-malformed-parameters.html
       crypto/subtle/sha1-digest.html
       crypto/subtle/sha224-digest.html
       crypto/subtle/sha256-digest.html
       crypto/subtle/sha384-digest.html
       crypto/subtle/sha512-digest.html
       crypto/workers/subtle/sha1-digest.html
       crypto/workers/subtle/sha224-digest.html
       crypto/workers/subtle/sha256-digest.html
       crypto/workers/subtle/sha384-digest.html
       crypto/workers/subtle/sha512-digest.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionDigestPromise):
(WebCore::JSSubtleCrypto::digest):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::digest):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.h:

LayoutTests:

* crypto/subtle/digest-malformed-parameters-expected.txt: Added.
* crypto/subtle/digest-malformed-parameters.html: Added.
* crypto/subtle/sha1-digest-expected.txt: Added.
* crypto/subtle/sha1-digest.html: Added.
* crypto/subtle/sha224-digest-expected.txt: Added.
* crypto/subtle/sha224-digest.html: Added.
* crypto/subtle/sha256-digest-expected.txt: Added.
* crypto/subtle/sha256-digest.html: Added.
* crypto/subtle/sha384-digest-expected.txt: Added.
* crypto/subtle/sha384-digest.html: Added.
* crypto/subtle/sha512-digest-expected.txt: Added.
* crypto/subtle/sha512-digest.html: Added.
* crypto/workers/subtle/resources/sha1-digest.js: Added.
* crypto/workers/subtle/resources/sha224-digest.js: Added.
* crypto/workers/subtle/resources/sha256-digest.js: Added.
* crypto/workers/subtle/resources/sha384-digest.js: Added.
* crypto/workers/subtle/resources/sha512-digest.js: Added.
* crypto/workers/subtle/sha1-digest-expected.txt: Added.
* crypto/workers/subtle/sha1-digest.html: Added.
* crypto/workers/subtle/sha224-digest-expected.txt: Added.
* crypto/workers/subtle/sha224-digest.html: Added.
* crypto/workers/subtle/sha256-digest-expected.txt: Added.
* crypto/workers/subtle/sha256-digest.html: Added.
* crypto/workers/subtle/sha384-digest-expected.txt: Added.
* crypto/workers/subtle/sha384-digest.html: Added.
* crypto/workers/subtle/sha512-digest-expected.txt: Added.
* crypto/workers/subtle/sha512-digest.html: Added.

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

2 years ago[Modern Media Controls] UI Library: <audio> controls
graouts@webkit.org [Thu, 1 Dec 2016 00:14:19 +0000 (00:14 +0000)]
[Modern Media Controls] UI Library: <audio> controls
https://bugs.webkit.org/show_bug.cgi?id=164619
<rdar://problem/29207215>

Reviewed by Dean Jackson.

Add a default size for <audio> elements (200x50).

Tests: media/modern-media-controls/audio/audio-controls-buttons.html
       media/modern-media-controls/audio/audio-controls-metrics.html

* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):

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

2 years agoTypeInfo::OutOfLineTypeFlags should be 16 bits in size.
mark.lam@apple.com [Thu, 1 Dec 2016 00:10:44 +0000 (00:10 +0000)]
TypeInfo::OutOfLineTypeFlags should be 16 bits in size.
https://bugs.webkit.org/show_bug.cgi?id=165224

Reviewed by Saam Barati.

There's no reason for OutOfLineTypeFlags to be constraint to 8 bits since the
space is available to us.  Making OutOfLineTypeFlags 16 bits brings TypeInfo up
to 32 bits in size from the current 24 bits.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):

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

2 years ago[Modern Media Controls] Add an HTML comment flag to turn the feature on
graouts@webkit.org [Thu, 1 Dec 2016 00:10:28 +0000 (00:10 +0000)]
[Modern Media Controls] Add an HTML comment flag to turn the feature on
https://bugs.webkit.org/show_bug.cgi?id=165226

Reviewed by Dean Jackson.

Source/WebKit2:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetModernMediaControlsEnabled):
(WKPreferencesGetModernMediaControlsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

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

2 years agoREGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
beidson@apple.com [Wed, 30 Nov 2016 23:53:23 +0000 (23:53 +0000)]
REGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
https://bugs.webkit.org/show_bug.cgi?id=165216

Rubberstamped by Tim Horton.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB): Change invalid ASSERT into a null check.

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

2 years agoAdd separate settings and preferences to enable/disable async decoding for large...
commit-queue@webkit.org [Wed, 30 Nov 2016 23:48:00 +0000 (23:48 +0000)]
Add separate settings and preferences to enable/disable async decoding for large images and animated images
https://bugs.webkit.org/show_bug.cgi?id=165177

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-11-30
Reviewed by Simon Fraser.
Source/WebCore:

Instead of having the async image decoding be controlled by one setting,
two separate settings are added:
    largeImageAsyncDecodingEnabled
    animatedImageAsyncDecodingEnabled

And an existing setting is removed:
    asyncImageDecodingEnabled

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImage.h:
* page/Settings.in:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageObserver.h:

Source/WebKit/mac:

Hook up the async image decoding settings for WebKit1.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences largeImageAsyncDecodingEnabled]):
(-[WebPreferences setLargeImageAsyncDecodingEnabled:]):
(-[WebPreferences animatedImageAsyncDecodingEnabled]):
(-[WebPreferences setAnimatedImageAsyncDecodingEnabled:]):
(-[WebPreferences asyncImageDecodingEnabled]): Deleted.
(-[WebPreferences setAsyncImageDecodingEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Hook up the async image decoding settings for WebKit2.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _largeImageAsyncDecodingEnabled]):
(-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
(-[WKPreferences _animatedImageAsyncDecodingEnabled]):
(-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
(-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
(-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Pref and a menu item to toggle async image decoding settings for WebKits 1 and 2.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleLargeImageAsyncDecodingEnabled:]):
(-[SettingsController largeImageAsyncDecodingEnabled]):
(-[SettingsController toggleAnimatedImageAsyncDecodingEnabled:]):
(-[SettingsController animatedImageAsyncDecodingEnabled]):
(-[SettingsController toggleAsyncImageDecodingEnabled:]): Deleted.
(-[SettingsController asyncImageDecodingEnabled]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

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

2 years agoASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFrom...
zalan@apple.com [Wed, 30 Nov 2016 23:12:45 +0000 (23:12 +0000)]
ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
https://bugs.webkit.org/show_bug.cgi?id=155364
<rdar://problem/27720461>

Reviewed by David Hyatt.

Source/WebCore:

RenderNamedFlowThread is considered to be a root for the current renderer context so
we need to bail out from the containing block traversal here (like we do for the RenderView).

Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):

LayoutTests:

* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.

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

2 years agoIndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
beidson@apple.com [Wed, 30 Nov 2016 22:59:28 +0000 (22:59 +0000)]
IndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
https://bugs.webkit.org/show_bug.cgi?id=165221

Reviewed by Myles C. Maxfield.

No new tests (No observable behavior change).

On a profile of "Lots of writes to an IndexedDB", timer scheduling/firing presented as over 10% of the time.

This patch negates much of that.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::pendingOperationTimerFired): Send 100 operations off to the server
  before spinning the runloop, instead of only 1.

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

2 years ago[Modern Media Controls] Controls are not visible when returning from picture-in-pictu...
commit-queue@webkit.org [Wed, 30 Nov 2016 22:45:38 +0000 (22:45 +0000)]
[Modern Media Controls] Controls are not visible when returning from picture-in-picture playback
https://bugs.webkit.org/show_bug.cgi?id=165183

Patch by Antoine Quint <graouts@apple.com> on 2016-11-30
Reviewed by Dean Jackson.

We need to call MediaControlsHost::setPreparedToReturnVideoLayerToInline() when we return from
picture-in-picture playback such that the video layer is correctly stacked under the media controls.
We call that function in a rAF call to ensure it's performed in sync with the next scheduled layout
or the media controls would not appear in sync with the video layer.

We also fix an error from a previous commit in ControlsVisibilitySupport.

* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.syncControl):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):

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

2 years agoUpdate SubtleCrypto::wrapKey to match the latest spec
jiewen_tan@apple.com [Wed, 30 Nov 2016 22:26:10 +0000 (22:26 +0000)]
Update SubtleCrypto::wrapKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164746
<rdar://problem/29258160>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::wrapKey method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-wrapKey.
2. It implements wrapKey operations of the following algorithms: AES-KW.
3. It also replaces JSSubtleCrypto* with auto in all promise functions.

Tests: crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html
       crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html
       crypto/subtle/aes-kw-import-key-wrap-raw-key.html
       crypto/subtle/aes-kw-wrap-key-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html
       crypto/subtle/wrapKey-malformed-parameters.html
       crypto/workers/subtle/aes-cbc-import-key-wrap-key.html
       crypto/workers/subtle/aes-kw-import-key-wrap-key.html
       crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::supportExportKeyThrow):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::JSSubtleCrypto::wrapKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::wrapKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::wrapKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::wrapKeyAES_KW):
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformEncrypt):

LayoutTests:

* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html: Added.
* crypto/subtle/aes-kw-import-key-wrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-kw-import-key-wrap-raw-key.html: Added.
* crypto/subtle/aes-kw-wrap-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-kw-wrap-key-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html: Added.
* crypto/subtle/wrapKey-malformed-parameters-expected.txt: Added.
* crypto/subtle/wrapKey-malformed-parameters.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-wrap-key.html: Added.
* crypto/workers/subtle/aes-kw-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-kw-import-key-wrap-key.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-wrap-key.js: Added.
* crypto/workers/subtle/resources/aes-kw-import-key-wrap-key.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-wrap-key.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html: Added.

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

2 years agoREGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
commit-queue@webkit.org [Wed, 30 Nov 2016 22:21:16 +0000 (22:21 +0000)]
REGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
https://bugs.webkit.org/show_bug.cgi?id=164388
<rdar://problem/29101555>

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

Source/JavaScriptCore:

There was a possibility of a deadlock between the main thread and the GC thread
with the SamplingProfiler lock when Inspector is processing samples to send to
the frontend. The Inspector (main thread) was holding the SamplingProfiler lock
while processing samples, which runs JavaScript that could trigger a GC, and
GC then tries to acquire the SamplingProfiler lock to process unprocessed samples.

A simple solution here is to tighten the bounds of when Inspector holds the
SamplingProfiler lock. It only needs the lock when extracting samples from
the SamplingProfiler. It doesn't need to hold the lock for processing those
samples, which is what can run script and cause a GC.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
Tighten bounds of this lock to only where it is needed.

LayoutTests:

* platform/mac/TestExpectations:
Unskip now that tests are no longer flakey.

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

2 years ago[WebIDL] Add support for more missing / exotic IDLTypes
weinig@apple.com [Wed, 30 Nov 2016 22:10:49 +0000 (22:10 +0000)]
[WebIDL] Add support for more missing / exotic IDLTypes
https://bugs.webkit.org/show_bug.cgi?id=165156

Reviewed by Alex Christensen.

- Adds JSDOMConvert support for WebIDL's 'callback interface' and 'callback function'.
- Adds JSDOMConvert support for WebIDL extensions for SerializedScriptValue, Dictionary,
  EventListener and XPathNSResolver (moving much of their special casing out of perl and
  into JSDOMConvert).

* DerivedSources.make:
Adds $(WebCore)/testing to the list of available IDL directories to keep internals
compiling.

* Modules/webaudio/WaveShaperNode.cpp:
* Modules/webaudio/WaveShaperNode.h:
Update to take curve by reference.

* bindings/generic/IDLTypes.h:
(WebCore::IDLWrapper):
Add helper type, IDLWrapper, which serves as a base type for all IDLTypes that are
RefCounted.

* bindings/js/JSDOMConvert.h:
(WebCore::convert):
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convertNewlyCreated):
(WebCore::Converter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convertNewlyCreated):
(WebCore::Converter<IDLSerializedScriptValue<T>>::convert):
(WebCore::JSConverter<IDLSerializedScriptValue<T>>::convert):
(WebCore::Converter<IDLLegacyDictionary<T>>::convert):
(WebCore::Converter<IDLEventListener<T>>::convert):
(WebCore::Converter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated):
Add converters for the new types. IDLSerializedScriptValue, IDLLegacyDictionary, IDLEventListener and IDLXPathNSResolver
have been templatized to avoid including their implementation classes everywhere. We can improve this in the future by
splitting JSDOMConvert up into to separate files.

* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
(IsInterfaceType):
(IsWrapperType):
(ComputeIsCallbackInterface):
(ComputeIsCallbackFunction):
Add new predicates, IsBuiltinType and IsInterfaceType, and re-work IsWrapperType to determine all types that
have a JS wrapper (and consequently a JS{name}.h file).

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
Update to add include for EventListener.

(GetArgumentExceptionFunction):
(GetArgumentExceptionThrower):
(GetAttributeExceptionFunction):
(GetAttributeExceptionThrower):
Add support for exceptions for callbacks.

(PassArgumentExpression):
Factor out logic on how to pass arguments to C++.

(GenerateHeader):
Make toWrapped and JSDOMWrapperConverterTraits work with XPathNSResolver.

(GenerateImplementation):
Update to use PassArgumentExpression and pass a global object reference to JSValueToNative.

(GenerateParametersCheck):
Remove special casing for callbacks.

(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Simplify toJS functions. State and global object are not necessary.

(GetBaseIDLType):
Add support for new types. Add assertion so that unknown types can't get through.

(ShouldPassArgumentByReference):
Rename from ShouldPassWrapperByReference, and merge in CodeGenerator's ShouldPassWrapperByReference.

(JSValueToNativeDOMConvertNeedsThisObject):
Added. Predicate to determine types that need a this object for conversion.

(JSValueToNativeDOMConvertNeedsGlobalObject):
Added. Predicate to determine types that need a global object for conversion.

(JSValueToNative):
Remove special cases for new types.

(NativeToJSValueDOMConvertNeedsState):
Add SerializedScriptValue and XPathNSResolver.

(NativeToJSValueDOMConvertNeedsGlobalObject):
Add SerializedScriptValue and XPathNSResolver.

(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused $statePointer and replace $globalObject with $globalObjectReference. Remove
special cases for new types.

(GenerateConstructorDefinition):
Use PassArgumentExpression.

* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerializedScriptValueInterface.idl:
Update tests. Remove test for a readonly attribute returning a Promise, which is not supported
yet (this was caught by the assertion added to GetBaseIDLType). Add tests for passing and returning
SerializedScriptValues from functions.

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

2 years agoSkipping crashing test js/dom/modules/module-will-fire-beforeload.html.
ryanhaddad@apple.com [Wed, 30 Nov 2016 21:42:40 +0000 (21:42 +0000)]
Skipping crashing test js/dom/modules/module-will-fire-beforeload.html.
https://bugs.webkit.org/show_bug.cgi?id=164883

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[iOS][WK2] Turn on HTML interactive form validation feature
cdumez@apple.com [Wed, 30 Nov 2016 21:42:16 +0000 (21:42 +0000)]
[iOS][WK2] Turn on HTML interactive form validation feature
https://bugs.webkit.org/show_bug.cgi?id=165212
<rdar://problem/29444356>

Reviewed by Simon Fraser.

Turn on HTML interactive form validation feature on iOS WK2
now that we have a native UI.

* Shared/WebPreferencesDefinitions.h:

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

2 years agoUpdate SubtleCrypto::verify to match the latest spec
jiewen_tan@apple.com [Wed, 30 Nov 2016 21:19:20 +0000 (21:19 +0000)]
Update SubtleCrypto::verify to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164741
<rdar://problem/29257935>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::verify method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-verify.
2. It implements verify operations of the following algorithms: HMAC, and
   RSASSA-PKCS1-V1_5.

Tests: crypto/subtle/hmac-generate-key-sign-verify.html
       crypto/subtle/hmac-import-key-verify-sha1.html
       crypto/subtle/hmac-import-key-verify-sha224.html
       crypto/subtle/hmac-import-key-verify-sha256.html
       crypto/subtle/hmac-import-key-verify-sha384.html
       crypto/subtle/hmac-import-key-verify-sha512.html
       crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html
       crypto/subtle/verify-malformed-parameters.html
       crypto/workers/subtle/hmac-import-key-verify.html
       crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionVerifyPromise):
(WebCore::JSSubtleCrypto::verify):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::verify):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::verify):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::verifyRSASSA_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):

LayoutTests:

Besides adding tests for SubtleCrypto::verify, it also enhances
*generate-key-encrypt-decrypt tests.

* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html:
* crypto/subtle/hmac-generate-key-sign-verify-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sign-verify.html: Added.
* crypto/subtle/hmac-import-key-verify-sha1-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha1.html: Added.
* crypto/subtle/hmac-import-key-verify-sha224-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha224.html: Added.
* crypto/subtle/hmac-import-key-verify-sha256-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha256.html: Added.
* crypto/subtle/hmac-import-key-verify-sha384-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha384.html: Added.
* crypto/subtle/hmac-import-key-verify-sha512-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha512.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label-expected.txt:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html: Added.
* crypto/subtle/verify-malformed-parameters-expected.txt: Added.
* crypto/subtle/verify-malformed-parameters.html: Added.
* crypto/workers/subtle/hmac-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/hmac-import-key-verify.html: Added.
* crypto/workers/subtle/resources/hmac-import-key-verify.js: Added.
* crypto/workers/subtle/resources/rsassa-pkcs1-v1_5-import-key-verify.js: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html: Added.

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

2 years agoProxy is not allowed in the global prototype chain.
mark.lam@apple.com [Wed, 30 Nov 2016 21:13:42 +0000 (21:13 +0000)]
Proxy is not allowed in the global prototype chain.
https://bugs.webkit.org/show_bug.cgi?id=165205

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
- We'll now throw a TypeError if we detect a Proxy in the global prototype chain.

LayoutTests:

* js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: Added.
* js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: Added.

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

2 years ago[CSS Parser] Fix columns shorthand parsing
hyatt@apple.com [Wed, 30 Nov 2016 20:38:46 +0000 (20:38 +0000)]
[CSS Parser] Fix columns shorthand parsing
https://bugs.webkit.org/show_bug.cgi?id=165210

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::consumeColumnWidthOrCount): Deleted.
Bring over the old parser code, since it was actually better at creating implicit values for auto.

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

2 years ago[Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
aestes@apple.com [Wed, 30 Nov 2016 20:34:18 +0000 (20:34 +0000)]
[Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
https://bugs.webkit.org/show_bug.cgi?id=165168
<rdar://problem/29003618>

Reviewed by Simon Fraser.

* platform/RuntimeApplicationChecks.h: Declared applicationBundleIdentifier().
* platform/RuntimeApplicationChecks.mm:
(WebCore::applicationBundleIdentifier): Made non-static.
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): If the new NEFilterSource instance
responds to -setSourceAppBundleID:, call it with applicationBundleIdentifier().
* platform/spi/cocoa/NEFilterSourceSPI.h: Moved NEFilterSourceOptionsRedirectURL into the
!USE(APPLE_INTERNAL_SDK) section and unconditionally declared @property sourceAppBundleID in
a new category on NEFilterSource.

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

2 years agoUnreviewed, rolling out r209112.
commit-queue@webkit.org [Wed, 30 Nov 2016 20:30:16 +0000 (20:30 +0000)]
Unreviewed, rolling out r209112.
https://bugs.webkit.org/show_bug.cgi?id=165208

"It regressed Octane/Raytrace and JetStream" (Requested by
saamyjoon on #webkit).

Reverted changeset:

"We should support CreateThis in the FTL"
https://bugs.webkit.org/show_bug.cgi?id=164904
http://trac.webkit.org/changeset/209112

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

2 years agoUse 'childOfType' template when retrieving Shadow DOM elements
bfulgham@apple.com [Wed, 30 Nov 2016 20:20:32 +0000 (20:20 +0000)]
Use 'childOfType' template when retrieving Shadow DOM elements
https://bugs.webkit.org/show_bug.cgi?id=165145
<rdar://problem/29331830>

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
       fast/shadow-dom/file-input-element-shadow-manipulation.html
       fast/shadow-dom/keygen-shadow-manipulation.html
       fast/shadow-dom/media-shadow-manipulation.html
       fast/shadow-dom/range-input-element-shadow-manipulation.html
       fast/shadow-dom/textarea-shadow-manipulation.html

Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
than relying on expected element positions, as these can be changed by
JavaScript.

Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.

* dom/Element.h:
(WebCore::Element::isUploadButton): Added.
(WebCore::Element::isSliderContainerElement): Added.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
the first child is the one we want.
* html/FileInputType.cpp:
(isType): Added.
(WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
the first child is the one we want.
(WebCore::FileInputType::multipleAttributeChanged): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaControls): Ditto.
(WebCore::HTMLMediaElement::hasMediaControls): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sliderTrackElement): Ditto.
* html/shadow/SliderThumbElement.h:
(isType): Added.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
the first child is the one we want.

LayoutTests:

* fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/color-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/keygen-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/keygen-shadow-manipulation.html: Added.
* fast/shadow-dom/media-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/media-shadow-manipulation.html: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/textarea-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/textarea-shadow-manipulation.html: Added.

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

2 years agoIndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
beidson@apple.com [Wed, 30 Nov 2016 19:59:01 +0000 (19:59 +0000)]
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974

Reviewed by Alex Christensen.

No new tests (No behavior change other than being faster).

Instead of building new SQLiteStatements from scratch each time they're needed and then
finalizing them after they're used for a single operation, we cache them.

For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

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

2 years agoWeb Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
joepeck@webkit.org [Wed, 30 Nov 2016 19:48:04 +0000 (19:48 +0000)]
Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
https://bugs.webkit.org/show_bug.cgi?id=165157
<rdar://problem/27896562>

Reviewed by Brian Burg.

Source/WebInspectorUI:

By correctly disallowing slashes in the scheme Web Inspector resolves
the correct absolute URL and doesn't end up trying to navigate to an
incorrect file URL.

* UserInterface/Base/URLUtilities.js:
(parseURL):
Disallow "/" characters in the scheme portion. (/http://example.com)
Allow path to be optional before a fragment portion. (http://example.com#frag)

LayoutTests:

* inspector/unit-tests/url-utilities-expected.txt:
* inspector/unit-tests/url-utilities.html:
Add some tests for expected valid and invalid parseURL cases.
Note some cases that we don't handle properly and would benefit
by switching to URL constructor which is a much larger change.

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

2 years ago[CSS Parser] Make sure -webkit-background-size coalesces identical values.
hyatt@apple.com [Wed, 30 Nov 2016 19:39:12 +0000 (19:39 +0000)]
[CSS Parser] Make sure -webkit-background-size coalesces identical values.
https://bugs.webkit.org/show_bug.cgi?id=165207

Reviewed by Dean Jackson.

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

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

2 years ago[MediaStream] Sync video preview layer and parent layer sizes
eric.carlson@apple.com [Wed, 30 Nov 2016 19:20:32 +0000 (19:20 +0000)]
[MediaStream] Sync video preview layer and parent layer sizes
https://bugs.webkit.org/show_bug.cgi?id=165139

Reviewed by Jer Noble.

CALayer auto-resizing doesn't work on iOS, so manually reize the video capture preview layer
whenever the background layer's bounds change.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview): Create layer observer.
(WebCore::AVVideoSourcePreview::backgroundLayerBoundsChanged): Sync preview layer and background
  layer sizes.
(WebCore::AVVideoSourcePreview::invalidate): Invalidate and clear observer.
(-[WebCoreAVVideoCaptureSourceObserver initWithParent:]):
(-[WebCoreAVVideoCaptureSourceObserver setParent:]): Add KVO bounds observer.
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Call
parent when "bounds" changes.
(-[WebCoreAVVideoCaptureSourceObserver actionForKey:]): Return nil to disable all animations.

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

2 years agoReverted r209130.
aestes@apple.com [Wed, 30 Nov 2016 19:19:44 +0000 (19:19 +0000)]
Reverted r209130.

The new test fast/shadow-dom/keygen-shadow-manipulation.html asserts and crashes on Mac debug builds.

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