WebKit-https.git
2 years ago[CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
hyatt@apple.com [Wed, 14 Dec 2016 23:15:24 +0000 (23:15 +0000)]
[CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
https://bugs.webkit.org/show_bug.cgi?id=165876

Reviewed by Simon Fraser.

* css/CSSKeyframeRule.cpp:
(WebCore::StyleRuleKeyframe::StyleRuleKeyframe):
(WebCore::StyleRuleKeyframe::~StyleRuleKeyframe):
(WebCore::StyleRuleKeyframe::mutableProperties):
(WebCore::StyleRuleKeyframe::keyText):
(WebCore::StyleRuleKeyframe::setKeyText):
(WebCore::StyleRuleKeyframe::cssText):
(WebCore::CSSKeyframeRule::CSSKeyframeRule):
(WebCore::StyleKeyframe::StyleKeyframe): Deleted.
(WebCore::StyleKeyframe::~StyleKeyframe): Deleted.
(WebCore::StyleKeyframe::mutableProperties): Deleted.
(WebCore::StyleKeyframe::keyText): Deleted.
(WebCore::StyleKeyframe::setKeyText): Deleted.
(WebCore::StyleKeyframe::cssText): Deleted.
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::keyframes):
(WebCore::StyleRuleKeyframes::parserAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::CSSKeyframesRule::appendRule):
(WebCore::CSSKeyframesRule::item):
* css/CSSKeyframesRule.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::keyframeStylesForAnimation):
* css/StyleResolver.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
* css/StyleRule.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseDeferredKeyframeList):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeKeyframeStyleRule):
* css/parser/CSSParserImpl.h:

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

2 years agoMarking streams/pipe-to.html as flaky on macOS debug.
ryanhaddad@apple.com [Wed, 14 Dec 2016 23:01:17 +0000 (23:01 +0000)]
Marking streams/pipe-to.html as flaky on macOS debug.
https://bugs.webkit.org/show_bug.cgi?id=165874

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoRemoving Release annotation from three tests that are also flaky on Debug.
ryanhaddad@apple.com [Wed, 14 Dec 2016 22:48:36 +0000 (22:48 +0000)]
Removing Release annotation from three tests that are also flaky on Debug.
https://bugs.webkit.org/show_bug.cgi?id=163361

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years ago[CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid...
hyatt@apple.com [Wed, 14 Dec 2016 22:34:04 +0000 (22:34 +0000)]
[CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid deferred parsing.
https://bugs.webkit.org/show_bug.cgi?id=165868

Reviewed by Simon Fraser.

With this new model of token copying, the sheet text needs to be retained. The tokenizer did this,
but we're no longer keeping it around.

StyleInvalidation is also aggressively crawling media rules, even unsupported ones, so fix it
to avoid deferred parsing.

* css/StyleInvalidationAnalysis.cpp:
(WebCore::shouldDirtyAllStyle):
* css/parser/CSSDeferredParser.cpp:
(WebCore::CSSDeferredParser::CSSDeferredParser):
* css/parser/CSSDeferredParser.h:
(WebCore::CSSDeferredParser::create):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):

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

2 years agoWeb Inspector: Zooming in on the Timeline should always zoom right where the cursor is
mattbaker@apple.com [Wed, 14 Dec 2016 22:04:25 +0000 (22:04 +0000)]
Web Inspector: Zooming in on the Timeline should always zoom right where the cursor is
https://bugs.webkit.org/show_bug.cgi?id=151118
<rdar://problem/23487912>

Reviewed by Timothy Hatcher.

Use correct left edge for timeline overview graph elements.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._handleWheelEvent):
(WebInspector.TimelineOverview._handleGestureStart):
(WebInspector.TimelineOverview.prototype._handleGestureChange):

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

2 years agoiOS: An element with tabindex is not focusable unless there is no mouse event handler
rniwa@webkit.org [Wed, 14 Dec 2016 21:57:37 +0000 (21:57 +0000)]
iOS: An element with tabindex is not focusable unless there is no mouse event handler
https://bugs.webkit.org/show_bug.cgi?id=165843

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute.
Check that condition along with event listeners.

Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html

* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):

Tools:

Add testRunner.isWebKit2 which is always true in WebKitTestRunner.
Without this, it's really hard to reliably differentiate DumpRenderTree and WebKitTestRunner,
and DumpRenderTree's runUIScript would hit an assertion :(

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::isWebKit2):

LayoutTests:

Added a regression test for focusing an element with just tabindex using UIHelper.

Also fixed UIHelper to work in iOS DumpRenderTree which was hitting an assertion
by explicitly checking testRunner.isWebKit2. Prior to fixing this, it was hitting
an assertion in RunLoop::main() which was asserting that there is a runloop,
which doesn't exist in DumpRenderTree.

* fast/events/focusing-element-with-tabindex-by-tap-or-click-expected.txt: Added.
* fast/events/focusing-element-with-tabindex-by-tap-or-click.html: Added.
* platform/ios-simulator-wk2/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.isWebKit2):
(window.UIHelper.wait): Added the support for js-test.js / js-test-pre.js style tests.

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

2 years agoProgress towards using ANGLE to do WebGL rendering
achristensen@apple.com [Wed, 14 Dec 2016 21:45:28 +0000 (21:45 +0000)]
Progress towards using ANGLE to do WebGL rendering
https://bugs.webkit.org/show_bug.cgi?id=165864

Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:
Compile more files, and add some more "public" headers.
ANGLE is not a public framework, so these headers just go in
WebKitBuild/Release/usr/local/include/ANGLE to be included when compiling WebCore.
* ANGLE/egl.h: Added.
* ANGLE/eglext.h: Added.
* ANGLE/eglplatform.h: Added.
* ANGLE/entry_points_gles_2_0.h: Added.
* ANGLE/entry_points_gles_2_0_ext.h: Added.
* ANGLE/entry_points_gles_3_0.h: Added.
* ANGLE/export.h: Added.
* ANGLE/gl2.h: Added.
* ANGLE/gl2ext.h: Added.
* ANGLE/gl2platform.h: Added.
* ANGLE/gl3.h: Added.
* ANGLE/gl31.h: Added.
* ANGLE/gl3platform.h: Added.
* ANGLE/khrplatform.h: Added.
Add more forwarding headers.  There are already a few, but we need more.
* CMakeLists.txt:
* PlatformMac.cmake:
Make the frameworks linked to by ANGLE be private so frameworks that link with
ANGLE don't automatically link with them. This allows me to switch ANGLE from a
static library to a dynamic library to make sure WebCore isn't directly using OpenGL.
* PlatformWin.cmake:
Move HLSL-specific files to only be built on Windows.
* include/EGL/egl.h:
* include/EGL/eglplatform.h:
* include/GLES2/gl2.h:
* include/GLES2/gl2platform.h:
* include/GLES3/gl3.h:
* include/GLES3/gl31.h:
* include/GLES3/gl32.h:
* include/GLES3/gl3platform.h:
* src/libGLESv2/entry_points_egl.h:
* src/libGLESv2/entry_points_egl_ext.h:
* src/libGLESv2/entry_points_gles_2_0.h:
* src/libGLESv2/entry_points_gles_2_0_ext.h:
* src/libGLESv2/entry_points_gles_3_0.h:
* src/libGLESv2/entry_points_gles_3_1.h:
Include ANGLE headers as #include <ANGLE/*> instead of #include <KHR/*> or #include <GLES/*>
This is needed to distinguish the ANGLE headers from any system OpenGL/OpenGLES headers.
We will eventually only include ANGLE's entry_points_*.h directly from WebCore.

Source/WebCore:

No new tests, no change in behavior.
Just compile fixes for a configuration that will soon be standard
that can be landed now without breaking anything.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharedDisplay):
Ignore some clang warnings that will cause problems when this is compiled on Mac.

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

2 years agoAdd some instrumentation to try to detect a crash on the bots
andersca@apple.com [Wed, 14 Dec 2016 21:31:26 +0000 (21:31 +0000)]
Add some instrumentation to try to detect a crash on the bots
https://bugs.webkit.org/show_bug.cgi?id=165866

Reviewed by Sam Weinig.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):

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

2 years agoWebAssembly JS API: implement Global
keith_miller@apple.com [Wed, 14 Dec 2016 21:29:14 +0000 (21:29 +0000)]
WebAssembly JS API: implement Global
https://bugs.webkit.org/show_bug.cgi?id=164133

Reviewed by Saam Barati.

JSTests:

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
* wasm/Builder_WebAssemblyBinary.js:
(const.valueType.WASM.description.type.i32.type.const.putGlobalType):
(const.putOp):
(const.putInitExpr):
(const.emitters.Import):
(const.emitters.Global):
(const.emitters.Export):
(const.emitters.Code):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.varuint32):
(export.default.LowLevelBinary.prototype.varint32):
* wasm/js-api/global-error.js: Added.
(catch):
(assert.truthy):
* wasm/js-api/global-external-init-from-import.js: Added.
* wasm/js-api/global-internal-init-from-import.js: Added.
* wasm/js-api/global-mutate.js: Added.
(createInternalGlobalModule):
* wasm/js-api/globals-export.js: Added.
* wasm/js-api/globals-import.js: Added.
* wasm/wasm.json:

Source/JavaScriptCore:

This patch adds support for globals. It handles imports, exports
and internal globals. In the MVP only internal globals are allowed
to be mutable. This means we can store a C-array of 64-bit slots
off the instance holding them. When globals are exported to JS
they are done so as numbers. This means that i64 globals cannot be
imported or exported.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::getGlobal):
(JSC::Wasm::B3IRGenerator::setGlobal):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmFormat.h:
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseImport):
(JSC::Wasm::ModuleParser::parseGlobal):
(JSC::Wasm::ModuleParser::parseExport):
(JSC::Wasm::ModuleParser::parseElement):
(JSC::Wasm::ModuleParser::parseInitExpr):
(JSC::Wasm::ModuleParser::parseGlobalType):
(JSC::Wasm::ModuleParser::parseData):
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseVarInt32):
(JSC::Wasm::Parser::parseVarInt64):
(JSC::Wasm::Parser::parseUInt64):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::hasMemory):
(JSC::Wasm::Validate::Validate):
(JSC::Wasm::Validate::getGlobal):
(JSC::Wasm::Validate::setGlobal):
(JSC::Wasm::validateFunction):
* wasm/generateWasmOpsHeader.py:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::loadI32Global):
(JSC::JSWebAssemblyInstance::loadI64Global):
(JSC::JSWebAssemblyInstance::loadF32Global):
(JSC::JSWebAssemblyInstance::loadF64Global):
(JSC::JSWebAssemblyInstance::setGlobal):
(JSC::JSWebAssemblyInstance::offsetOfGlobals):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::link):

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

2 years ago[iOS] MediaDocuments have controls on the bottom of the page
dino@apple.com [Wed, 14 Dec 2016 21:14:25 +0000 (21:14 +0000)]
[iOS] MediaDocuments have controls on the bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=165865
<rdar://problem/28757268>

Reviewed by Jon Lee.

MediaDocuments on iOS are incorrectly placing the controls at
the bottom of the page. This is due to the <video> element
getting a height of 100%. It should be "auto" instead.

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

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

2 years agoUnreviewed, re-enable concurrent GC on ARM64 now that the most likely culprit of...
fpizlo@apple.com [Wed, 14 Dec 2016 21:05:56 +0000 (21:05 +0000)]
Unreviewed, re-enable concurrent GC on ARM64 now that the most likely culprit of the memory
regressions is fixed. Lets see what the bots think!

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

2 years ago[CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
hyatt@apple.com [Wed, 14 Dec 2016 21:02:07 +0000 (21:02 +0000)]
[CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
https://bugs.webkit.org/show_bug.cgi?id=165743

Reviewed by Dean Jackson.

Source/WebCore:

Added new tests in fast/css/deferred-parsing.

This patch implements deferred parsing in CSS. By default, when parsing
author stylesheets, the parser goes into a deferred mode where it leaves
the declaration block of all style rules unparsed initially. Instead of
creating and setting an ImmutableStyleProperties object on the StyleRule,
the parser creates a DeferredStyleProperties object instead that is
capable of calling into CSSDeferredParser to parse the properties and values
only when the properties are finally asked for.

In addition, this patch defers the parsing of the interior of @media,
@supports, and @keyframes rules. @media blocks that are never matched will
never parse any of the rules inside. @supports conditions for unsupported
features will also not be parsed. For @keyframes, if the animation is never
referenced/used, then the @keyframes child rules will never be parsed.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSDeferredParser to the build.

* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.

* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
(WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleKeyframes::keyframes):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
* css/CSSKeyframesRule.h:
Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
object. The keyframes vector won't be populated until it is needed, and the
population is done by DeferredStyleGroupRuleList, which holds both the original
tokens of the keyframes rule interior, and a references to the
CSSDeferredParser that will do the parsing.

* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
ElementRuleCollector tests to see if a rule is empty by counting properties(),
but we don't want to initiate deferred parsing just to check this. Instead we
invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
the properties haven't been parsed yet. In order to ensure this optimization
continues to work, any rules whose interiors consist of only whitespace do
not get deferred.

* css/FontFace.cpp:
(WebCore::FontFace::setVariant):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.

* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::MutableStyleProperties::setProperty):
(WebCore::DeferredStyleProperties::create):
(WebCore::DeferredStyleProperties::DeferredStyleProperties):
(WebCore::DeferredStyleProperties::~DeferredStyleProperties):
(WebCore::DeferredStyleProperties::parseDeferredProperties):
* css/StyleProperties.h:
(WebCore::StylePropertiesBase::type):
(WebCore::StylePropertiesBase::cssParserMode):
(WebCore::StylePropertiesBase::StylePropertiesBase):
(WebCore::StyleProperties::isMutable):
(WebCore::StyleProperties::StyleProperties):
(WebCore::StylePropertiesBase::deref):
(isType):
(WebCore::StyleProperties::cssParserMode): Deleted.
(WebCore::StyleProperties::deref): Deleted.
Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
is created by the parser when not deferring), and MutableStyleProperties (used
when making changes and doing DOM Manipulations).

This patch adds a new base class called StylePropertiesBase, and StyleProperties
now derives from it. DeferredStyleProperties derives from this base. The members
of StyleProperties have been moved up into StylePropertiesBase.

The m_isMutable bit, used to determine the type for downcasting has been enhanced
to m_type (2 bits), since there are now three possible subclasses.

* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::properties):
(WebCore::StyleRule::mutableProperties):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
Patched to ensure that when properties() are accessed, that if the current
stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
rule. By using a common base class, we avoid increasing memory usage in
StyleRule.

(WebCore::DeferredStyleGroupRuleList::create):
(WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
(WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
(WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
DeferredStyleGroupList is used to handle deferred parsing of objects with
child rules. These include @media, @supports and @keyframes.

(WebCore::StyleRuleGroup::StyleRuleGroup):
(WebCore::StyleRuleGroup::childRules):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleMedia::StyleRuleMedia):
(WebCore::StyleRuleSupports::StyleRuleSupports):
StyleRuleGroup now holds both a child rules Vector and a
DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
when the childRules are finally accessed, we will populate the childRules
Vector and then null out the DeferredStyleGroupRuleList.

* css/StyleRule.h:
(WebCore::StyleRule::propertiesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRules): Deleted.
Add new accesors for fetching properties and child rules without causing
deferred parsing to happen.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
Patched to turn on deferred parsing for author sheets and for all
non-UA stylesheets parsed from a string (e.g., <style>).

(WebCore::traverseSubresourcesInRules):
The broken resource check was aggressively accessing properties(). Patch
it to call propertiesWithoutDeferredParsing() instead so that it doesn't
defeat the new optimization.

* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.

* css/parser/CSSDeferredParser.cpp: Added.
(WebCore::CSSDeferredParser::CSSDeferredParser):
(WebCore::CSSDeferredParser::parseDeclaration):
(WebCore::CSSDeferredParser::parseRuleList):
(WebCore::CSSDeferredParser::parseKeyframeList):
* css/parser/CSSDeferredParser.h: Added.
(WebCore::CSSDeferredParser::create):
(WebCore::CSSDeferredParser::tokenizer):
(WebCore::CSSDeferredParser::mode):
(WebCore::CSSDeferredParser::context):
(WebCore::CSSDeferredParser::styleSheet):
The CSSDeferredParser. It caches the original tokenizer's' escaped strings. Because
the CSSDeferredParser is referenced by all the rules that have yet to parse,
it will stay alive until all rules in the stylesheet has been fully parsed.

The parser receives CSSParserTokenRanges from DeferredStyleProperties or
DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
is able to do the parsing as it would have occurred originally had the
range not been deferred.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParserFastPaths::maybeParseValue):
* css/parser/CSSParserFastPaths.h:
Drop the StyleSheetContents* argument from the methods that no longer need
them.

* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
(WebCore::CSSParserImpl::tokenizer):
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::parseCustomPropertyValue):
(WebCore::CSSParserImpl::parseDeclarationList):
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
(WebCore::CSSParserImpl::parseRule):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::parseDeclarationListForInspector):
(WebCore::CSSParserImpl::parseStyleSheetForInspector):
(WebCore::CSSParserImpl::consumeQualifiedRule):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeStyleRule):
Drop the StyleSheetContents* argument from the methods that no longer need
them.

(WebCore::CSSParserImpl::createDeferredStyleProperties):
(WebCore::CSSParserImpl::parseDeferredDeclaration):
(WebCore::CSSParserImpl::parseDeferredRuleList):
(WebCore::CSSParserImpl::parseDeferredKeyframeList):
The methods that handle deferred parsing. They make sure to initialize
new CSSParserImpls with the original deferred parser, and then call existing
methods to do the parsing.

* css/parser/CSSParserImpl.h:
Patched to remove StyleSheetContents* arguments from some methods and
to add the new deferred parsing methods.

* css/parser/CSSParserTokenRange.cpp:
(WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
* css/parser/CSSParserTokenRange.h:
In order to preserve the editability optimization from r180867, when
a style rule's block is consumed, we use a special method that looks
for -webkit-user-modify tokens. If one is seen, then the editability
optimization is turned off. Because we do this at the token level,
the optimization keeps working even if properties don't get parsed.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::parseShorthand):
Patched to remove StyleSheetContents* arguments now that the editability
check is in CSSTokenizer instead.

* css/parser/CSSTokenizer.cpp:
(WebCore::CSSTokenizer::tokenRange):
* css/parser/CSSTokenizer.h:
Make tokenRange() const.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
Patched to drop the StyleSheetContents* argument.

* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList):
(WebCore::Internals::deferredStyleRulesCount):
(WebCore::deferredGroupRulesCountForList):
(WebCore::Internals::deferredGroupRulesCount):
(WebCore::deferredKeyframesRulesCountForList):
(WebCore::Internals::deferredKeyframesRulesCount):
* testing/Internals.h:
* testing/Internals.idl:
Add new testing methods that can count the deferred style rules and
group child rule lists. These methods are used by the new layout tests.

Source/WebKit2:

Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name
from "new" to "deferred."

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDeferredCSSParserEnabled):
(WKPreferencesGetDeferredCSSParserEnabled):
(WKPreferencesSetNewCSSParserEnabled): Deleted.
(WKPreferencesGetNewCSSParserEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

* fast/css/deferred-parsing: Added.
* fast/css/deferred-parsing/dynamic-external-style-expected.txt: Added.
* fast/css/deferred-parsing/dynamic-external-style.html: Added.
* fast/css/deferred-parsing/dynamic-style-in-document-expected.txt: Added.
* fast/css/deferred-parsing/dynamic-style-in-document.html: Added.
* fast/css/deferred-parsing/hover-test-expected.txt: Added.
* fast/css/deferred-parsing/hover-test.html: Added.
* fast/css/deferred-parsing/keyframes-rule-expected.txt: Added.
* fast/css/deferred-parsing/keyframes-rule.html: Added.
* fast/css/deferred-parsing/media-print-expected.txt: Added.
* fast/css/deferred-parsing/media-print.html: Added.
* fast/css/deferred-parsing/nth-of-type-expected.txt: Added.
* fast/css/deferred-parsing/nth-of-type.html: Added.
* fast/css/deferred-parsing/resources: Added.
* fast/css/deferred-parsing/resources/basic-sheet.css: Added.
* fast/css/deferred-parsing/simple-external-style-expected.txt: Added.
* fast/css/deferred-parsing/simple-external-style.html: Added.
* fast/css/deferred-parsing/simple-style-in-document-expected.txt: Added.
* fast/css/deferred-parsing/simple-style-in-document.html: Added.
* fast/css/deferred-parsing/supports-rule-expected.txt: Added.
* fast/css/deferred-parsing/supports-rule.html: Added.

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

2 years agoDevices with fewer cores should use a more aggressive GC schedule by default
fpizlo@apple.com [Wed, 14 Dec 2016 20:57:20 +0000 (20:57 +0000)]
Devices with fewer cores should use a more aggressive GC schedule by default
https://bugs.webkit.org/show_bug.cgi?id=165859

Reviewed by Mark Lam.

* heap/Heap.cpp:
(JSC::Heap::markToFixpoint): Log when we have an unexpected delay in wake-up.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::drainInParallelPassively): Don't drain passively if there aren't many cores.
* runtime/Options.cpp:
(JSC::overrideDefaults): Change the heuristics if we have fewer cores.
(JSC::Options::initialize):
* runtime/Options.h:

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

2 years agoIndexedDB 2.0: Massively speedup IDBIndex.get().
beidson@apple.com [Wed, 14 Dec 2016 20:56:50 +0000 (20:56 +0000)]
IndexedDB 2.0: Massively speedup IDBIndex.get().
https://bugs.webkit.org/show_bug.cgi?id=165802

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No behavior change to Javascript, table upgrade change covered by API test).

This change upgrades the IndexRecords schema to include the ObjectStore record ID for the referenced record.
It also adds a SQLite Index-by-key on IndexRecords.

This speeds up PerformanceTests/IndexedDB/index-get.html by 15-20x.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::v3IndexRecordsTableSchema):
(WebCore::IDBServer::v3IndexRecordsTableSchemaAlternate):
(WebCore::IDBServer::v1IndexRecordsIndexSchema):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IDBIndexUpgradeToV2.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IDBIndexUpgradeToV2.mm: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexUpgrade.blob: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexUpgrade.sqlite3: Added.

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

2 years agoActually set the shipping contact when validating the payment request
weinig@apple.com [Wed, 14 Dec 2016 20:42:52 +0000 (20:42 +0000)]
Actually set the shipping contact when validating the payment request

Reviewed by Anders Carlsson.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
Fix typo.

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

2 years agoHandle key generation with empty challenge string
wilander@apple.com [Wed, 14 Dec 2016 20:30:51 +0000 (20:30 +0000)]
Handle key generation with empty challenge string
https://bugs.webkit.org/show_bug.cgi?id=165835
<rdar://problem/29128710>

Reviewed by Anders Carlsson.

https://bugs.webkit.org/show_bug.cgi?id=160945 didn't set the challenge length to
1 for empty challenge strings. Thus the null terminator was not included. Empty
challenge strings are allowed:
"If the element has a challenge attribute, then let challenge be that attribute's
value. Otherwise, let challenge be the empty string."
https://www.w3.org/TR/html5/forms.html#the-keygen-element (fetched 2016-12-13)

Email certificate generation at
https://www.comodo.com/home/email-security/free-email-certificate.php broke
because of https://bugs.webkit.org/show_bug.cgi?id=160945.

No new tests. The original patch did not have tests and the breakage was in the
produced key material so a test would have to validate the crypto output.

* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
    Now adds 1 to the length of the challenge to account for its null terminator.
    This matches the old behavior.

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

2 years agoCSP: Allow HTTPS URL to match HTTP source expression
dbates@webkit.org [Wed, 14 Dec 2016 20:17:28 +0000 (20:17 +0000)]
CSP: Allow HTTPS URL to match HTTP source expression
https://bugs.webkit.org/show_bug.cgi?id=159520
<rdar://problem/27287177>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html

* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::schemeMatches):
(WebCore::ContentSecurityPolicySource::portMatches):

LayoutTests:

* http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html: Added.
* platform/wk2/TestExpectations: Skip the test on WebKit2 because it makes use of Internals.registerDefaultPortForProtocol(),
which does not work with NetworkProcess.

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

2 years agoBytecodeBasicBlock::computeImpl() should not keep iterating blocks if all jump target...
mark.lam@apple.com [Wed, 14 Dec 2016 19:58:27 +0000 (19:58 +0000)]
BytecodeBasicBlock::computeImpl() should not keep iterating blocks if all jump targets have already been found.
https://bugs.webkit.org/show_bug.cgi?id=165820

Reviewed by Saam Barati.

Currently, if an opcode is a branch type opcode, BytecodeBasicBlock::computeImpl()
will iterate over all basic blocks looking for the block containing the jump
target, and it will continue to do this even when all the jump targets have been
found.  This is wasted work, and all the more so given that most branch type
opcodes only have a single jump target.

* bytecode/BytecodeBasicBlock.cpp:
(JSC::BytecodeBasicBlock::computeImpl):

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

2 years agoREGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network...
achristensen@apple.com [Wed, 14 Dec 2016 19:53:00 +0000 (19:53 +0000)]
REGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=165836

Reviewed by Brady Eidson.

* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
Use the platform default timeout for CORS preflight requests.

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

2 years agoAdd mac-elcapitan baseline for js/dom/global-constructors-attributes.html.
ryanhaddad@apple.com [Wed, 14 Dec 2016 19:27:14 +0000 (19:27 +0000)]
Add mac-elcapitan baseline for js/dom/global-constructors-attributes.html.

Unreviewed test gardening.

* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: Added.

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

2 years agoWebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoin...
antti@apple.com [Wed, 14 Dec 2016 18:54:28 +0000 (18:54 +0000)]
WebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoingReferrer const
https://bugs.webkit.org/show_bug.cgi?id=165852
<rdar://problem/27297153>

Reviewed by Chris Dumez.

There appears to be some path where we get here with a null frame.
No test, don't know how exactly this happens.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::outgoingReferrer):

    Null check the frame.

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

2 years agoVersioning.
bshafiei@apple.com [Wed, 14 Dec 2016 18:44:13 +0000 (18:44 +0000)]
Versioning.

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

2 years agoUnreviewed test fix after r209806.
bfulgham@apple.com [Wed, 14 Dec 2016 18:27:30 +0000 (18:27 +0000)]
Unreviewed test fix after r209806.

Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct
function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we
do not generate paths like '/home/username/Library/Library/Keychains'.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

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

2 years agoSource/JavaScriptCore:
barraclough@apple.com [Wed, 14 Dec 2016 18:07:22 +0000 (18:07 +0000)]
Source/JavaScriptCore:
MarkedBlock::marksConveyLivenessDuringMarking should take into account collection scope
https://bugs.webkit.org/show_bug.cgi?id=165741

Unreviewed, re-landing this with fix (revert erroneous change to Options).

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/CellContainer.cpp: Added.
(JSC::CellContainer::isNewlyAllocated):
* heap/CellContainer.h:
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::addBlock):
(JSC::MarkedAllocator::removeBlock):
(JSC::MarkedAllocator::dumpBits):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::forEachBitVector):
(JSC::MarkedAllocator::forEachBitVectorWithName):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::tryCreate):
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::sweepHelperSelectMarksMode):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::Handle::didConsumeFreeList):
(JSC::MarkedBlock::Handle::dumpState):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::markingVersion):
(JSC::MarkedBlock::isMarkedRaw):
(JSC::MarkedBlock::isMarked):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::marksConveyLivenessDuringMarking):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/StructureIDTable.h:
(JSC::StructureIDTable::size):
(JSC::StructureIDTable::get):

Source/WTF:
Unreviewed, rolling out r209795.
https://bugs.webkit.org/show_bug.cgi?id=165853

rolled out the wrong revision (Requested by pizlo on #webkit).

Reverted changeset:

"MarkedBlock::marksConveyLivenessDuringMarking should take
into account collection scope"
https://bugs.webkit.org/show_bug.cgi?id=165741
http://trac.webkit.org/changeset/209795

Patch by Commit Queue <commit-queue@webkit.org> on 2016-12-14

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

2 years agoUnreviewed, rolling out r209766.
cdumez@apple.com [Wed, 14 Dec 2016 17:50:20 +0000 (17:50 +0000)]
Unreviewed, rolling out r209766.

Regressed Dromaeo JSLib by ~50%

Reverted changeset:

"Make opaque root scanning truly constraint-based"
https://bugs.webkit.org/show_bug.cgi?id=165760
http://trac.webkit.org/changeset/209766

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

2 years agoEventDispatcher::dispatchEvent() should take its Node by reference
aestes@apple.com [Wed, 14 Dec 2016 17:41:28 +0000 (17:41 +0000)]
EventDispatcher::dispatchEvent() should take its Node by reference
https://bugs.webkit.org/show_bug.cgi?id=165840

Reviewed by Andreas Kling.

No new tests. No change in behavior.

* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Element::dispatchKeyEvent): Ditto.
(WebCore::Element::dispatchFocusEvent): Ditto.
(WebCore::Element::dispatchBlurEvent): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
style.
* dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
* dom/Node.cpp:
(WebCore::Node::dispatchEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Node::dispatchTouchEvent): Ditto.
(WebCore::Node::dispatchUIRequestEvent): Ditto.
* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
EventDispatcher::dispatchEvent().
* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent): Passed |element| as a reference to
EventDispatcher::dispatchEvent().

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

2 years agoRemove Unicode case-insensitive matching for usemap=""
cdumez@apple.com [Wed, 14 Dec 2016 17:37:24 +0000 (17:37 +0000)]
Remove Unicode case-insensitive matching for usemap=""
https://bugs.webkit.org/show_bug.cgi?id=163894

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt:

Source/WebCore:

Remove Unicode case-insensitive matching for usemap="" as this no longer
matches the specification [1] or Firefox. Also align our parsing logic for
the usemap attribute to match the specification [2].

This simplifies the code a bit, is more efficient and the compatibility
risk should be low based on Firefox's behavior and Chome's usage data.

[1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
[2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference

Test: fast/images/image-usemap-parsing.html

* dom/Document.cpp:
(WebCore::Document::addImageElementByUsemap):
(WebCore::Document::removeImageElementByUsemap):
(WebCore::Document::imageElementByUsemap):
* dom/Document.h:
* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::getElementByUsemap):
* dom/DocumentOrderedMap.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::getImageMap):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedInto):
(WebCore::HTMLImageElement::removedFrom):
(WebCore::HTMLImageElement::matchesUsemap):
* html/HTMLImageElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
(WebCore::HTMLMapElement::parseAttribute):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLHashNameReference):
* html/parser/HTMLParserIdioms.h:

LayoutTests:

* fast/images/image-map-multiple.html:
Fix case of the usemap.

* fast/images/image-usemap-parsing-expected.txt: Added.
* fast/images/image-usemap-parsing.html: Added.
Add layout test coverage.

* fast/images/imagemap-case.html: Removed.
* platform/efl/fast/images/imagemap-case-expected.png: Removed.
* platform/efl/fast/images/imagemap-case-expected.txt: Removed.
* platform/gtk/fast/images/imagemap-case-expected.png: Removed.
* platform/gtk/fast/images/imagemap-case-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/images/imagemap-case-expected.txt: Removed.
* platform/ios-simulator/fast/images/imagemap-case-expected.txt: Removed.
* platform/mac/fast/images/imagemap-case-expected.png: Removed.
* platform/mac/fast/images/imagemap-case-expected.txt: Removed.
* platform/win/fast/images/imagemap-case-expected.txt: Removed.
Drop outdated pixel test case. Case sensitivity is now covered by
the new fast/images/image-usemap-parsing.html test.

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

2 years agoAttempt to fix the Windows build after r209805.
ryanhaddad@apple.com [Wed, 14 Dec 2016 17:28:16 +0000 (17:28 +0000)]
Attempt to fix the Windows build after r209805.

Unreviewed build fix.

* css/CSSAllInOne.cpp:

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

2 years agoUnreviewed, rolling out r209795.
commit-queue@webkit.org [Wed, 14 Dec 2016 17:25:19 +0000 (17:25 +0000)]
Unreviewed, rolling out r209795.
https://bugs.webkit.org/show_bug.cgi?id=165853

rolled out the wrong revision (Requested by pizlo on #webkit).

Reverted changeset:

"MarkedBlock::marksConveyLivenessDuringMarking should take
into account collection scope"
https://bugs.webkit.org/show_bug.cgi?id=165741
http://trac.webkit.org/changeset/209795

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

2 years agoUnreviewed, disable concurrent GC on ARM while we investigate a memory use regression.
fpizlo@apple.com [Wed, 14 Dec 2016 17:19:33 +0000 (17:19 +0000)]
Unreviewed, disable concurrent GC on ARM while we investigate a memory use regression.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

2 years agoUnreviewed test fix after r209779.
bfulgham@apple.com [Wed, 14 Dec 2016 17:17:41 +0000 (17:17 +0000)]
Unreviewed test fix after r209779.

The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the
WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

2 years ago[CSS Parser] Remove WebkitCSSTransformValue
hyatt@apple.com [Wed, 14 Dec 2016 16:34:48 +0000 (16:34 +0000)]
[CSS Parser] Remove WebkitCSSTransformValue
https://bugs.webkit.org/show_bug.cgi?id=165844

Reviewed by Zalan Bujtas.

Source/WebCore:

Remove WebkitCSSTransformValue and just use a CSSFunctionValue instead. No other
browsers support it, and the information it provides is easily obtainable from cssText.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::matrixTransformValue):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isSpringTimingFunctionValue):
(WebCore::CSSValue::isWebKitCSSTransformValue): Deleted.
* css/StyleResolver.cpp:
* css/TransformFunctions.cpp:
(WebCore::transformOperationType):
(WebCore::transformsForValue):
* css/TransformFunctions.h:
* css/WebKitCSSTransformValue.cpp: Removed.
* css/WebKitCSSTransformValue.h: Removed.
* css/WebKitCSSTransformValue.idl: Removed.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
(WebCore::parseSimpleTransformValue):
(WebCore::parseSimpleTransformList):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::consumeTransformValue):
(WebCore::transformOperationForCSSValueID): Deleted.

LayoutTests:

* fast/css/getFloatValueForUnit-expected.txt:
* fast/css/getFloatValueForUnit.html:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
* platform/mac/fast/dom/wrapper-classes-objc.html:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* transforms/2d/transform-value-types-expected.txt:
* transforms/2d/transform-value-types.html:

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

2 years ago[GTK][EFL] Update the JHBuild version.
clopez@igalia.com [Wed, 14 Dec 2016 16:19:05 +0000 (16:19 +0000)]
[GTK][EFL] Update the JHBuild version.
https://bugs.webkit.org/show_bug.cgi?id=165838

Reviewed by Michael Catanzaro.

* jhbuild/jhbuild-wrapper: This new version fixes a bug with the
usage of the JHBUILD_MIRROR feature with git repositories.

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

2 years agoUnreviewed, LayoutTest http/tests/misc/module-script-async.html is a flaky timeout
utatane.tea@gmail.com [Wed, 14 Dec 2016 16:16:39 +0000 (16:16 +0000)]
Unreviewed, LayoutTest http/tests/misc/module-script-async.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=165764

Annotate it as Slow.

* TestExpectations:

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

2 years agoMake Style::Update const in RenderTreeUpdater
antti@apple.com [Wed, 14 Dec 2016 16:06:50 +0000 (16:06 +0000)]
Make Style::Update const in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=165845

Reviewed by Andreas Kling.

Moving style away from unique_ptrs leaves them in weird state.

* style/RenderTreeUpdater.cpp:
(WebCore::findRenderingRoots):
(WebCore::RenderTreeUpdater::commit):
(WebCore::RenderTreeUpdater::updateElementRenderer):

    Clone the style instead of moving it. This is not meaningfully more expensive.
    Remove null checks, style is never null.

* style/RenderTreeUpdater.h:

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

2 years agoUse JSValue::toWTFString instead of calling toString(exec) and value(exec)
utatane.tea@gmail.com [Wed, 14 Dec 2016 16:04:30 +0000 (16:04 +0000)]
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795

Reviewed by Saam Barati.

Source/JavaScriptCore:

In old days, we frequently use the idiom like, `value.toString(exec)->value(exec)` to
get WTFString from the given JSValue. But now, we have better function, `toWTFString`.
`toWTFString` does not create intermediate JSString objects, then reduce unnecessary
allocations.

This patch mechanically replaces `value.toString(exec)->value(exec)` with `toWTFString(exec)`.

* API/JSValueRef.cpp:
(JSValueToStringCopy):
* bindings/ScriptValue.cpp:
(Deprecated::ScriptValue::toString):
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
* runtime/ConsoleObject.cpp:
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::valueOrDefaultLabelString):
* runtime/DateConstructor.cpp:
(JSC::dateParse):
* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/InspectorInstrumentationObject.cpp:
(JSC::inspectorInstrumentationObjectLog):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::fetch):
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
* runtime/RegExpConstructor.cpp:
(JSC::regExpCreate):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::replaceUsingStringSearch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::stringProtoFuncNormalize):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):
* wasm/js/JSWebAssemblyCompileError.h:
(JSC::JSWebAssemblyCompileError::create):
* wasm/js/JSWebAssemblyRuntimeError.h:
(JSC::JSWebAssemblyRuntimeError::create):

Source/WebCore:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::namedItem):
* bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
(WebCore::JSHTMLFormControlsCollection::namedItem):
* bindings/js/JSHTMLInputElementCustom.cpp:
(WebCore::JSHTMLInputElement::setSelectionDirection):
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::setParameter):
(WebCore::JSXSLTProcessor::getParameter):
(WebCore::JSXSLTProcessor::removeParameter):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/testbindings.cpp:
(main):

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):

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

2 years ago[EFL] Fix debug build break since r207192. Unreviewed.
jh718.park@samsung.com [Wed, 14 Dec 2016 15:31:36 +0000 (15:31 +0000)]
[EFL] Fix debug build break since r207192. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165847

No new tests, no new behaviours.

In JSDOMBinding.h, JSClass::info() returns each js class's
"static const JSC::ClassInfo s_info"'s address.
It's static variable's address, so always non-null.

* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseOperation):
(WebCore::BindingCaller::callOperation):
(WebCore::BindingCaller::setAttribute):
(WebCore::BindingCaller::attribute):

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

2 years ago[GTK] Yasm is needed for building the JHBuild after r208940
clopez@igalia.com [Wed, 14 Dec 2016 13:41:31 +0000 (13:41 +0000)]
[GTK] Yasm is needed for building the JHBuild after r208940
https://bugs.webkit.org/show_bug.cgi?id=165837

Reviewed by Alejandro G. Castro.

* gtk/install-dependencies: Yasm is needed for building libvpx.

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

2 years agoTest infrastructure should allow to filter out text output before doing a comparison...
commit-queue@webkit.org [Wed, 14 Dec 2016 12:22:47 +0000 (12:22 +0000)]
Test infrastructure should allow to filter out text output before doing a comparison with the baseline
https://bugs.webkit.org/show_bug.cgi?id=161310

Patch by Youenn Fablet <youenn@apple.com> on 2016-12-14
Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-preflight.html: Adding a console log line to ensure the DumpJSConsoleLogInStdErr modifier works.

Tools:

Adding --dump-jsconsolelog-in-stderr test option for DRT and WTR.
When set, WTR and DRT output JS console log in the stderr and not the test output.
This allows removing potentially flaky information while still being able to read it for investigation.

Updated webkitpy infrastructure to use this test option in case of DumpJSConsoleLogInStdErr modifier.

Changes are covered by updating a fetch test to output console log and set its option to --dump-jsconsolelog-in-stderr in TestExpectations.
This test should have this option when fetch API will start logging resource loader errors.

* DumpRenderTree/DumpRenderTree.h:
(TestCommand::TestCommand): Deleted.
* DumpRenderTree/DumpRenderTreeCommon.cpp:
(parseInputLine):
* DumpRenderTree/TestRunner.h:
(TestRunner::setDumpJSConsoleLogInStdErr):
(TestRunner::dumpJSConsoleLogInStdErr):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:addMessageToConsole:withSource:]):
* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):
* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::webViewAddMessageToConsole):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser._tokenize_line):
* Scripts/webkitpy/port/driver.py:
(Driver._command_from_driver_input):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::dumpToStdErr):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::dumpJSConsoleLogInStdErr):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willAddMessageToConsole):
* WebKitTestRunner/TestController.cpp:
(WTR::parseInputLine):
(WTR::TestController::runTest):
(WTR::TestCommand::TestCommand): Deleted.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
(WTR::TestInvocation::setDumpJSConsoleLogInStdErr):

LayoutTests:

* TestExpectations: Adding DumpJSConsoleLogInStdErr to the fetch modified test to ensure this modifier works as expected.

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

2 years agoREGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and...
eocanha@igalia.com [Wed, 14 Dec 2016 11:16:23 +0000 (11:16 +0000)]
REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
https://bugs.webkit.org/show_bug.cgi?id=164022

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Covered by existing tests.

* page/Settings.cpp:
Added new setting to disable GStreamer players, so the selection of
MockMediaPlayerMediaSource can be forced for some tests, just like
it's already being done for the AVFoundation player in Mac.
(WebCore::Settings::setGStreamerEnabled):
* page/Settings.h:
(WebCore::Settings::isGStreamerEnabled):
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
Don't register GStreamer players when they're disabled.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
Use doubles instead of floats.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Use doubles instead of floats for m_durationAtEOS.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Don't reset m_sample on videoSink drain, it causes too many problems.
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Removed unused methods.
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
Keep releasing m_sample on drain, but don't report the event
externally via signal anymore. The base player private isn't
listening to it anymore.
(webkitVideoSinkEvent):
(webkit_video_sink_class_init):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
Check if the demuxer caps correspond to a supported codec.
(WebCore::AppendPipeline::didReceiveInitializationSegment):
Empty m_track is now legal and means unsupported codec.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
Warn about more than one stream, but "support" it by ignoring it using
a black hole probe.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
Also report the duration when it's detected for the first time. Invalid
stream types now mean that unsupported codecs have been detected.
Complete init segment processing in that case.
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
Disconnect black hole probe.
(WebCore::appendPipelineDemuxerBlackHolePadProbe): Ignore buffers.
(WebCore::appendPipelineDemuxerPadRemoved): New parameter used.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
Check supported codecs by matching against wildcard expressions.
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
Check for supported codecs.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
New supportsCodecs() method.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
Implemented parser resetting by aborting the AppendPipeline.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
Added resetParserState().
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
Implemented it.
* testing/Internals.cpp:
(WebCore::Internals::initializeMockMediaSource):
Disable the GStreamer players when initializing the mock media source,
like it's already done for the AVFoundation player to force the
selection of MockMediaPlayerMediaSource.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
New GStreamerEnabled preference, defaults to true.
* WebProcess/WebPage/WebPage.cpp: Ditto.
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/glib/GLibUtilities.h:
Added new macros to convert gulong to/from gpointer.

Tools:

* Scripts/webkitperl/FeatureList.pm:
  Re-enable MEDIA_SOURCE for the GTK+ port.

LayoutTests:

* media/media-source/media-source-resize-expected.txt:
Expect the resize event.
* media/media-source/media-source-resize.html:
The test now succeeds no matter if the dimension is reported after
processing the init-segment (GTK+ case) or after the media segment
is processed (Mac case).
* platform/gtk/TestExpectations:
Reenabled all the media/media-source tests except one.
* platform/gtk/media/media-source/media-source-resize-expected.txt:
Copied from LayoutTests/media/media-source/media-source-resize-expected.txt.
The right dimensions are received earlier than in Mac.

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

2 years ago[GStreamer][MSE] Fix player private selection when MSE is enabled
eocanha@igalia.com [Wed, 14 Dec 2016 10:36:32 +0000 (10:36 +0000)]
[GStreamer][MSE] Fix player private selection when MSE is enabled
https://bugs.webkit.org/show_bug.cgi?id=164116

Reviewed by Philippe Normand.

Covered by existing tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):

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

2 years agoMarkedBlock::marksConveyLivenessDuringMarking should take into account collection...
barraclough@apple.com [Wed, 14 Dec 2016 09:35:18 +0000 (09:35 +0000)]
MarkedBlock::marksConveyLivenessDuringMarking should take into account collection scope
https://bugs.webkit.org/show_bug.cgi?id=165741

Unreviewed rollout due to performance regression.

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/CellContainer.cpp: Removed.
* heap/CellContainer.h:
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::addBlock):
(JSC::MarkedAllocator::removeBlock):
(JSC::MarkedAllocator::dumpBits):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::forEachBitVector):
(JSC::MarkedAllocator::forEachBitVectorWithName):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::tryCreate):
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::sweepHelperSelectMarksMode):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::Handle::didConsumeFreeList):
(JSC::MarkedBlock::Handle::dumpState): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::isMarked):
(JSC::MarkedBlock::markingVersion): Deleted.
(JSC::MarkedBlock::isMarkedRaw): Deleted.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::marksConveyLivenessDuringMarking):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/Options.h:
* runtime/StructureIDTable.h:
(JSC::StructureIDTable::get):
(JSC::StructureIDTable::size): Deleted.

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
(WTF::initializeLogFile):
(WTF::dataFile):
* wtf/DataLog.h:
* wtf/LockedPrintStream.cpp: Removed.
* wtf/LockedPrintStream.h: Removed.
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat): Deleted.
(WTF::PrintStream::begin): Deleted.
(WTF::PrintStream::end): Deleted.
* wtf/PrintStream.h:
(WTF::PrintStream::print):
(WTF::PrintStream::println):
(WTF::PrintStream::atomically): Deleted.
(WTF::PrintStream::printImpl): Deleted.
(): Deleted.
(WTF::>::unpack): Deleted.
(WTF::FormatImpl::FormatImpl): Deleted.
(WTF::FormatImpl::dump): Deleted.
(WTF::format): Deleted.
* wtf/RecursiveLockAdapter.h: Removed.
* wtf/WordLock.cpp:
* wtf/WordLock.h:

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

2 years agoSource/WebCore:
barraclough@apple.com [Wed, 14 Dec 2016 08:23:23 +0000 (08:23 +0000)]
Source/WebCore:
Unreviewed, rolling out r209792.
https://bugs.webkit.org/show_bug.cgi?id=165841

Cause build failures (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"Use JSValue::toWTFString instead of calling toString(exec)
and value(exec)"
https://bugs.webkit.org/show_bug.cgi?id=165795
http://trac.webkit.org/changeset/209792

Patch by Commit Queue <commit-queue@webkit.org> on 2016-12-13

LayoutTests:
ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
https://bugs.webkit.org/show_bug.cgi?id=164883

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2016-12-13
Reviewed by Ryosuke Niwa.

* platform/mac-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r209792.
commit-queue@webkit.org [Wed, 14 Dec 2016 07:20:33 +0000 (07:20 +0000)]
Unreviewed, rolling out r209792.
https://bugs.webkit.org/show_bug.cgi?id=165841

Cause build failures (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"Use JSValue::toWTFString instead of calling toString(exec)
and value(exec)"
https://bugs.webkit.org/show_bug.cgi?id=165795
http://trac.webkit.org/changeset/209792

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

2 years agoUse JSValue::toWTFString instead of calling toString(exec) and value(exec)
utatane.tea@gmail.com [Wed, 14 Dec 2016 07:02:45 +0000 (07:02 +0000)]
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795

Reviewed by Saam Barati.

Source/JavaScriptCore:

In old days, we frequently use the idiom like, `value.toString(exec)->value(exec)` to
get WTFString from the given JSValue. But now, we have better function, `toWTFString`.
`toWTFString` does not create intermediate JSString objects, then reduce unnecessary
allocations.

This patch mechanically replaces `value.toString(exec)->value(exec)` with `toWTFString(exec)`.

* API/JSValueRef.cpp:
(JSValueToStringCopy):
* bindings/ScriptValue.cpp:
(Deprecated::ScriptValue::toString):
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
* runtime/ConsoleObject.cpp:
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::valueOrDefaultLabelString):
* runtime/DateConstructor.cpp:
(JSC::dateParse):
* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/InspectorInstrumentationObject.cpp:
(JSC::inspectorInstrumentationObjectLog):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::toWTFStringSlowCase):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::fetch):
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
* runtime/RegExpConstructor.cpp:
(JSC::regExpCreate):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::replaceUsingStringSearch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::stringProtoFuncNormalize):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):
* wasm/js/JSWebAssemblyCompileError.h:
(JSC::JSWebAssemblyCompileError::create):
* wasm/js/JSWebAssemblyRuntimeError.h:
(JSC::JSWebAssemblyRuntimeError::create):

Source/WebCore:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
(WebCore::getNthValueOnKeyPath): Deleted.
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
(WebCore::ensureNthValueOnKeyPath): Deleted.
(WebCore::canInjectNthValueOnKeyPath): Deleted.
(WebCore::injectIDBKeyIntoScriptValue): Deleted.
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
(WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
(WebCore::deserializeIDBValueToJSValue): Deleted.
(WebCore::scriptValueToIDBKey): Deleted.
(WebCore::idbKeyDataToScriptValue): Deleted.
(WebCore::createKeyPathArray): Deleted.
(WebCore::generateIndexKeyForValue): Deleted.
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
(WebCore::JSEventListener::virtualisAttribute): Deleted.
(WebCore::JSEventListener::operator==): Deleted.
(WebCore::eventHandlerAttribute): Deleted.
(WebCore::createEventListenerForEventHandlerAttribute): Deleted.
(WebCore::setEventHandlerAttribute): Deleted.
(WebCore::windowEventHandlerAttribute): Deleted.
(WebCore::setWindowEventHandlerAttribute): Deleted.
(WebCore::documentEventHandlerAttribute): Deleted.
(WebCore::setDocumentEventHandlerAttribute): Deleted.
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::namedItem):
* bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
(WebCore::JSHTMLFormControlsCollection::namedItem):
* bindings/js/JSHTMLInputElementCustom.cpp:
(WebCore::JSHTMLInputElement::setSelectionDirection):
(WebCore::JSHTMLInputElement::setSelectionRange): Deleted.
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
(WebCore::JSInspectorFrontendHost::showContextMenu): Deleted.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
(WebCore::JSXMLHttpRequest::responseText): Deleted.
(WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::setParameter):
(WebCore::JSXSLTProcessor::getParameter):
(WebCore::JSXSLTProcessor::removeParameter):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/testbindings.cpp:
(main):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):

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

2 years agoASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will...
utatane.tea@gmail.com [Wed, 14 Dec 2016 06:22:13 +0000 (06:22 +0000)]
ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
https://bugs.webkit.org/show_bug.cgi?id=164883

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
One possible scenario of this crash is the following.

1. There is pending deferred scripts, that is not fetched yet.
2. Then, we start watching on the script. And stop document parser.
3. The document parser is stopped/detached by calling finishJSTest in beforeload.
4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.

In this patch, we ignore the script execution if the document parser is stopped / detached.
Previously, it goes into the wrong path. And it causes assertion failure.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::notifyFinished):

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

2 years agoMemory warning logging appears to capture resident footprint, missing compress/swap.
dbates@webkit.org [Wed, 14 Dec 2016 06:09:29 +0000 (06:09 +0000)]
Memory warning logging appears to capture resident footprint, missing compress/swap.
https://bugs.webkit.org/show_bug.cgi?id=165533
<rdar://problem/29318410>

Patch by Keith Rollin <krollin@apple.com> on 2016-12-13
Reviewed by Daniel Bates.

Fix GTK build by adding an explicit constructor.

* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::MemoryUsage::MemoryUsage):

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

2 years agoCSP: ws: and wss: blocked with connect-src *
dbates@webkit.org [Wed, 14 Dec 2016 04:18:11 +0000 (04:18 +0000)]
CSP: ws: and wss: blocked with connect-src *
https://bugs.webkit.org/show_bug.cgi?id=165804
<rdar://problem/28563643>

Reviewed by David Kilzer.

Source/WebCore:

Allow * to match ws: and wss:. This will make our behavior of * more closely conform
the behavior of * in the Content Security Policy Level 3 spec.,
<https://w3c.github.io/webappsec-csp/#match-url-to-source-expression> (Editor's Draft, 2 December 2016).

Tests: http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html
       http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html
       http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html
       http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html

* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):

LayoutTests:

Add tests to ensure that * matches ws: and wss:.

* http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html: Added.

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

2 years ago[CSS Parser] Make CSSFunctionValue derive from CSSValueList
hyatt@apple.com [Wed, 14 Dec 2016 03:24:42 +0000 (03:24 +0000)]
[CSS Parser] Make CSSFunctionValue derive from CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=165832

Reviewed by Dean Jackson.

With the old parser gone, we can now shrink CSSFunctionValue a bit by
having it derive from CSSValueList instead of having an extra member
that holds a value list of arguments. This is similar to the trick
already employed by WebkitCSSTransformValue.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize):
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::customCSSText):
(WebCore::CSSFunctionValue::CSSFunctionValue): Deleted.
(WebCore::CSSFunctionValue::equals): Deleted.
(WebCore::CSSFunctionValue::append): Deleted.
* css/CSSFunctionValue.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::createGridTrackSize):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isGridTrackFixedSized):

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

2 years agoMake Document a FrameDestructionObserver
cdumez@apple.com [Wed, 14 Dec 2016 02:39:57 +0000 (02:39 +0000)]
Make Document a FrameDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=165810
<rdar://problem/29157645>

Reviewed by Ryosuke Niwa.

Make Document a FrameDestructionObserver to make sure Document::m_frame
is properly nulled out when a Frame gets destroyed.
Document::disconnectFromFrame() is supposed to be called before the Frame
gets destroyed so this also adds an assertion to try and identify places
where we fail to call it.

No new tests, no known reproduction case.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::disconnectFromFrame):
(WebCore::Document::frameDestroyed):
* dom/Document.h:
(WebCore::Document::frame): Deleted.

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

2 years agoFix CMake build.
achristensen@apple.com [Wed, 14 Dec 2016 02:39:39 +0000 (02:39 +0000)]
Fix CMake build.

Source/WebKit2:

* PlatformMac.cmake:

Tools:

* DumpRenderTree/PlatformMac.cmake:
Define NS_RETURNS_RETAINED as nothing for now.

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

2 years agoWebAssembly: implement the elements section
sbarati@apple.com [Wed, 14 Dec 2016 01:31:43 +0000 (01:31 +0000)]
WebAssembly: implement the elements section
https://bugs.webkit.org/show_bug.cgi?id=165715

Reviewed by Keith Miller.

JSTests:

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
(export.default.Builder.prototype._registerSectionBuilders.switch):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Element):
* wasm/function-tests/basic-element.js: Added.
* wasm/js-api/element.js: Added.
(assertBadBinary):
(assertBadBinary.badInstantiation):

Source/JavaScriptCore:

This is a straight forward implementation of the Element
section in the Wasm spec:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#element-section

There are a few ambiguities I encountered when implementing this, so I've
filed bugs against the Wasm design repo, and corresponding bugzilla bugs
for us to address after they've been discussed by the various Wasm folks:
- https://bugs.webkit.org/show_bug.cgi?id=165827
- https://bugs.webkit.org/show_bug.cgi?id=165826
- https://bugs.webkit.org/show_bug.cgi?id=165825

* wasm/WasmFormat.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseElement):
(JSC::Wasm::ModuleParser::parseInitExpr):
(JSC::Wasm::ModuleParser::parseData):
* wasm/WasmModuleParser.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::evaluate):

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

2 years agoREGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecur...
commit-queue@webkit.org [Wed, 14 Dec 2016 00:20:11 +0000 (00:20 +0000)]
REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
https://bugs.webkit.org/show_bug.cgi?id=165806
<rdar://problem/28169025>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-13
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/inspector/network/loadResource-insecure-resource.html

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
callback, so this didFailLoaderCreation is now redundent and incorrect.

LayoutTests:

* http/tests/inspector/network/loadResource-insecure-resource-expected.txt: Added.
* http/tests/inspector/network/loadResource-insecure-resource.html: Added.
* http/tests/inspector/network/resource-timing.html:
* http/tests/inspector/resources/inspector-test.js:
(runTestHTTPS):

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

2 years ago[CSS Parser] Enhance fast path translate transforms to allow percentages
hyatt@apple.com [Wed, 14 Dec 2016 00:18:17 +0000 (00:18 +0000)]
[CSS Parser] Enhance fast path translate transforms to allow percentages
https://bugs.webkit.org/show_bug.cgi?id=165822

Reviewed by Simon Fraser.

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

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

2 years agoFullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of...
jer.noble@apple.com [Tue, 13 Dec 2016 23:37:15 +0000 (23:37 +0000)]
Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
https://bugs.webkit.org/show_bug.cgi?id=165697

Source/WebKit2:

Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the
WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters
for the two view classes.

Reviewed by Tim Horton.

* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::topContentInset): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::topContentInset):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::dispatchSetTopContentInset):
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController _saveTopContentInset]): Deleted.
(-[WKFullScreenWindowController _restoreTopContentInset]): Deleted.

Tools:

Reviewed by Tim Horton.

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

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

2 years agoRebaseline js/dom/global-constructors-attributes.html after r209777.
ryanhaddad@apple.com [Tue, 13 Dec 2016 23:24:47 +0000 (23:24 +0000)]
Rebaseline js/dom/global-constructors-attributes.html after r209777.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:

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

2 years ago:hover rule causes a single tap to not activate a slotted anchor element
rniwa@webkit.org [Tue, 13 Dec 2016 23:22:03 +0000 (23:22 +0000)]
:hover rule causes a single tap to not activate a slotted anchor element
https://bugs.webkit.org/show_bug.cgi?id=165551

Reviewed by Antti Koivisto.

Source/WebCore:

Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
an anchor element to activate the hyperlink on iOS.

This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.

Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
       fast/shadow-dom/click-text-inside-linked-slot.html

* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
(WebCore::Frame::qualifyingNodeAtViewportLocation):

LayoutTests:

Added a test for tapping on an anchor element assigned to a slot, which has been fixed in r209065.

Also added a new helper JS wrapepr, UIHelper, defined inside LayoutTests/resources/js-helper.js
to provide an abstraction around EventSender and UIScriptController.

Fixed click-text-inside-linked-slot.html on iOS using UIHelper.

* fast/shadow-dom/click-on-slotted-anchor-with-hover-expected.txt: Added.
* fast/shadow-dom/click-on-slotted-anchor-with-hover.html: Added.
* fast/shadow-dom/click-text-inside-linked-slot.html:
* platform/ios-simulator/fast/shadow-dom/click-text-inside-linked-slot-expected.txt: Added.
* resources/ui-helper.js: Added.
(window.UIHelper.isIOS):
(window.UIHelper.activateAt.return.new.Promise):
(window.UIHelper.activateAt):
(window.UIHelper.wait):
(window.UIHelper):
* platform/ios-simulator-wk2/TestExpectations: Skip the test in the open source iOS's WebKit2.

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

2 years ago[Mac][WK2] Tighten Keychain directory access
bfulgham@apple.com [Tue, 13 Dec 2016 22:56:28 +0000 (22:56 +0000)]
[Mac][WK2] Tighten Keychain directory access
https://bugs.webkit.org/show_bug.cgi?id=165818
<rdar://problem/16863857>

Reviewed by Anders Carlsson.

Lock down Keychain directory access to just the file-read-data, file-read-metadata, and
file-write-data operations we actually need.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

2 years agostd::expected: fix rvalue forwarding issues
jfbastien@apple.com [Tue, 13 Dec 2016 22:27:48 +0000 (22:27 +0000)]
std::expected: fix rvalue forwarding issues
https://bugs.webkit.org/show_bug.cgi?id=165812

Reviewed by Mark Lam.

* wtf/Expected.h:
(WTF::UnexpectedType::UnexpectedType):
(WTF::ExpectedDetail::Base::Base):
(WTF::Expected::Expected):

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

2 years ago[CSS Parser] Eliminate SVGPaint and SVGColor
hyatt@apple.com [Tue, 13 Dec 2016 22:15:13 +0000 (22:15 +0000)]
[CSS Parser] Eliminate SVGPaint and SVGColor
https://bugs.webkit.org/show_bug.cgi?id=165819

Reviewed by Dean Jackson.

Source/WebCore:

Remove SVGColor and SVGPaint CSS values from the tree. The new parser
already stopped making these values when parsing, so all that's left
is to make sure computed style doesn't use these values either.

We are the only browser engine to support these CSS values, they see no use
on the Web, and they're already gone at the parsing level, so it's time
to remove these interfaces from our tree.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSComputedStyleDeclaration.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isSubtypeExposedToCSSOM):
(WebCore::CSSValue::isSVGColor): Deleted.
(WebCore::CSSValue::isSVGPaint): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGColor):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::setFillPaint):
(WebCore::SVGRenderStyle::setStrokePaint):
(WebCore::SVGRenderStyle::fillPaintType):
(WebCore::SVGRenderStyle::strokePaintType):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
(WebCore::SVGRenderStyle::hasStroke):
(WebCore::SVGRenderStyle::hasFill):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* svg/SVGAllInOne.cpp:
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::constructFromString):
(WebCore::parseColorFromString):
(WebCore::SVGAnimatedColorAnimator::calculateDistance):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString):
* svg/SVGAnimatedType.h:
* svg/SVGColor.cpp: Removed.
* svg/SVGColor.h: Removed.
* svg/SVGColor.idl: Removed.
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFESpecularLightingElement.cpp:
* svg/SVGPaint.cpp: Removed.
* svg/SVGPaint.h: Removed.
* svg/SVGPaint.idl: Removed.

LayoutTests:

* fast/dom/Window/resources/window-properties.js:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* svg/animations/additive-type-by-animation-expected.txt:
* svg/animations/animate-color-calcMode-discrete-expected.txt:
* svg/animations/animate-color-fill-currentColor-expected.txt:
* svg/animations/animate-color-fill-from-by-expected.txt:
* svg/animations/animate-color-transparent-expected.txt:
* svg/animations/animate-currentColor-expected.txt:
* svg/animations/animate-dynamic-update-attributeName-expected.txt:
* svg/animations/animate-elem-03-t-drt-expected.txt:
* svg/animations/animate-inherit-css-property-expected.txt:
* svg/animations/attributeTypes-expected.txt:
* svg/animations/resources/SVGAnimationTestCase.js:
(expectColor):
* svg/animations/script-tests/animate-color-fill-currentColor.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/animate-color-fill-from-by.js:
(sample1):
(sample2):
(sample3):
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/rect-system-color-expected.txt:
* svg/css/rect-system-color.xhtml:
* svg/custom/global-constructors-expected.txt:
* svg/custom/js-svg-constructors-expected.txt:
* svg/custom/js-svg-constructors.svg:
* svg/custom/script-tests/global-constructors.js:

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

2 years agoRestore NSURLRequest's default time interval to match behavior before NSURLSession...
achristensen@apple.com [Tue, 13 Dec 2016 22:11:19 +0000 (22:11 +0000)]
Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
https://bugs.webkit.org/show_bug.cgi?id=165821
<rdar://problem/28492939>

Reviewed by Brady Eidson.

Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the
default NSURLRequest timeout, which is 60 seconds.  This is not enough for some slow mobile networks,
so we want to match behavior of our CFURLConnection code here.

* platform/network/ResourceRequestBase.cpp:
Use INT_MAX as the default timeout of requests on iOS.

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

2 years ago[Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
aestes@apple.com [Tue, 13 Dec 2016 22:08:49 +0000 (22:08 +0000)]
[Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
https://bugs.webkit.org/show_bug.cgi?id=165785
<rdar://problem/26929398>

Reviewed by Darin Adler.

Source/WebKit2:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined
WKEditorInsertAction and declared
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction.
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented
EditorClient::shouldInsertText() by calling
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with
the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and
initialized it according to whether the delegate responds to shouldInsertText:.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm:
(-[BundleEditingDelegateRemoteObject shouldInsertText:replacingRange:givenAction:]): Added
expectations for the text, range, and action.
(TEST): Set the "EditingDelegateShouldInsertText" bundle parameter to NO so that the plug-in
will return NO in -_webProcessPlugInBrowserContextController:willInsertText:. Added a
plain-text string to the pasteboard, executed a paste action, and verified that the selected
text in the web view did not change.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn webProcessPlugIn:didCreateBrowserContextController:]): Set
_editingDelegateShouldInsertText according to the "EditingDelegateShouldInsertText" bundle
parameter.
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:]):
Added. Called -shouldInsertText:replacingRange:givenAction: on the remote object proxy
and returned the value of _editingDelegateShouldInsertText.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegateProtocol.h: Declared
-shouldInsertText:replacingRange:givenAction:.

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

2 years agoRebaseline js/dom/global-constructors-attributes.html after r209760.
ryanhaddad@apple.com [Tue, 13 Dec 2016 22:05:00 +0000 (22:05 +0000)]
Rebaseline js/dom/global-constructors-attributes.html after r209760.

Unreviewed test gardening.

* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoUnreviewed, rolling out r209544.
cdumez@apple.com [Tue, 13 Dec 2016 20:44:17 +0000 (20:44 +0000)]
Unreviewed, rolling out r209544.

Looks like r209489 did not cause the performance regression
after all

Reverted changeset:

"Unreviewed, rolling out r209489."
https://bugs.webkit.org/show_bug.cgi?id=165550
http://trac.webkit.org/changeset/209544

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

2 years agoAdd a PerfTest targeting IDBObjectStore.get().
beidson@apple.com [Tue, 13 Dec 2016 20:41:42 +0000 (20:41 +0000)]
Add a PerfTest targeting IDBObjectStore.get().
https://bugs.webkit.org/show_bug.cgi?id=165816

Reviewed by Alex Christensen.

* IndexedDB/objectstore-get.html: Added.

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

2 years agoWebAssembly: implement the table section and table import
sbarati@apple.com [Tue, 13 Dec 2016 20:32:40 +0000 (20:32 +0000)]
WebAssembly: implement the table section and table import
https://bugs.webkit.org/show_bug.cgi?id=165716

Reviewed by Keith Miller.

JSTests:

* wasm/Builder.js:
(const._importMemoryContinuation):
(const._importTableContinuation):
(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
(const._importMemoryContinuation.section): Deleted.
(const): Deleted.
(const._importMemoryContinuation.assert): Deleted.
* wasm/Builder_WebAssemblyBinary.js:
(const.putResizableLimits):
(const.putTable):
(const.emitters.Import):
(const.emitters.Table):
* wasm/function-tests/call-indirect-params.js:
* wasm/function-tests/call-indirect.js:
* wasm/function-tests/table-basic-2.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
(func):
* wasm/function-tests/table-basic.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/js-api/call-indirect-results.js:
(const.wasmModuleWhichImportJS): Deleted.
(MonomorphicImport): Deleted.
* wasm/js-api/call-indirect.js:
(const.wasmModuleWhichImportJS):
(const.makeTable):
(Polyphic2Import):
(VirtualImport):
(MonomorphicImport): Deleted.
* wasm/js-api/table.js: Added.
(assertBadBinary):
(assert.truthy):
(assertBadTable):
(assertBadTableImport):
(assertBadBinary.assertBadTableInstance):
(assertBadTableInstance):
(new.WebAssembly.Table):
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):

Source/JavaScriptCore:

This patch implements the Table space for wasm:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#table-section

It only implements defining and importing a table. The bulk
of this patch is implementing the various wasm Table prototype
methods and the underlying Table object:
https://github.com/WebAssembly/design/blob/master/JS.md#webassemblytable-constructor

This patch also fixes a bug in our implementation with call_indirect.
We initially implemented call_indirect as a way to call functions that
are imported or defined in the module. This was the wrong
interpretation of the spec. Instead, call_indirect can only index into
the table index space.

* JavaScriptCore.xcodeproj/project.pbxproj:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmFormat.h:
(JSC::Wasm::TableInformation::TableInformation):
(JSC::Wasm::TableInformation::operator bool):
(JSC::Wasm::TableInformation::isImport):
(JSC::Wasm::TableInformation::initial):
(JSC::Wasm::TableInformation::maximum):
(JSC::Wasm::CallableFunction::CallableFunction):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseImport):
(JSC::Wasm::ModuleParser::parseResizableLimits):
(JSC::Wasm::ModuleParser::parseTableHelper):
(JSC::Wasm::ModuleParser::parseTable):
(JSC::Wasm::ModuleParser::parseMemoryHelper):
(JSC::Wasm::ModuleParser::parseExport):
* wasm/WasmModuleParser.h:
* wasm/js/JSWebAssemblyHelpers.h: Added.
(JSC::toNonWrappingUint32):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::setTable):
(JSC::JSWebAssemblyInstance::offsetOfTable):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::maximum):
(JSC::JSWebAssemblyTable::size):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::offsetOfSize):
(JSC::JSWebAssemblyTable::offsetOfFunctions):
(JSC::JSWebAssemblyTable::isValidSize):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::call):
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::visitChildren):
(JSC::WebAssemblyFunction::finishCreation):
* wasm/js/WebAssemblyFunction.h:
(JSC::WebAssemblyFunction::signature):
(JSC::WebAssemblyFunction::wasmEntrypoint):
(JSC::WebAssemblyFunction::webAssemblyCallee): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::getTable):
(JSC::webAssemblyTableProtoFuncLength):
(JSC::webAssemblyTableProtoFuncGrow):
(JSC::webAssemblyTableProtoFuncGet):
(JSC::webAssemblyTableProtoFuncSet):
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::finishCreation):
* wasm/js/WebAssemblyTablePrototype.h:

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

2 years agoRemove ios-simulator-wk2 pass expectation for a directory that requires touch events.
ryanhaddad@apple.com [Tue, 13 Dec 2016 20:24:11 +0000 (20:24 +0000)]
Remove ios-simulator-wk2 pass expectation for a directory that requires touch events.
https://bugs.webkit.org/show_bug.cgi?id=165787

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoNSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
commit-queue@webkit.org [Tue, 13 Dec 2016 20:23:07 +0000 (20:23 +0000)]
NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
https://bugs.webkit.org/show_bug.cgi?id=165809

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-13
Reviewed by Dan Bernstein.

* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryCopyCGImageArrayForURL):
Avoid an extra retain on already newly created array.

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

2 years agoMarking two scroll-to-fragid tests as flaky on ios-simulator.
ryanhaddad@apple.com [Tue, 13 Dec 2016 20:18:01 +0000 (20:18 +0000)]
Marking two scroll-to-fragid tests as flaky on ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoAdd null checks to opaque root APIs.
fpizlo@apple.com [Tue, 13 Dec 2016 20:14:51 +0000 (20:14 +0000)]
Add null checks to opaque root APIs.

Rubber stamped by Saam Barati.

If we got a crash report about null in the opaque root HashSet, we would probably not
celebrate how great it is that we found out about a new race - instead we would probably
be annoyed that null wasn't just silently ignored.

* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRootTriState):

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

2 years agoMake opaque root scanning truly constraint-based
fpizlo@apple.com [Tue, 13 Dec 2016 19:54:15 +0000 (19:54 +0000)]
Make opaque root scanning truly constraint-based
https://bugs.webkit.org/show_bug.cgi?id=165760

Reviewed by Saam Barati.
Source/JavaScriptCore:

We have bugs when visitChildren() changes its mind about what opaque root to add, since
we don't have barriers on opaque roots. This supposedly once worked for generational GC,
and I started adding more barriers to support concurrent GC. But I think that the real
bug here is that we want the JSObject->OpaqueRoot to be evaluated as a constraint that
participates in the fixpoint. A constraint is different from the normal visiting in that
the GC will not wait for a barrier to rescan the object.

So, it's now possible for any visitChildren() method to become a constraint by calling
slotVisitor.rescanAsConstraint(). Because opaque roots are constraints, addOpaqueRoot()
does rescanAsConstraint() for you.

The constraint set is simply a HashSet<JSCell*> that accumulates with every
rescanAsConstraint() call and is only cleared at the start of full GC. This trivially
resolves most classes of GC bugs that would have arisen from opaque roots being changed
in a way that the GC did not anticipate.

Looks like this is perf-neutral.

* heap/Heap.cpp:
(JSC::Heap::markToFixpoint):
(JSC::Heap::setMutatorShouldBeFenced):
(JSC::Heap::writeBarrierOpaqueRootSlow): Deleted.
(JSC::Heap::addMutatorShouldBeFencedCache): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::writeBarrierOpaqueRoot): Deleted.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::visitWeakSets):
* heap/MarkedSpace.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::visitSubsequently):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::rescanAsConstraint):
(JSC::SlotVisitor::mergeIfNecessary):
(JSC::SlotVisitor::mergeOpaqueRootsAndConstraints):
(JSC::SlotVisitor::mergeOpaqueRootsIfNecessary): Deleted.
* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::reportExternalMemoryVisited):
(JSC::SlotVisitor::didNotRace):
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
(JSC::WeakBlock::visit):
* heap/WeakBlock.h:
* heap/WeakSet.h:
(JSC::WeakSet::visit):

Source/WebCore:

No new tests yet. I think that writing tests for this is a big investigation:
https://bugs.webkit.org/show_bug.cgi?id=165808

Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
very well. It's super confusing.

This change makes it so that visitChildren can become a GC constraint that executes as
part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
roots into constraints.

* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow): Deleted.
* bindings/js/CommonVM.h:
(WebCore::writeBarrierOpaqueRoot): Deleted.
* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitAdditionalChildren):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren):
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitAdditionalChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitAdditionalChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitAdditionalChildren):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCue::visitAdditionalChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitAdditionalChildren):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):

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

2 years agoAdd a PerfTest targeting IDBIndex.get().
beidson@apple.com [Tue, 13 Dec 2016 19:44:06 +0000 (19:44 +0000)]
Add a PerfTest targeting IDBIndex.get().
https://bugs.webkit.org/show_bug.cgi?id=165803

Reviewed by Alex Christensen.

* IndexedDB/index-get.html: Added.

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

2 years agoUnreviewed, rolling out r209725.
commit-queue@webkit.org [Tue, 13 Dec 2016 19:38:13 +0000 (19:38 +0000)]
Unreviewed, rolling out r209725.
https://bugs.webkit.org/show_bug.cgi?id=165811

"Broke ARMv7 builds" (Requested by msaboff on #webkit).

Reverted changeset:

"REGRESSION(r209653): speedometer crashes making virtual slow
path tailcalls"
https://bugs.webkit.org/show_bug.cgi?id=165748
http://trac.webkit.org/changeset/209725

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

2 years agoUnreviewed, revert the collectorPermittedIdleRatio back to 0 because of 100MB
fpizlo@apple.com [Tue, 13 Dec 2016 19:28:19 +0000 (19:28 +0000)]
Unreviewed, revert the collectorPermittedIdleRatio back to 0 because of 100MB
regression on membuster. Also, it didn't seem to help perf.

* runtime/Options.h:

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

2 years agoSkip fast/events/page-visibility-onvisibilitychange.html on ios-simulator.
ryanhaddad@apple.com [Tue, 13 Dec 2016 19:26:43 +0000 (19:26 +0000)]
Skip fast/events/page-visibility-onvisibilitychange.html on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=165799

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years ago[WTF] Turn tryMakeString(), makeString() into variadic templates
jfbastien@apple.com [Tue, 13 Dec 2016 19:15:05 +0000 (19:15 +0000)]
[WTF] Turn tryMakeString(), makeString() into variadic templates
https://bugs.webkit.org/show_bug.cgi?id=147142

Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/JSStringBuilder.h:
(JSC::jsMakeNontrivialString): remove WTF:: prefix, it isn't needed anymore
* runtime/Lookup.cpp:
(JSC::reifyStaticAccessor): remove WTF:: prefix, it isn't needed anymore
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString): remove WTF:: prefix, it isn't needed anymore

Source/WTF:

I wrote this patch while improving WebAssembly's error messages,
and only found this bug afterwards. My implementation does the
bare minimum to make this code variadic without changing
behavior. I think it's better to go with this baby step first, and
improve the code later.

Notable, for my WebAssembly patch I also taught the code to handle
integers and other types (including WebAssembly types). A
follow-up could rely on ADL magic to pretty-format these other
types.

* wtf/text/StringConcatenate.h:
(WTF::sumWithOverflow): This unconditionally does the sum for all
inputs, which the compiler is more likely to appreciate (because
it's the common case) compared to testing for overflow and bailing
on each addition
(WTF::are8Bit): are: the plural of is!
(WTF::makeStringAccumulator): accumulate strings
(WTF::tryMakeStringFromAdapters): a small helper which creates the string adapters
(WTF::tryMakeString): expose out of WTF, since it's part of this file's used API
(WTF::makeString): make it variadic

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

2 years ago[WebIDL] Remove use of Dictionary in ApplePaySession
weinig@apple.com [Tue, 13 Dec 2016 18:47:01 +0000 (18:47 +0000)]
[WebIDL] Remove use of Dictionary in ApplePaySession
https://bugs.webkit.org/show_bug.cgi?id=165787

Reviewed by Anders Carlsson.

Source/WebCore:

First take at generating the bindings for ApplePaySession and removing
all use of Dictionary.

- Removes all use of Dictionary!
- Removes use of logging errors to the console with improved Exception messages.
- Use ExceptionOr extensively to pass exception state.

Still to do:
    - Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
      and all the sub-objects held within.
    - Remove PaymentRequestValidator entirely, merging validation into the validation
      we already do in ApplePaySession.cpp
    - Make ApplePayEvents use generated dictionary creation code.

Test: http/tests/ssl/applepay/ApplePaySession.html

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::canCallApplePaySessionAPIs):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::ApplePaySession):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::begin):
(WebCore::ApplePaySession::completeMerchantValidation):
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::createContactFields): Deleted.
(WebCore::toLineItemType): Deleted.
(WebCore::isValidLineItemPropertyName): Deleted.
(WebCore::createLineItem): Deleted.
(WebCore::createLineItems): Deleted.
(WebCore::createMerchantCapabilities): Deleted.
(WebCore::createSupportedNetworks): Deleted.
(WebCore::toShippingType): Deleted.
(WebCore::isValidShippingMethodPropertyName): Deleted.
(WebCore::createShippingMethod): Deleted.
(WebCore::createShippingMethods): Deleted.
(WebCore::isValidPaymentRequestPropertyName): Deleted.
(WebCore::createPaymentRequest): Deleted.
* Modules/applepay/ApplePaySession.h:
Replace hand written dictionary extraction code with autogenerated code
and hand written additional validation.

* Modules/applepay/ApplePaySession.idl:
Add helper dictionaries and enums.

* Modules/applepay/PaymentRequestValidator.cpp:
(WebCore::PaymentRequestValidator::validate):
(WebCore::PaymentRequestValidator::validateTotal):
(WebCore::validateCountryCode):
(WebCore::validateCurrencyCode):
(WebCore::validateMerchantCapabilities):
(WebCore::validateSupportedNetworks):
(WebCore::validateShippingMethod):
(WebCore::validateShippingMethods):
(WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
(WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
(WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
(WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
* Modules/applepay/PaymentRequestValidator.h:
Instead of reporting the validation errors to the console, pass them in the exception.
This allows us to remove the window member, and move the helpers to the implementation
file as statics.

* WebCore.xcodeproj/project.pbxproj:
Remove file.

* bindings/generic/IDLTypes.h:
(WebCore::IDLObject::nullValue):
(WebCore::IDLObject::isNullValue):
(WebCore::IDLObject::extractValueFromNullable):
Add nullability traits for IDLObject.

* bindings/js/JSApplePaySessionCustom.cpp:
Removed.

Tools:

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):
(WTR::TestController::platformCreateWebView):
Enable ApplePay for the tests (where supported).

LayoutTests:

* http/tests/ssl/applepay: Added.
* http/tests/ssl/applepay/ApplePaySession-expected.txt: Added.
* http/tests/ssl/applepay/ApplePaySession.html: Added.
Add a compressive test of the handling of the payment request to the ApplePaySession
constructor. For further testing, we will need to mock out bits of the underlying
coordinator, but this allows for testing the aspect I am changing. The applepay
directory is in the ssl directory, as all use of ApplePay requires https.

* TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Only enable the tests on iOS 10.10 and greater, and macOS 10.12 and greater, WebKit2.

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

2 years agoCSP: Teach the preload scanner about the 'nonce' attribute
dbates@webkit.org [Tue, 13 Dec 2016 18:21:37 +0000 (18:21 +0000)]
CSP: Teach the preload scanner about the 'nonce' attribute
https://bugs.webkit.org/show_bug.cgi?id=161192
<rdar://problem/28010354>

Reviewed by Darin Adler.

Source/WebCore:

This patch was inspired by a similar Blink change:
<https://chromium.googlesource.com/chromium/src/+/dde5487f380cf774e4c0e96ba7f88ea68e723907>

Preload external scripts and stylesheets whose HTML script and link elements have a nonce
attribute that is listed in the Content Security Policy (CSP) of the page.

Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
So, WebKit does not preload their associated subresources unless the value of the src
attribute or href attribute is whitelisted in the CSP of the page for script and link
elements, respectively. Instead the preload scanner should recognize the nonce attribute on
script and link elements and query the CSP of the page with it. If the nonce attribute is
whitelisted then the request should be preloaded.

Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
       http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
       http/tests/loading/preload-css-with-csp-nonce.html
       http/tests/loading/preload-script-src-with-csp-nonce.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
PreloadRequest to the nonce that we found during the scan.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
save the value of the nonce attribute (if it has one).
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
the CSP of the page.
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::setNonce): Added.

LayoutTests:

Add tests to ensure that we preload <script>s and <link>s whose nonce is allowed by the
Content Security Policy of the page.

* http/tests/loading/do-not-preload-css-blocked-by-csp-expected.txt: Added.
* http/tests/loading/do-not-preload-css-blocked-by-csp.html: Added.
* http/tests/loading/do-not-preload-script-src-blocked-by-csp-expected.txt: Added.
* http/tests/loading/do-not-preload-script-src-blocked-by-csp.html: Added.
* http/tests/loading/preload-css-with-csp-nonce-expected.txt: Added.
* http/tests/loading/preload-css-with-csp-nonce.html: Added.
* http/tests/loading/preload-script-src-with-csp-nonce-expected.txt: Added.
* http/tests/loading/preload-script-src-with-csp-nonce.html: Added.

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

2 years ago[CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
hyatt@apple.com [Tue, 13 Dec 2016 17:39:27 +0000 (17:39 +0000)]
[CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
https://bugs.webkit.org/show_bug.cgi?id=165776

Reviewed by Zalan Bujtas.

* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::hasDoubleValue):
(WebCore::determineCategory):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
* css/CSSCalculationValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::unitCategory):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeLengthDouble):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
(WebCore::CSSPrimitiveValue::getFloatValue):
(WebCore::CSSPrimitiveValue::doubleValue):
(WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
(WebCore::CSSPrimitiveValue::doubleValueInternal):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength):
(WebCore::CSSPrimitiveValue::isLength):
(WebCore::CSSPrimitiveValue::isResolution):
(WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
* css/CSSValue.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createValue):
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createValue):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleLength):
(WebCore::parseSimpleLengthValue):
(WebCore::parseColorIntOrPercentage):
(WebCore::fastParseColorInternal):
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
(WebCore::stringToUnitType):
(WebCore::CSSParserToken::CSSParserToken):
(WebCore::CSSParserToken::convertToPercentage):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::unitType):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::consumeCounter):
(WebCore::consumeAnimationName):
(WebCore::consumePerspective):
(WebCore::consumePositionLonghand):
(WebCore::consumeCounterContent):
(WebCore::consumeReflect):
(WebCore::consumeGridBreadth):
(WebCore::CSSPropertyParser::consumeFlex):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readFeatureValue):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
* css/parser/SizesAttributeParser.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::toCSSPrimitiveValue):

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

2 years agoAnnotate MediaStream and WebRTC idl with EnabledAtRuntime flag
eric.carlson@apple.com [Tue, 13 Dec 2016 16:59:55 +0000 (16:59 +0000)]
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, fixes an API test.

* page/Settings.in: Delete mediaStreamEnabled and peerConnectionEnabled, we don't need a
setting and a runtime feature.

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
feature instead of the setting.

Tools:

* TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp:
(TestWebKitAPI::TEST): Enable MediaStream, create web view from the page group upon which
the preferences have been set.

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

2 years agoSource/WebCore:
antti@apple.com [Tue, 13 Dec 2016 16:08:04 +0000 (16:08 +0000)]
Source/WebCore:
REGRESSION (r198990): Cannot edit content inside <details> in wysiwyg editor
https://bugs.webkit.org/show_bug.cgi?id=165757

Reviewed by Andreas Kling.

Test: fast/html/details-edit.html

-webkit-user-modify is reset on shadow boundary so it doesn't go through <details> shadow tree.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::computeEditability):

    Make -webkit-user-modify (which we would want to get rid of completely eventually) have no effect in shadow trees.
    Check for contenteditable directly instead.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/shadow/TextControlInnerElements.cpp:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::createFlowThreadStyle):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::styleDidChange):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::createAnonymousStyleWithDisplay):
(WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
(WebCore::RenderStyle::inheritFrom):

    Let -webkit-user-modify inherit through shadow boundary as normal.

* rendering/style/RenderStyle.h:

LayoutTests:
REGRESSION (r198990): Safari - Cannot edit content inside <details> in wysiwyg editor
https://bugs.webkit.org/show_bug.cgi?id=165757

Reviewed by Andreas Kling.

* editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt:
* fast/html/details-edit-expected.txt: Added.
* fast/html/details-edit.html: Added.

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

2 years agoUnreviewed, silence -Wsuggest-attribute for GCC with pragmas
annulen@yandex.ru [Tue, 13 Dec 2016 12:49:20 +0000 (12:49 +0000)]
Unreviewed, silence -Wsuggest-attribute for GCC with pragmas

* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):

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

2 years agoUnreviewed test gardening.
pvollan@apple.com [Tue, 13 Dec 2016 12:25:17 +0000 (12:25 +0000)]
Unreviewed test gardening.

Update test expectations on Windows for failing tests. These failures are tracked in
https://bugs.webkit.org/show_bug.cgi?id=160447.

* platform/win/TestExpectations:

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

2 years agoFix GTK build after r209733
svillar@igalia.com [Tue, 13 Dec 2016 10:23:25 +0000 (10:23 +0000)]
Fix GTK build after r209733
https://bugs.webkit.org/show_bug.cgi?id=165794

Document::visibilityState() now returns an IDL string enumeration.

Reviewed by Žan Doberšek.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_get_visibility_state):

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

2 years agoRemove bindings generation support for legacy WebCore::Dictionary
darin@apple.com [Tue, 13 Dec 2016 05:17:28 +0000 (05:17 +0000)]
Remove bindings generation support for legacy WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=165762

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:
Updated to expect error messages with "dictionary" with a lowercase D.

Source/WebCore:

After this patch, all use of legacy WebCore::Dictionary is within custom bindings or
inside the DOM code itself. Bindings generation machinery no longer has a special
type named "Dictionary" but has increasingly good support for IDL-defined dictionaries.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Take ExecState and a JSValue rather than a Dictionary.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
* Modules/applepay/ApplePaySession.h: Updated for the above changes.
* Modules/applepay/ApplePaySession.idl: For this last file using Dictionary in IDL, move
to "[CallWith=ScriptState]" and "any" as a stopgap. Later we can return and use IDL
dictionaries or other more modern solutions.

* Modules/mediastream/MediaDevices.idl: For the custom binding written in JavaScript,
use the type mentioned in the specification rather than Dictionary. The bindings generator
ignores the type, so this is more like changing a comment rather than changing source code.

* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection): Refer to a non-object as not a valid "dictionary", lowercase
rather than "Dictionary".
* Modules/mediastream/RTCPeerConnectionInternals.js:
(callbacksAndDictionaryOverload): Ditto.

* bindings/generic/IDLTypes.h: Removed IDLLegacyDictionary.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::getHashAlgorithm): Fixed a comment.

* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLLegacyDictionary<T>>::convert): Deleted.

* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType): Removed special case for "Dictionary".
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType): Ditto.
(AreTypesDistinguishableForOverloadResolution): Ditto.
(GenerateOverloadedFunctionOrConstructor): Ditto.
(GenerateParametersCheck): Ditto.
(GetBaseIDLType): Ditto.

* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated results.
* bindings/scripts/test/TestObj.idl: Removed test case for Dictionary.

LayoutTests:

* fast/mediastream/RTCPeerConnection-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params.html:
Updated to expect error messages with "dictionary" with a lowercase D.

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

2 years agoDrop unnecessary null check in removeDetachedChildrenInContainer()
cdumez@apple.com [Tue, 13 Dec 2016 02:20:58 +0000 (02:20 +0000)]
Drop unnecessary null check in removeDetachedChildrenInContainer()
https://bugs.webkit.org/show_bug.cgi?id=165778

Reviewed by Alex Christensen.

Drop unnecessary null check in removeDetachedChildrenInContainer().
Node cannot be null but we do an implicit null check.

No new tests, no Web-exposed behavior change.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::removeDetachedChildrenInContainer):

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

2 years agoAdd Document.onvisibilitychange event handler attribute
cdumez@apple.com [Tue, 13 Dec 2016 02:05:42 +0000 (02:05 +0000)]
Add Document.onvisibilitychange event handler attribute
https://bugs.webkit.org/show_bug.cgi?id=165784

Reviewed by Daniel Bates.

Source/WebCore:

Add Document.onvisibilitychange event handler attribute as per Page
Visibility Level 2 API:
- http://w3c.github.io/page-visibility/#onvisiblitychange-event-handler

Test: fast/events/page-visibility-onvisibilitychange.html

* dom/Document.idl:

LayoutTests:

Add layout test coverage.

* fast/events/page-visibility-onvisibilitychange-expected.txt: Added.
* fast/events/page-visibility-onvisibilitychange.html: Added.

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

2 years ago[WebCrypto] Migrate some tests from webkitSubtle to subtle
jiewen_tan@apple.com [Tue, 13 Dec 2016 01:32:56 +0000 (01:32 +0000)]
[WebCrypto] Migrate some tests from webkitSubtle to subtle
https://bugs.webkit.org/show_bug.cgi?id=165554

Reviewed by Brent Fulgham.

To improve test coverage for subtle.

* crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
* crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
* crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
* crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
* crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
* crypto/subtle/resources/rsa-indexeddb.js: Added.
* crypto/subtle/rsa-indexeddb-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
* crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
* crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-private.html: Added.
* crypto/subtle/rsa-indexeddb.html: Added.
* crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
* crypto/subtle/rsa-oaep-plaintext-length.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

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

2 years ago[GTK] Web Inspector: Add NavigationItemCodeCoverage.svg icon
nvasilyev@apple.com [Tue, 13 Dec 2016 01:05:15 +0000 (01:05 +0000)]
[GTK] Web Inspector: Add NavigationItemCodeCoverage.svg icon
https://bugs.webkit.org/show_bug.cgi?id=165698

Reviewed by Joseph Pecoraro.

* UserInterface/Images/gtk/NavigationItemCodeCoverage.svg: Added.
Match in style the existing NavigationItemTypes.svg icon.

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

2 years ago[iOS] MediaDocument "Done" button should navigate the page back
dino@apple.com [Tue, 13 Dec 2016 00:45:37 +0000 (00:45 +0000)]
[iOS] MediaDocument "Done" button should navigate the page back
https://bugs.webkit.org/show_bug.cgi?id=165779

Reviewed by Sam Weinig.

Source/WebCore:

Detect if the exit from fullscreen was caused by the Done button,
and if so, tell the page to navigate back.

Unfortunately this is not yet testable. It's waiting on the
UI-based device testing in development by the media team.

* platform/cocoa/WebVideoFullscreenModel.h: Add a finishedWithMedia parameter to
requestFullscreenMode, to indicate if the change in mode is associated with
the closing of the media document.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::requestFullscreenMode): If we're a media
document, and we say we're finished with the media, tell the document
to navigate back a page.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::requestFullscreenMode):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::requestFullscreenMode):

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

2 years agoRemove unused workaround for Silverlight
commit-queue@webkit.org [Tue, 13 Dec 2016 00:37:40 +0000 (00:37 +0000)]
Remove unused workaround for Silverlight
https://bugs.webkit.org/show_bug.cgi?id=165773

Patch by Alex Christensen <achristensen@webkit.org> on 2016-12-12
Reviewed by Dean Jackson.

* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView _workaroundSilverlightFullscreenBug:]): Deleted.
This code was introduced in January 2010.  Microsoft fixed their bug shortly thereafter.
Allowing 6 years for users to update Silverlight is more than enough.
Safari doesn't even use WebKit1 for this any more.
I need this to be removed because this is the only non-WebGL code that needs to link against
the OpenGL framework, and I'm changing how that is done to link only through ANGLE instead.

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

2 years agoInfinite recursion when viewport is set to the size of the content but the content...
zalan@apple.com [Tue, 13 Dec 2016 00:35:28 +0000 (00:35 +0000)]
Infinite recursion when viewport is set to the size of the content but the content overflows the viewport.
https://bugs.webkit.org/show_bug.cgi?id=165775
rdar://problem/29366628

Reviewed by Simon Fraser.

In certain cases when the viewport is sized to accomodate the content and
the content always overflows the viewport, we might end up in recursive FrameView::layout calls.
This is specific to content with viewport units, because we always invalidate elements with vw/vh units on
viewport size change. However if this viewport size change is in response to content size change (layout),
invalidating elements could trigger synchronous layout, while we are still inside this current layout.
This is very similar to the m_setNeedsLayoutWasDeferred case and they should eventually be merged.
It also means that we might be behind by one layout on elements with vw/vh units (fixed layout only though).

Currently not testable.

* page/FrameView.cpp:
(WebCore::FrameView::availableContentSizeChanged):

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

2 years agoMemory warning logging appears to capture resident footprint, missing compress/swap.
krollin@apple.com [Tue, 13 Dec 2016 00:28:18 +0000 (00:28 +0000)]
Memory warning logging appears to capture resident footprint, missing compress/swap.
https://bugs.webkit.org/show_bug.cgi?id=165533
<rdar://problem/29318410>

Reviewed by Andreas Kling.

Have platformMemoryUsage return both resident and resident + swapped
values. This is now returned as a struct in a std::optional to better
support cases where values cannot or are not returned. Report these
values in logMemoryUsageChange.

Remove most of the ReliefLogger instances and their messages. We no
longer free up fastMalloc memory after each memory-release operation,
so there are no memory regions returned to the OS. Instead, we now
free up fastMalloc memory regions at the end of all memory-releasing
operations in one fell swoop and report a grand total of memory
returned.

No new tests -- no changes to user accessible functionality.

* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):

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

2 years agoMore IndexedDB perf tests.
beidson@apple.com [Tue, 13 Dec 2016 00:12:55 +0000 (00:12 +0000)]
More IndexedDB perf tests.
https://bugs.webkit.org/show_bug.cgi?id=165634

Reviewed by Sam Weinig.

* IndexedDB/index-multientry.html:
* IndexedDB/large-number-of-inserts-responsiveness.html: Added.
* IndexedDB/large-number-of-inserts.html: Added.
* IndexedDB/objectstore-cursor.html: Added. Runtime cut in 1/4th compared to r209672.

* resources/runner.js:

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

2 years agoProvide SPI to avoid blocking on painting when coming into view
timothy_horton@apple.com [Tue, 13 Dec 2016 00:07:11 +0000 (00:07 +0000)]
Provide SPI to avoid blocking on painting when coming into view
https://bugs.webkit.org/show_bug.cgi?id=165780
<rdar://problem/29009559>

Reviewed by Simon Fraser.

By default, when parenting a WKWebView which was previously in-window,
we block on painting to ensure that we don't flash stale content.
We added SPI to disable this behavior to WKWebViewConfiguration, but
some clients might want the behavior most of the time, but sometimes
instead want to not block the UI process main thread, but instead do
their own work (e.g. removing a snapshot) when painting eventually occurs.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Tell WebPageProxy not to block on painting next time we are parented,
and use doAfterNextPresentationUpdate to call the block when the painting
does eventually happen. This SPI must be called before - but in the same
runloop cycle - the WKWebView is brought back in-window to work correctly.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
If we would block because we're coming in-window, but the bit to skip
blocking the next time we get brought in-window is set, reset the bit,
and avoid blocking.

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

2 years agoUnreviewed, follow-up after r209706.
mattbaker@apple.com [Mon, 12 Dec 2016 23:56:41 +0000 (23:56 +0000)]
Unreviewed, follow-up after r209706.

* inspector/debugger/breakpoint-action-log.html:
Add missing test case description.

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

2 years agoWeb Inspector: Add tests for Fetch API Network Data (CORs, Opaque Responses, Filtered...
joepeck@webkit.org [Mon, 12 Dec 2016 23:36:09 +0000 (23:36 +0000)]
Web Inspector: Add tests for Fetch API Network Data (CORs, Opaque Responses, Filtered Headers)
https://bugs.webkit.org/show_bug.cgi?id=165683

Reviewed by Brian Burg.

* http/tests/inspector/network/fetch-network-data-expected.txt: Added.
* http/tests/inspector/network/fetch-network-data.html: Added.
* http/tests/inspector/network/resources/cors-data.pl: Added.
* http/tests/inspector/resources/inspector-test.js:

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

2 years agoDocument.visibilityState should use an IDL string enumeration
cdumez@apple.com [Mon, 12 Dec 2016 23:27:13 +0000 (23:27 +0000)]
Document.visibilityState should use an IDL string enumeration
https://bugs.webkit.org/show_bug.cgi?id=165774

Reviewed by Daniel Bates.

Source/WebCore:

Document.visibilityState should use an IDL string enumeration:
- http://w3c.github.io/page-visibility/#extensions-to-the-document-interface

No new tests, there should be no Web-exposed behavior change.

* CMakeLists.txt:
* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::hidden):
(WebCore::Document::pageVisibilityState): Deleted.
(WebCore::Document::visibilityState): Deleted.
* dom/Document.h:
* dom/Document.idl:
* page/Page.cpp:
(WebCore::Page::visibilityState):
* page/PageVisibilityState.cpp: Removed.
* page/PageVisibilityState.h:
(): Deleted.

Source/WebKit/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument visibilityState]):
* WebView/WebView.mm:
(kit):

Source/WebKit2:

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toPageVisibilityState):

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

2 years agoRemove implementation of legacy Mozilla-based Fullscreen API.
jer.noble@apple.com [Mon, 12 Dec 2016 23:12:12 +0000 (23:12 +0000)]
Remove implementation of legacy Mozilla-based Fullscreen API.
https://bugs.webkit.org/show_bug.cgi?id=165689
Source/WebCore:

Reviewed by Eric Carlson.

Alias the legacy webkitRequestFull_S_creen() function on Element to webkitRequestFull_s_creen().
Remove the custom behavior in Document::requestFullScreenForElement() to handle the legacy path.

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::webkitRequestFullscreen):
(WebCore::Element::webkitRequestFullScreen): Deleted.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):

Source/WebKit/mac:

<rdar://problem/29603053>

Reviewed by Eric Carlson.

* DOM/DOMElement.mm:
(-[DOMElement webkitRequestFullScreen:]):

LayoutTests:

Reviewed by Eric Carlson.

* fullscreen/full-screen-css-expected.txt:
* fullscreen/full-screen-css.html:
* fullscreen/full-screen-keyboard-disabled-expected.txt: Removed.
* fullscreen/full-screen-keyboard-disabled.html: Removed.
* fullscreen/full-screen-twice-expected.txt:
* fullscreen/full-screen-twice.html:
* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years agoRename BytecodeGenerator's ControlFlowContext to ControlFlowScope.
mark.lam@apple.com [Mon, 12 Dec 2016 23:11:29 +0000 (23:11 +0000)]
Rename BytecodeGenerator's ControlFlowContext to ControlFlowScope.
https://bugs.webkit.org/show_bug.cgi?id=165777

Reviewed by Keith Miller.

The existing code sometimes refer to ControlFlowContext (and associated references)
as context, and sometimes as scope.  Let's be consistent and always call it a scope.

Also renamed push/popScopedControlFlowContext() to push/popLocalControlFlowScope()
because these are only used when we inc/dec the m_localScopeDepth.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::pushIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::popFinallyControlFlowScope):
(JSC::BytecodeGenerator::popIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::pushLocalControlFlowScope):
(JSC::BytecodeGenerator::popLocalControlFlowScope):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::pushFinallyContext): Deleted.
(JSC::BytecodeGenerator::pushIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::popFinallyContext): Deleted.
(JSC::BytecodeGenerator::popIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::pushScopedControlFlowContext): Deleted.
(JSC::BytecodeGenerator::popScopedControlFlowContext): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):

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