WebKit-https.git
2 years ago[css-grid] Crash on debug removing a positioned child
rego@igalia.com [Thu, 16 Mar 2017 13:13:01 +0000 (13:13 +0000)]
[css-grid] Crash on debug removing a positioned child
https://bugs.webkit.org/show_bug.cgi?id=169739

Reviewed by Sergio Villar Senin.

Source/WebCore:

When we add or remove a positioned item we don't need to mark
the grid as dirty, because positioned items do not affect the layout
of the grid at all.

This was causing a crash when a positioned item was removed
after a layout. As after the positioned item was removed,
the method RenderGrid::layoutBlock() was not called,
so when the grid was repainted we got a crash.

Test: fast/css-grid-layout/grid-crash-remove-positioned-item.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild): Add early return to avoid marking
the grid as dirty for positioned grid items.
(WebCore::RenderGrid::removeChild): Ditto.

LayoutTests:

Add new test that checks that adding and removing a positioned grid item
doesn't cause any crashes.

* fast/css-grid-layout/grid-crash-remove-positioned-item-expected.txt: Added.
* fast/css-grid-layout/grid-crash-remove-positioned-item.html: Added.

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

2 years ago[ESnext] Implement Object Spread
commit-queue@webkit.org [Thu, 16 Mar 2017 12:58:14 +0000 (12:58 +0000)]
[ESnext] Implement Object Spread
https://bugs.webkit.org/show_bug.cgi?id=167963

Patch by Caio Lima <ticaiolima@gmail.com> on 2017-03-16
Reviewed by Yusuke Suzuki.

JSTests:

* stress/object-spread.js: Added.
(let.assert):
(assert.sameValue):
(let.o.get a):
(let.obj.get c):
(cthulhu.get x):
(let.obj.set c):
(calls.o.get z):
(calls.o.get a):
(try.let.obj.get foo):
(get calls):

Source/JavaScriptCore:

This patch implements ECMA262 stage 3 Object Spread proposal [1].
It's implemented using CopyDataProperties to copy all enumerable keys
from object being spreaded.

It's also fixing CopyDataProperties that was using
Object.getOwnPropertyNames to list all keys to be copied, and now is
using Relect.ownKeys.

[1] - https://github.com/sebmarkbage/ecmascript-rest-spread

* builtins/GlobalOperations.js:
(globalPrivate.copyDataProperties):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::addSetConstant):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode):
(JSC::ObjectPatternNode::bindValue):
(JSC::ObjectSpreadExpressionNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createObjectSpreadExpression):
(JSC::ASTBuilder::createProperty):
* parser/NodeConstructors.h:
(JSC::PropertyNode::PropertyNode):
(JSC::ObjectSpreadExpressionNode::ObjectSpreadExpressionNode):
* parser/Nodes.h:
(JSC::ObjectSpreadExpressionNode::expression):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseProperty):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createObjectSpreadExpression):
(JSC::SyntaxChecker::createProperty):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::privateToObject): Deleted.
* runtime/JSGlobalObjectFunctions.h:

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

2 years ago[WebRTC] SDP sess-id in the "o=" line should be a value between 0 and LLONG_MAX.
clopez@igalia.com [Thu, 16 Mar 2017 11:59:24 +0000 (11:59 +0000)]
[WebRTC] SDP sess-id in the "o=" line should be a value between 0 and LLONG_MAX.
https://bugs.webkit.org/show_bug.cgi?id=169681

Reviewed by Alejandro G. Castro.

Source/WebCore:

Use an int64_t type for storing sess-id and ensure that the value generated is always between 0 and LLONG_MAX (2^63-1).
To the JS world (sdp.js) we pass and read this value as a string type.

The JS world (sdp.js) was already using a string type for sess-id.
This caused a bug when reading the sess-id value at configurationFromJSON(): no value was obtained because a numeric type was expected.

So, after this patch, sess-id is passed and read as a string from sdp.js, and converted to an int64_t type for internal use.
This way we also avoid a rounding problem that happens with values near LLONG_MAX when converting from int64_t to double when passed to the JS world,
and that could cause that we end passing a number bigger than LLONG_MAX to sdp.js.

* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::sessionId):
(WebCore::MediaEndpointSessionConfiguration::setSessionId):
(WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):

LayoutTests:

Check that the generated sess-id value its between the limits before validating it.
This is covered by the tests fast/mediastream/RTCPeerConnection-inspect-answer.html
and fast/mediastream/RTCPeerConnection-inspect-offer.html.
Both tests will fail if the sess-id value generated is not within the limits.

* fast/mediastream/resources/sdp-utils.js:
(printComparableSessionDescription):

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

2 years ago[UNIX] Implement currentSearchLocaleID() and currentTextBreakLocaleID()
carlosgc@webkit.org [Thu, 16 Mar 2017 11:55:13 +0000 (11:55 +0000)]
[UNIX] Implement currentSearchLocaleID() and currentTextBreakLocaleID()
https://bugs.webkit.org/show_bug.cgi?id=169745

Reviewed by Yusuke Suzuki.

Add a common implementation for Unix based ports using setlocale.

* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Removed.
* wtf/text/unix/TextBreakIteratorInternalICUUnix.cpp: Renamed from Source/WTF/wtf/text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp.
(WTF::currentSearchLocaleID):
(WTF::currentTextBreakLocaleID):

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

2 years ago[GLIB] MainThread implementation is not GTK+ specific
carlosgc@webkit.org [Thu, 16 Mar 2017 09:57:18 +0000 (09:57 +0000)]
[GLIB] MainThread implementation is not GTK+ specific
https://bugs.webkit.org/show_bug.cgi?id=169736

Reviewed by Yusuke Suzuki.

It's implemented in MainThreadGLib.cpp for glib based ports, so ifdefs in MainThread should not be
PLATFORM(GTK) but USE(GLIB).

* wtf/MainThread.cpp:
* wtf/MainThread.h:

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

2 years agoFix uninitialized public members in Webkit2/UIProcess/API/gtk
tpopela@redhat.com [Thu, 16 Mar 2017 08:40:29 +0000 (08:40 +0000)]
Fix uninitialized public members in Webkit2/UIProcess/API/gtk
https://bugs.webkit.org/show_bug.cgi?id=169602

Reviewed by Michael Catanzaro.

Found by Coverity scan.

* UIProcess/API/gtk/WebKitMimeInfo.cpp:
* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:

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

2 years agoUnreviewed follow-up to r213787. Move the DatabaseProcess build targets
zandobersek@gmail.com [Thu, 16 Mar 2017 07:51:41 +0000 (07:51 +0000)]
Unreviewed follow-up to r213787. Move the DatabaseProcess build targets
to the top of WebKit2_SOURCES list in order to maintain the alphabetical
order.

* CMakeLists.txt:

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

2 years agoFix CMake build.
achristensen@apple.com [Thu, 16 Mar 2017 06:48:26 +0000 (06:48 +0000)]
Fix CMake build.

* PlatformMac.cmake:

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

2 years agoFix unit test and bug fix for 'pull-os-versions.js' script.
dewei_zhu@apple.com [Thu, 16 Mar 2017 06:29:02 +0000 (06:29 +0000)]
Fix unit test and bug fix for 'pull-os-versions.js' script.
https://bugs.webkit.org/show_bug.cgi?id=169701

Reviewed by Ryosuke Niwa.

Fix unit tests warnings on node-6.10.0.
Fix 'pull-os-versions.js' does not fetch new builds and report.

* server-tests/tools-os-build-fetcher-tests.js:
(then):
(beforeEach):
(afterEach):
* tools/pull-os-versions.js:
(syncLoop):

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

2 years agoFlatten RTC enum naming
jonlee@apple.com [Thu, 16 Mar 2017 06:10:34 +0000 (06:10 +0000)]
Flatten RTC enum naming
https://bugs.webkit.org/show_bug.cgi?id=169664

Reviewed by Youenn Fablet.

Use consistent names of RTC enums throughout WebCore. This means surfacing
ICE enums out of PeerConnectionState. Keep the old names around for other
ports.

Add RTCIceConnectionState, RTCIceGatheringState, and RTCSignalingState enums.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCIceConnectionState.h: Added. The enum is defined in
PeerConnectionStates.h, so just include that file.
* Modules/mediastream/RTCIceConnectionState.idl: Added.
* Modules/mediastream/RTCIceGatheringState.h: Added.
* Modules/mediastream/RTCIceGatheringState.idl: Added.
* Modules/mediastream/RTCSignalingState.h: Added.
* Modules/mediastream/RTCSignalingState.idl: Added.
* WebCore.xcodeproj/project.pbxproj:

* platform/mediastream/PeerConnectionStates.h: Move the existing enums into
WebCore, but keep aliases to the old names within the PeerConnectionStates
namespace.

Refactor to use the new enum names.
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Refactor.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl: Add FIXMEs for bringing this up
to spec.
* Modules/mediastream/RTCIceTransport.h:
* Modules/mediastream/RTCPeerConnection.cpp: Refactor the three functions
below to using the enum instead of returning strings. This allows remove of
the internal* versions of these functions.
(WebCore::RTCPeerConnection::signalingState): Deleted.
(WebCore::RTCPeerConnection::iceGatheringState): Deleted.
(WebCore::RTCPeerConnection::iceConnectionState): Deleted.
* Modules/mediastream/RTCPeerConnection.h: Replace internalSignalingState,
internalIceGatheringState, and internalIceConnectionState.
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.cpp:
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mock/MockMediaEndpoint.cpp:
* platform/mock/MockMediaEndpoint.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::processIceTransportStateChange):

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

2 years ago[JSC] Default parameter part should be retrieved by op_get_argument opcode instead...
utatane.tea@gmail.com [Thu, 16 Mar 2017 05:12:53 +0000 (05:12 +0000)]
[JSC] Default parameter part should be retrieved by op_get_argument opcode instead of changing arity
https://bugs.webkit.org/show_bug.cgi?id=164582

Reviewed by Saam Barati.

JSTests:

* stress/function-with-defaults-inlining.js: Added.
(shouldBe):
(ok):
(a):
* stress/function-with-defaults-non-inlining.js: Added.
(shouldBe):
(ok):
(a):

Source/JavaScriptCore:

Previously we implement the default parameters as follows.

    1. We count the default parameters as the usual parameters.
    2. We just get the argument register.
    3. Check it with op_is_undefined.
    4. And fill the binding with either the argument register or default value.

The above is simple. However, it has the side effect that it always increase the arity of the function.
While `function.length` does not increase, internally, the number of parameters of CodeBlock increases.
This effectively prevent our DFG / FTL to perform inlining: currently we only allows DFG to inline
the function with the arity less than or equal the number of passing arguments. It is OK. But when using
default parameters, we frequently do not pass the argument for the parameter with the default value.
Thus, in our current implementation, we frequently need to fixup the arity. And we frequently fail
to inline the function.

This patch fixes the above problem by not increasing the arity of the function. When we encounter the
parameter with the default value, we use `op_argument` to get the argument instead of using the argument
registers.

This improves six-speed defaults.es6 performance by 4.45x.

    defaults.es6        968.4126+-101.2350   ^    217.6602+-14.8831       ^ definitely 4.4492x faster

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
(JSC::BytecodeGenerator::initializeNextParameter):
(JSC::BytecodeGenerator::initializeParameters):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::inliningCost):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
(JSC::FunctionParameters::size):
(JSC::FunctionParameters::at):
(JSC::FunctionParameters::append):
(JSC::FunctionParameters::isSimpleParameterList):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::isArrowFunctionParameters):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/Parser.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionMetadata):
* runtime/FunctionExecutable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::createBuiltinFunction):
(JSC::JSFunction::reifyLength):

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

2 years ago[DFG] ToString operation should have fixup for primitives to say this node does not...
utatane.tea@gmail.com [Thu, 16 Mar 2017 04:49:47 +0000 (04:49 +0000)]
[DFG] ToString operation should have fixup for primitives to say this node does not have side effects
https://bugs.webkit.org/show_bug.cgi?id=169544

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/template-string-array.js: Added.
(test):
* stress/to-string-non-cell-use.js: Added.
(shouldBe):
(shouldThrow):

Source/JavaScriptCore:

Our DFG ToString only considers well about String operands. While ToString(non cell operand) does not have
any side effect, it is not modeled well in DFG.

This patch introduces a fixup for ToString with NonCellUse edge. If this edge is set, ToString does not
clobber things (like ToLowerCase, producing String). And ToString(NonCellUse) allows us to perform CSE!

Our microbenchmark shows 32.9% improvement due to dropped GetButterfly and CSE for ToString().

                                    baseline                  patched

    template-string-array       12.6284+-0.2766     ^      9.4998+-0.2295        ^ definitely 1.3293x faster

And SixSpeed template_string.es6 shows 16.68x performance improvement due to LICM onto this non-side-effectful ToString().

                                  baseline                  patched

    template_string.es6     3229.7343+-40.5705    ^    193.6077+-36.3349       ^ definitely 16.6818x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOnCell):
(JSC::DFG::SpeculativeJIT::speculateNotCell):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructor):
(JSC::FTL::DFG::LowerDFGToB3::lowNotCell):
(JSC::FTL::DFG::LowerDFGToB3::speculateNotCell):

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

2 years agoOptionally capture audio in the UIProcess
jer.noble@apple.com [Thu, 16 Mar 2017 04:10:53 +0000 (04:10 +0000)]
Optionally capture audio in the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=169609

Reviewed by Alex Christensen.

Source/WebCore:

Export some previously un-exported symbols from WebCore for use in WebKit2.

* WebCore.xcodeproj/project.pbxproj:
* platform/audio/WebAudioBufferList.h:
* platform/mediastream/RealtimeMediaSource.h:

Source/WebKit2:

Add a new class pair, UserMediaCaptureManager/Proxy, to allow a RealtimeMediaSource
requested in a WebProcess to be created in the UIProcess and push its audio data across the
process boundary to its clients in the WebProcess. Because these classes are clients of the
RealtimeMediaSourceCenter::singleton(), they must be a singleton in the WebProcess as well,
so they are attached to the WebProcess class in the web process and to WebProcessProxy in
the UIProcess.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: Added.
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::source):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::description):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::numberOfFrames):
(WebKit::UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy):
(WebKit::UserMediaCaptureManagerProxy::~UserMediaCaptureManagerProxy):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
(WebKit::UserMediaCaptureManagerProxy::process):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: Added.
* WebProcess/cocoa/UserMediaCaptureManager.cpp: Added.
(WebKit::nextSessionID):
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::Source::~Source):
(WebKit::UserMediaCaptureManager::Source::setCapabilities):
(WebKit::UserMediaCaptureManager::Source::setSettings):
(WebKit::UserMediaCaptureManager::Source::description):
(WebKit::UserMediaCaptureManager::Source::setStorage):
(WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds):
(WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::supplementName):
(WebKit::UserMediaCaptureManager::initialize):
(WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManager::sourceStopped):
(WebKit::UserMediaCaptureManager::sourceMutedChanged):
(WebKit::UserMediaCaptureManager::sourceEnabledChanged):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::storageChanged):
(WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
(WebKit::UserMediaCaptureManager::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::startProducingData):
(WebKit::UserMediaCaptureManager::stopProducingData):
* WebProcess/cocoa/UserMediaCaptureManager.h: Added.
* WebProcess/cocoa/UserMediaCaptureManager.messages.in: Added.

Initialize UserMediaCaptureManager/Proxy:

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):

WebUserMediaClientMac is no longer necessary now that the UserMediaCaptureManager overrides
the factories:

* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::WebUserMediaClient):
(WebKit::WebUserMediaClient::initializeFactories): Deleted.

Add a new preference and WebProcessCreationParameters member to control whether
capturing is done in the UIProcess:

* Shared/WebPreferencesDefinitions.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:

Add new files to the project:

* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:

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

2 years agoRevert part of r213978 to see if it resolves LayoutTest crashes.
ryanhaddad@apple.com [Thu, 16 Mar 2017 03:41:09 +0000 (03:41 +0000)]
Revert part of r213978 to see if it resolves LayoutTest crashes.
https://bugs.webkit.org/show_bug.cgi?id=169729

Reviewed by Alexey Proskuryakov.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

2 years ago[CMake][JSCOnly] Fix build with GLib event loop
clopez@igalia.com [Thu, 16 Mar 2017 03:15:03 +0000 (03:15 +0000)]
[CMake][JSCOnly] Fix build with GLib event loop
https://bugs.webkit.org/show_bug.cgi?id=169730

Reviewed by Michael Catanzaro.

* wtf/MainThread.cpp:
* wtf/PlatformJSCOnly.cmake: WorkQueueGLib was removed in r199713.

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

2 years agoWeb Inspector: Selecting text in the console does not do what I expect
webkit@devinrousso.com [Thu, 16 Mar 2017 02:48:28 +0000 (02:48 +0000)]
Web Inspector: Selecting text in the console does not do what I expect
https://bugs.webkit.org/show_bug.cgi?id=169570

Reviewed by Matt Baker.

* UserInterface/Views/ConsoleMessageView.css:
(.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)):
(.console-message .console-message-location):
(.console-message-location.call-frame):
Prevent text selection on anything other than the message text.  The other information that
is not selectable can still be copied by selecting the message itself and copying.

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

2 years agoDo not reparent floating object until after intruding/overhanging dependency is cleared.
zalan@apple.com [Thu, 16 Mar 2017 01:56:57 +0000 (01:56 +0000)]
Do not reparent floating object until after intruding/overhanging dependency is cleared.
https://bugs.webkit.org/show_bug.cgi?id=169711
<rdar://problem/30959743>

Reviewed by Simon Fraser.

Source/WebCore:

This patch ensures that we cleanup the m_floatingObjects for siblings before reparenting the fresh float.

Test: fast/block/float/inline-becomes-float-and-moves-around.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::noLongerAffectsParentBlock):

LayoutTests:

* fast/block/float/inline-becomes-float-and-moves-around-expected.txt: Added.
* fast/block/float/inline-becomes-float-and-moves-around.html: Added.

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

2 years ago[jsc][mips] Fix compilation error introduced in r213652
commit-queue@webkit.org [Thu, 16 Mar 2017 01:01:45 +0000 (01:01 +0000)]
[jsc][mips] Fix compilation error introduced in r213652
https://bugs.webkit.org/show_bug.cgi?id=169723

Patch by Guillaume Emont <guijemont@igalia.com> on 2017-03-15
Reviewed by Mark Lam.

The new replaceWithBkpt() contains a lapsus in it
(s/code/instructionStart) and won't compile.

* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::replaceWithBkpt):

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

2 years agoWeb Inspector: WebSockets: Update Arrow Up icon to fit in with the rest of our iconog...
nvasilyev@apple.com [Thu, 16 Mar 2017 01:01:06 +0000 (01:01 +0000)]
Web Inspector: WebSockets: Update Arrow Up icon to fit in with the rest of our iconography
https://bugs.webkit.org/show_bug.cgi?id=169696
<rdar://problem/31073748>

Reviewed by Matt Baker.

* UserInterface/Images/ArrowUp.svg:
* UserInterface/Images/gtk/ArrowUp.svg:

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

2 years agoSwitch back to ISO 4217 for Intl CurrencyDigits data
commit-queue@webkit.org [Wed, 15 Mar 2017 23:40:24 +0000 (23:40 +0000)]
Switch back to ISO 4217 for Intl CurrencyDigits data
https://bugs.webkit.org/show_bug.cgi?id=169182

Previously, a patch switched Intl.NumberFormat to use CLDR data through
ICU to get the default number of decimal digits for a currency.
However, that change actually violated the ECMA 402 specification,
which references ISO 4217 as the data source. This patch reverts to
an in-line implementation of that data.

Patch by Daniel Ehrenberg <littledan@chromium.org> on 2017-03-15
Reviewed by Saam Barati.

* runtime/IntlNumberFormat.cpp:
(JSC::computeCurrencySortKey):
(JSC::extractCurrencySortKey):
(JSC::computeCurrencyDigits):

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

2 years agoNull deref under callAfterNextPresentationUpdate
timothy_horton@apple.com [Wed, 15 Mar 2017 23:29:17 +0000 (23:29 +0000)]
Null deref under callAfterNextPresentationUpdate
https://bugs.webkit.org/show_bug.cgi?id=169710
<rdar://problem/30987863>

Reviewed by Simon Fraser.

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
Call the callback with an error if we don't have a web process or drawing area.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/DoAfterNextPresentationUpdateAfterCrash.mm: Added.
(TEST):

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

2 years agoWebAssembly: When we GC to try to get a fast memory, we should call collectAllGarbage...
sbarati@apple.com [Wed, 15 Mar 2017 23:17:15 +0000 (23:17 +0000)]
WebAssembly: When we GC to try to get a fast memory, we should call collectAllGarbage(), not collectSync()
https://bugs.webkit.org/show_bug.cgi?id=169704

Reviewed by Mark Lam.

We weren't always sweeping the memory needed to free
the WasmMemory we wanted to use. collectAllGarbage()
will do this if the JS objects wrapping WasmMemory
are dead.

This patch also moves the increment of the allocatedFastMemories
integer to be thread safe.

* wasm/WasmMemory.cpp:
(JSC::Wasm::tryGetFastMemory):

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

2 years agoMake a base class for WebGL and WebGPU contexts
dino@apple.com [Wed, 15 Mar 2017 22:56:21 +0000 (22:56 +0000)]
Make a base class for WebGL and WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=169651
<rdar://problem/31053489>

Reviewed by Simon Fraser.

Add a new pure virtual base class, GPUBasedCanvasRenderingContext, that
will be used by WebGL and WebGPU rendering contexts. This allows us
to avoid some code duplication, since many places treat the two
as the same.

Also rename is3d() -> isWebGL() and isGPU() -> isWebGPU().

* WebCore.xcodeproj/project.pbxproj: New file.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPUBased):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::isGPU): Deleted.
(WebCore::HTMLCanvasElement::is3D): Deleted.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGL):
(WebCore::CanvasRenderingContext::isWebGPU):
(WebCore::CanvasRenderingContext::isGPUBased):
(WebCore::CanvasRenderingContext::is3d): Deleted.
(WebCore::CanvasRenderingContext::isGPU): Deleted.
* html/canvas/GPUBasedCanvasRenderingContext.h: Added.
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* html/canvas/WebGPURenderingContext.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):

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

2 years agoFix exception scope verification failures in jsc.cpp.
mark.lam@apple.com [Wed, 15 Mar 2017 22:49:36 +0000 (22:49 +0000)]
Fix exception scope verification failures in jsc.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164968

Reviewed by Saam Barati.

* jsc.cpp:
(WTF::CustomGetter::customGetter):

(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
- The only way modules would throw an exception is if we encounter an OutOfMemory
  error.  This should be extremely rare.  At this point, I don't think it's worth
  doing the dance to propagate the exception when this happens.  Instead, we'll
  simply do a RELEASE_ASSERT that we don't see any exceptions here.

(functionRun):
(functionRunString):
(functionLoadModule):
(functionCheckModuleSyntax):
(box):
(dumpException):
(runWithScripts):

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

2 years agoIteratively dispatch DOM events after restoring a cached page
dbates@webkit.org [Wed, 15 Mar 2017 22:44:59 +0000 (22:44 +0000)]
Iteratively dispatch DOM events after restoring a cached page
https://bugs.webkit.org/show_bug.cgi?id=169703
<rdar://problem/31075903>

Reviewed by Brady Eidson.

Make dispatching of DOM events when restoring a page from the page cache symmetric with
dispatching of events when saving a page to the page cache.

* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore): Move code to dispatch events from here to FrameLoader::didRestoreFromCachedPage().
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Ensure that no DOM events are dispatched during
restoration of a cached page. Call didRestoreFromCachedPage() after restoring the page to
dispatch DOM events on the restored frames.
(WebCore::FrameLoader::willRestoreFromCachedPage): Renamed; formerly named prepareForCachedPageRestore().
(WebCore::FrameLoader::didRestoreFromCachedPage): Added.
(WebCore::FrameLoader::prepareForCachedPageRestore): Renamed to willRestoreFromCachedPage().
* loader/FrameLoader.h:
* page/FrameTree.cpp:
(WebCore::FrameTree::traverseNextInPostOrderWithWrap): Returns the next Frame* in a post-order
traversal of the frame tree optionally wrapping around to the deepest first child in the tree.
(WebCore::FrameTree::deepFirstChild): Added.
* page/FrameTree.h:

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

2 years agoWeb Inspector: Add icons for SVG Image cluster path components
webkit@devinrousso.com [Wed, 15 Mar 2017 22:29:29 +0000 (22:29 +0000)]
Web Inspector: Add icons for SVG Image cluster path components
https://bugs.webkit.org/show_bug.cgi?id=169687

Reviewed by Joseph Pecoraro.

* UserInterface/Images/Image.svg: Added.
* UserInterface/Images/Source.svg: Added.
* UserInterface/Images/gtk/Image.svg: Added.
* UserInterface/Images/gtk/Source.svg: Added.

* UserInterface/Views/PathComponentIcons.css:
(.image-icon .icon):
(.source-icon .icon):

* UserInterface/Views/SVGImageResourceClusterContentView.js:
(WebInspector.SVGImageResourceClusterContentView):

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

2 years agoPositioned SVG not sized correctly
hyatt@apple.com [Wed, 15 Mar 2017 22:09:59 +0000 (22:09 +0000)]
Positioned SVG not sized correctly
https://bugs.webkit.org/show_bug.cgi?id=169693
<rdar://problem/30996893>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: svg/in-html/rect-positioned.html

Change computeReplacedLogicalHeight to take an estimatedUsedWidth. This
value is used instead of the available logical width to resolve replaced
elements without intrinsic sizes but with aspect ratios set.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeight):
* rendering/RenderBox.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeConstrainedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
* rendering/RenderReplaced.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::computeReplacedLogicalHeight): Deleted.
* rendering/RenderVideo.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
* rendering/svg/RenderSVGRoot.h:

LayoutTests:

* svg/in-html/rect-positioned-expected.html: Added.
* svg/in-html/rect-positioned.html: Added.

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

2 years agoWeb Inspector: RTL: flip Memory timelines
webkit@devinrousso.com [Wed, 15 Mar 2017 22:04:50 +0000 (22:04 +0000)]
Web Inspector: RTL: flip Memory timelines
https://bugs.webkit.org/show_bug.cgi?id=169694

Reviewed by Brian Burg.

* UserInterface/Views/MemoryCategoryView.css:
(body[dir=rtl] .memory-category-view > .graph):

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

2 years agoIn-browser and node.js implementations of RemoteAPI should share some code
rniwa@webkit.org [Wed, 15 Mar 2017 21:59:12 +0000 (21:59 +0000)]
In-browser and node.js implementations of RemoteAPI should share some code
https://bugs.webkit.org/show_bug.cgi?id=169695

Rubber-stamped by Antti Koivisto.

Extracted CommonRemoteAPI out of RemoteAPI implementations for node.js and browser.

* public/shared/common-remote.js: Added.
(CommonRemoteAPI): Added.
(CommonRemoteAPI.prototype.postJSON): Extracted from RemoteAPI.
(CommonRemoteAPI.prototype.postJSONWithStatus): Ditto.
(CommonRemoteAPI.prototype.getJSON): Ditto.
(CommonRemoteAPI.prototype.getJSONWithStatus): Ditto.
(CommonRemoteAPI.prototype.sendHttpRequest): Added. Needs to implemented by a subclass.
(CommonRemoteAPI.prototype._asJSON): Added.
(CommonRemoteAPI.prototype._checkStatus): Added.

* public/v3/index.html: Include common-remote.js.

* public/v3/privileged-api.js:
(PrivilegedAPI): Use class now that we don't include data.js.
(PrivilegedAPI.sendRequest): Modernized the code.
(PrivilegedAPI.requestCSRFToken): Ditto.

* public/v3/remote.js:
(BrowserRemoteAPI): Renamed from RemoteAPI. window.RemoteAPI is now an instance of this class.
(BrowserRemoteAPI.prototype.sendHttpRequest): Moved from RemoteAPI.sendHttpRequest.
(BrowserRemoteAPI.prototype.sendHttpRequest):

* server-tests/privileged-api-create-analysis-task-tests.js: Updated tests since NodeJSRemoteAPI
now throws the JSON status as an error to be consistent with BrowserRemoteAPI.
* server-tests/privileged-api-create-test-group-tests.js: Ditto.
* server-tests/privileged-api-upate-run-status.js: Ditto.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.syncOnce): Just use postJSONWithStatus instead of manually
checking the status.

* tools/js/remote.js:
(NodeRemoteAPI): Renamed from RemoteAPI. Still exported as RemoteAPI.
(NodeRemoteAPI.prototype.constructor):
(NodeRemoteAPI.prototype.sendHttpRequest): Modernized the code.

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

2 years agoClean up TestExpectations for some WPT LayoutTests.
ryanhaddad@apple.com [Wed, 15 Mar 2017 21:47:11 +0000 (21:47 +0000)]
Clean up TestExpectations for some WPT LayoutTests.

Unreviewed test gardening.

* TestExpectations:

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

2 years agoDocument state (e.g. form data) is lost after a tab is terminated in the background...
cdumez@apple.com [Wed, 15 Mar 2017 21:31:16 +0000 (21:31 +0000)]
Document state (e.g. form data) is lost after a tab is terminated in the background for power reasons
https://bugs.webkit.org/show_bug.cgi?id=169635
<rdar://problem/31046729>

Reviewed by Andreas Kling.

Source/WebKit2:

Document state (e.g. form data) was lost after a tab was terminated in the background for power
reasons. To address the issue, we now save the document state whenever a page is backgrounded.
This document state automatically gets restored when reloading the page after termination.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::visibilityDidChange):
(WebKit::WebPage::setActivityState):
* WebProcess/WebPage/WebPage.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/mac/RestoreStateAfterTermination.mm: Added.
(TestWebKitAPI::runJavaScriptAlert):
(TestWebKitAPI::didFinishLoad):
(TestWebKitAPI::didCrash):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/simple-form.html:

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

2 years agoFix missing exception checks in Interpreter.cpp.
mark.lam@apple.com [Wed, 15 Mar 2017 20:19:35 +0000 (20:19 +0000)]
Fix missing exception checks in Interpreter.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164964

Reviewed by Saam Barati.

* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::sizeOfVarargs):
(JSC::sizeFrameForVarargs):
(JSC::Interpreter::executeProgram):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::execute):

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

2 years agoJSContext Inspector: NetworkAgent may be unavailable
commit-queue@webkit.org [Wed, 15 Mar 2017 20:00:32 +0000 (20:00 +0000)]
JSContext Inspector: NetworkAgent may be unavailable
https://bugs.webkit.org/show_bug.cgi?id=169691

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-15
Reviewed by Brian Burg.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
Check that NetworkAgent even exists. An augmented JSContext may have Resources
without having a NetworkAgent.

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

2 years agoWebContent crash due to bad variant access in WebKit: WebKit::WebPage::expandedRangeF...
wenson_hsieh@apple.com [Wed, 15 Mar 2017 19:56:03 +0000 (19:56 +0000)]
WebContent crash due to bad variant access in WebKit: WebKit::WebPage::expandedRangeFromHandle
https://bugs.webkit.org/show_bug.cgi?id=169657
<rdar://problem/30631070>

Reviewed by Tim Horton.

In WebPageIOS.mm, the call to unionDOMRanges from WebPage::expandedRangeFromHandle invokes
Range::compareBoundaryPoints, assuming that the return value is not an exception, and then attempts to perform
integer comparison on the result. This is one speculative cause of the web content crash in the radar.

There isn't a known way to reproduce this crash.

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

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

2 years agoREGRESSION (r213622): Web Inspector: DataGrid headers should NOT be centered
nvasilyev@apple.com [Wed, 15 Mar 2017 19:35:02 +0000 (19:35 +0000)]
REGRESSION (r213622): Web Inspector: DataGrid headers should NOT be centered
https://bugs.webkit.org/show_bug.cgi?id=169645
<rdar://problem/31051520>

Reviewed by Matt Baker.

* UserInterface/Views/DataGrid.css:
(.data-grid th):
(body[dir=ltr] .data-grid th):
(body[dir=rtl] .data-grid th):

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

2 years agoUn-deprecate the original PDFPlugin
timothy_horton@apple.com [Wed, 15 Mar 2017 19:34:22 +0000 (19:34 +0000)]
Un-deprecate the original PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=169655

Reviewed by Anders Carlsson.

* Shared/mac/PDFKitImports.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/DeprecatedPDFLayerControllerSPI.h: Removed.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: Removed.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: Removed.
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
The transition to the non-deprecated PDFPlugin never happened,
and we have a very different plan now.

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

2 years agoFix server tests after r213998 and r213969
rniwa@webkit.org [Wed, 15 Mar 2017 19:34:00 +0000 (19:34 +0000)]
Fix server tests after r213998 and r213969
https://bugs.webkit.org/show_bug.cgi?id=169690

Reviewed by Antti Koivisto.

Fixed the existing server tests.

* public/v3/models/analysis-task.js:
(AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
(AnalysisTask.prototype.associateBug): Ditto.
(AnalysisTask.prototype.dissociateBug): Ditto.
(AnalysisTask.prototype.associateCommit): Ditto.
(AnalysisTask.prototype.dissociateCommit): Ditto.
(AnalysisTask._fetchSubset): Ditto.
(AnalysisTask.fetchAll): Ditto.
* public/v3/models/test-group.js:
(TestGroup.prototype.updateName): Ditto.
(TestGroup.prototype.updateHiddenFlag): Ditto.
(TestGroup.createAndRefetchTestGroups): Ditto.
(TestGroup.cachedFetch): Ditto.
* server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
* tools/js/database.js:
(tableToPrefixMap): Added analysis_strategies.
* unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.

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

2 years agoWeb Inspector: SVG image content view should toggle between image and source
webkit@devinrousso.com [Wed, 15 Mar 2017 19:15:27 +0000 (19:15 +0000)]
Web Inspector: SVG image content view should toggle between image and source
https://bugs.webkit.org/show_bug.cgi?id=16079

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:

* UserInterface/Views/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.prototype.get responseContentView):
Show the SVG cluster content view if the MIME type matches an SVG file.

* UserInterface/Views/SVGImageResourceClusterContentView.js: Added.
(WebInspector.SVGImageResourceClusterContentView):
(WebInspector.SVGImageResourceClusterContentView.prototype.get resource):
(WebInspector.SVGImageResourceClusterContentView.prototype.get selectionPathComponents):
(WebInspector.SVGImageResourceClusterContentView.prototype.shown):
(WebInspector.SVGImageResourceClusterContentView.prototype.closed):
(WebInspector.SVGImageResourceClusterContentView.prototype.saveToCookie):
(WebInspector.SVGImageResourceClusterContentView.prototype.restoreFromCookie):
(WebInspector.SVGImageResourceClusterContentView.prototype._pathComponentForContentView):
(WebInspector.SVGImageResourceClusterContentView.prototype._identifierForContentView):
(WebInspector.SVGImageResourceClusterContentView.prototype._showContentViewForIdentifier):
(WebInspector.SVGImageResourceClusterContentView.prototype._pathComponentSelected):

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

2 years agoAdd tests for privileged-api/create-analysis-task and privileged-api/create-test...
rniwa@webkit.org [Wed, 15 Mar 2017 19:15:02 +0000 (19:15 +0000)]
Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
https://bugs.webkit.org/show_bug.cgi?id=169688

Rubber-stamped by Antti Koivisto.

Added tests for privileged-api/create-analysis-task and privileged-api/create-test-group, and fixed newly found bugs.

* public/privileged-api/create-analysis-task.php:
(main): Fixed the bug that we were not explicitly checking whether start_run and end_run were integers or not.
Also return InvalidTimeRange when start and end times are identical as that makes no sense for an analysis task.

* public/privileged-api/create-test-group.php:
(main): Fixed a bug that we were not explicitly checking task and repetitionCount to be an integer.
(ensure_commit_sets): Fixed the bug that the number of commit sets weren't checked.

* server-tests/privileged-api-create-analysis-task-tests.js: Added.
* server-tests/privileged-api-create-test-group-tests.js: Added.

* server-tests/resources/common-operations.js:
(prepareServerTest): Increase the timeout from 1s to 5s.

* server-tests/resources/mock-data.js:
(MockData.addMockData): Use a higher database ID of 20 for a mock build_slave to avoid a conflict with auto-generated IDs.

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

2 years agoWeb Inspector: RTL: add support for Timeline ruler selections/movement
webkit@devinrousso.com [Wed, 15 Mar 2017 19:07:55 +0000 (19:07 +0000)]
Web Inspector: RTL: add support for Timeline ruler selections/movement
https://bugs.webkit.org/show_bug.cgi?id=169588

Reviewed by Matt Baker.

* UserInterface/Views/TimelineOverview.css:
(body[dir=ltr] .timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .selection-handle.right):
(body[dir=rtl] .timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .selection-handle.left):
(body[dir=ltr] .timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .shaded-area.right):
(body[dir=rtl] .timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .shaded-area.left):
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .selection-handle.right): Deleted.
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .shaded-area.right): Deleted.
Fixes alignment of selection handles when in Frames view.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._handleScrollEvent):
Support horizontal scrolling in timelines by treating the current scroll value as negative
when in RTL, flipping the scroll direction.

* UserInterface/Views/TimelineRuler.css:
(body[dir=ltr] .timeline-ruler > .selection-handle.left):
(body[dir=rtl] .timeline-ruler > .selection-handle.left):
(body[dir=ltr] .timeline-ruler > .selection-handle.right):
(body[dir=rtl] .timeline-ruler > .selection-handle.right):
(body[dir=ltr] .timeline-ruler > .shaded-area.left):
(body[dir=rtl] .timeline-ruler > .shaded-area.left):
(body[dir=ltr] .timeline-ruler > .shaded-area.right):
(body[dir=rtl] .timeline-ruler > .shaded-area.right):
(.timeline-ruler > .selection-handle.left): Deleted.
(.timeline-ruler > .selection-handle.right): Deleted.
(.timeline-ruler > .shaded-area.left): Deleted.
(.timeline-ruler > .shaded-area.right): Deleted.
Flip the position alignment of the selection handles and shaded areas when in RTL.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype._handleMouseDown):
(WebInspector.TimelineRuler.prototype._handleMouseMove):
(WebInspector.TimelineRuler.prototype._handleMouseUp):
(WebInspector.TimelineRuler.prototype._handleSelectionHandleMouseDown):
(WebInspector.TimelineRuler.prototype._handleSelectionHandleMouseMove):
Treat the current mouse position (event.pageX) as a negative value when in RTL, meaning that
the delta movement from the starting position is flipped.

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

2 years ago[Modern Media Controls] Using the arrow keys to navigate in the tracks menu also...
commit-queue@webkit.org [Wed, 15 Mar 2017 18:51:49 +0000 (18:51 +0000)]
[Modern Media Controls] Using the arrow keys to navigate in the tracks menu also scrolls the page
https://bugs.webkit.org/show_bug.cgi?id=169671
<rdar://problem/31060091>

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Eric Carlson.

Source/WebCore:

We need to call preventDefault() when handling a "keydown" event that we recognize.

Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-default-on-keydown.html

* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype._handleKeydown):

LayoutTests:

Add a test that checks that preventDefault() is called on "keydown" events that we know to handle.

* media/modern-media-controls/tracks-panel/tracks-panel-prevent-default-on-keydown-expected.txt: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-default-on-keydown.html: Added.

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

2 years agoRemove TestExpectations.orig after r213882
jbedard@apple.com [Wed, 15 Mar 2017 18:26:19 +0000 (18:26 +0000)]
Remove TestExpectations.orig after r213882

Unreviewed, removing file committed by mistake.

* TestExpectations.orig: Removed.

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

2 years ago[Modern Media Controls] Tracks menu overlaps controls bar in fullscreen
commit-queue@webkit.org [Wed, 15 Mar 2017 18:21:18 +0000 (18:21 +0000)]
[Modern Media Controls] Tracks menu overlaps controls bar in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=169670
<rdar://problem/31060086>
Source/WebCore:

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Eric Carlson.

It used to be that the top of the tracks button was the same as the top of the controls
bar, but that changed when we fixed https://bugs.webkit.org/show_bug.cgi?id=169412. We
now use the top of the controls bar to computed the y-position for the tracks panel.

We are not adding a new test, instead we're unflaking a test that started failing
reliably once we fixed https://bugs.webkit.org/show_bug.cgi?id=169412.

* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):

LayoutTests:

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Eric Carlson.

Unflake a test that checks the tracks panel position in fullscreen.

* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html:
* platform/mac/TestExpectations:

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

2 years agoMake unit tests return a promise instead of manually calling done
rniwa@webkit.org [Wed, 15 Mar 2017 18:15:33 +0000 (18:15 +0000)]
Make unit tests return a promise instead of manually calling done
https://bugs.webkit.org/show_bug.cgi?id=169663

Reviewed by Antti Koivisto.

Make the existing unit tests always reutrn a promise instead of manually calling "done" callback as done
in r213969. The promise tests are a lot more stable and less error prone.

Also use MockRemoteAPI.waitForRequest() instead of chaining two resolved promises where appropriate.

* unit-tests/analysis-task-tests.js:
* unit-tests/buildbot-syncer-tests.js:
* unit-tests/checkconfig.js:
* unit-tests/privileged-api-tests.js:

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

2 years agoClean up RTCPeerConnection IDL
jonlee@apple.com [Wed, 15 Mar 2017 18:15:31 +0000 (18:15 +0000)]
Clean up RTCPeerConnection IDL
https://bugs.webkit.org/show_bug.cgi?id=169660

Reviewed by Youenn Fablet.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver): Refactor to use RTCRtpTransceiverInit.
(WebCore::RTCPeerConnection::completeAddTransceiver):
* Modules/mediastream/RTCPeerConnection.h: Remove redundant definitions.
* Modules/mediastream/RTCPeerConnection.idl: Using 13 March 2017 Editor's Draft of
WebRTC spec. Move RTCOfferAnswerOptions out to separate IDLs. Keep RTCDataChannelInit and
RTCRtpTransceiverInit since they appear to be used only in RTCPeerConnection.
    Reorder the properties, functions, and events based on their appearance in the spec.
Legacy MediaStream calls are placed at the end. I tried to use "partial interface" in the
same file, but in the end nothing was generated, so everything is contained in one interface
block.

* Modules/mediastream/RTCEnums.h: Added. This will be an all-in-one header to hold the
enums.

Move RTCAnswerOptions, RTCOfferAnswerOptions, RTCOfferOptions, RTCRtpTransceiverDirection
out to their own IDL's.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCAnswerOptions.h: Added.
* Modules/mediastream/RTCAnswerOptions.idl: Added.
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCOfferAnswerOptions.idl: Added.
* Modules/mediastream/RTCOfferOptions.h: Added. Remove |offerToReceiveVideo| and
|offerToReceiveAudio|, which are not used.
* Modules/mediastream/RTCOfferOptions.idl: Added.
* Modules/mediastream/RTCRtpTransceiverDirection.h: Added.
* Modules/mediastream/RTCRtpTransceiverDirection.idl: Added. Use a typedef for
RTCRtpTransceiverDirection to prevent the code generator from prefixing RTCRtpTransceiver.
* Modules/mediastream/RTCRtpTransceiver.idl: Move RTCRtpTransceiverDirection.
* WebCore.xcodeproj/project.pbxproj: Add IDLs and derived sources. Remove unused
HTMLMediaElementMediaStream.h. Reorder.

Refactor.
* Modules/mediastream/RTCRtpTransceiver.h: Use RTCRtpTransceiverDirection.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:

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

2 years agoWeb Inspector: REGRESSION: Elements Tab > Node Details Sidebar > Properties Section...
joepeck@webkit.org [Wed, 15 Mar 2017 18:15:21 +0000 (18:15 +0000)]
Web Inspector: REGRESSION: Elements Tab > Node Details Sidebar > Properties Section is spammed with TypeErrors
https://bugs.webkit.org/show_bug.cgi?id=153911
<rdar://problem/24520098>

Reviewed by Devin Rousso.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodeResolved.inspectedPage_node_collectPrototypes):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodeResolved):
Update due to naming conventions for code that evalutes in the inspected page.

(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.fillSection):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties):
Create a more complete ObjectTreeView for the different sections.

* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateChildren):
PureAPI behaves the same as ClassAPI and just shows own properties.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.prototype.showOnlyProperties):
In only properties mode don't show the Prototype expander at the end.

(WebInspector.ObjectTreeView.prototype.setPrototypeNameOverride):
Allow a prototype name override at the top level. This will allow clients
to specify that the object at the top level is a Prototype object, so that
ObjectTreePropertyTreeElements can infer the right NativeFunctionParameter
information knowing that those properties are on a particular prototype.

(WebInspector.ObjectTreeView.prototype.update):
For the PureAPI use getOwnProperties instead of getDisplayableProperties.
This avoids the special handling we have for DOM native properties which
we bubble up to the top as value descriptors even though they are actually
accessor descriptors on prototypes.

(WebInspector.ObjectTreeView.prototype._updateProperties):
Pass the prototype name override onward for object properties.

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

2 years ago[GTK] Initialize m_button, m_clickCount members in PlatformMouseEvent constructors
zandobersek@gmail.com [Wed, 15 Mar 2017 18:03:31 +0000 (18:03 +0000)]
[GTK] Initialize m_button, m_clickCount members in PlatformMouseEvent constructors
https://bugs.webkit.org/show_bug.cgi?id=169666

Reviewed by Michael Catanzaro.

Initialize the m_button and m_clickCount class members in the GTK+-specific
implementation of PlatformMouseEvent constructors to NoButton and 0,
respectively. The constructors expect to operate on passed-in GTK+ events
that will be able to initialize those two members to some valid values, but
this is not guaranteed.

* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):

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

2 years ago[TexMap] Add missing class member initializations
zandobersek@gmail.com [Wed, 15 Mar 2017 18:02:07 +0000 (18:02 +0000)]
[TexMap] Add missing class member initializations
https://bugs.webkit.org/show_bug.cgi?id=169665

Reviewed by Michael Catanzaro.

Zero-initialize the members in various TextureMapper classes
that are missing the proper initialization, as reported by
the Coverity tool.

* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
* platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:

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

2 years agoCompiled content extensions should include the JSON source
achristensen@apple.com [Wed, 15 Mar 2017 17:59:08 +0000 (17:59 +0000)]
Compiled content extensions should include the JSON source
https://bugs.webkit.org/show_bug.cgi?id=169643

Reviewed by Geoffrey Garen.

Source/WebCore:

Serializing the JSON string from which a content extension was compiled
to disk with the compiled content extension will allow us to validate content
extensions and automatically migrate older content extensions to new versions.
It less than doubles the size of the compiled content extension on disk, and when
interpreting the bytecode that memory is never read, so it doesn't increase our
dirty memory usage.

Covered by new API tests.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:

Source/WebKit2:

* UIProcess/API/APIContentExtensionStore.cpp:
(API::ContentExtensionStore::ContentExtensionStore):
(API::ContentExtensionMetaData::fileSize):
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::ContentExtensionStore::getContentExtensionSource):
* UIProcess/API/APIContentExtensionStore.h:
* UIProcess/API/Cocoa/WKContentExtensionStore.mm:
(toWKErrorCode):
(-[WKContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]):
* UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(toUserContentExtensionStoreError):
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm:
(TEST_F):

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

2 years ago[Modern Media Controls] Captions do not default to Auto when language is changed
commit-queue@webkit.org [Wed, 15 Mar 2017 17:40:59 +0000 (17:40 +0000)]
[Modern Media Controls] Captions do not default to Auto when language is changed
https://bugs.webkit.org/show_bug.cgi?id=169675
<rdar://problem/30423369>

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Eric Carlson.

Source/WebCore:

Ensure we correctly mark the Off and Auto items as selected when we are using the
Off and Auto tracks.

Tests: media/modern-media-controls/tracks-support/tracks-support-auto-text-track.html
       media/modern-media-controls/tracks-support/tracks-support-off-text-track.html

* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
(TracksSupport.prototype.tracksPanelSelectionDidChange):

LayoutTests:

Add new tests that check the cases where the expected selected track should be "Off" or "Auto".

* media/modern-media-controls/tracks-support/tracks-support-auto-text-track-expected.txt: Added.
* media/modern-media-controls/tracks-support/tracks-support-auto-text-track.html: Added.
* media/modern-media-controls/tracks-support/tracks-support-off-text-track-expected.txt: Added.
* media/modern-media-controls/tracks-support/tracks-support-off-text-track.html: Added.

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

2 years agoUse git's -C flag when possible in VCSUtils.pm
commit-queue@webkit.org [Wed, 15 Mar 2017 17:21:00 +0000 (17:21 +0000)]
Use git's -C flag when possible in VCSUtils.pm
https://bugs.webkit.org/show_bug.cgi?id=169003

Patch by Kocsen Chung <kocsen_chung@apple.com> on 2017-03-15
Reviewed by Sam Weinig.

Use the git -C flag where appropriate to perform the
operation on a target directory and avoid unnecessary logic
to `cd` in and out of the target directory.

* Scripts/VCSUtils.pm:
(isGitDirectory):
(isGitSVNDirectory):
(svnRevisionForDirectory):
(svnInfoForPath):
For all four subroutines, use git's -C flag and strip `cd` logic.

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

2 years agoUnreviewed, rolling out r213977.
ryanhaddad@apple.com [Wed, 15 Mar 2017 17:06:55 +0000 (17:06 +0000)]
Unreviewed, rolling out r213977.

This change broke the Windows build.

Reverted changeset:

"Make a base class for WebGL and WebGPU contexts"
https://bugs.webkit.org/show_bug.cgi?id=169651
http://trac.webkit.org/changeset/213977

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

2 years agoMark http/tests/media/modern-media-controls/time-labels-support/long-time.html as...
ryanhaddad@apple.com [Wed, 15 Mar 2017 17:04:33 +0000 (17:04 +0000)]
Mark http/tests/media/modern-media-controls/time-labels-support/long-time.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=169677

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agorun-webkit-tests is always creating mock libwebrtc tracks
commit-queue@webkit.org [Wed, 15 Mar 2017 16:38:10 +0000 (16:38 +0000)]
run-webkit-tests is always creating mock libwebrtc tracks
https://bugs.webkit.org/show_bug.cgi?id=169658

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-15
Reviewed by Alex Christensen.

Source/WebCore:

Tests: webrtc/peer-connection-audio-mute.html
       webrtc/video-mute.html

Creating real libwebrtc av tracks in case of RealTwoPeerConnections mock factory.

* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

* TestExpectations:
* webrtc/audio-peer-connection-webaudio.html:
* webrtc/peer-connection-audio-mute-expected.txt: Added.
* webrtc/peer-connection-audio-mute.html: Added.
* webrtc/routines.js:
(analyseAudio):
* webrtc/video-expected.txt:
* webrtc/video-mute-expected.txt: Added.
* webrtc/video-mute.html: Added.
* webrtc/video.html:

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

2 years agoPreventive clean-up: ensure RTCPeerConnection stays valid when calling postTask
commit-queue@webkit.org [Wed, 15 Mar 2017 16:35:18 +0000 (16:35 +0000)]
Preventive clean-up: ensure RTCPeerConnection stays valid when calling postTask
https://bugs.webkit.org/show_bug.cgi?id=169661

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-15
Reviewed by Alex Christensen.

Source/WebCore:

Protecting the RTCPeerConnection object when calling postTask since it might get collected between the task post
and task run. Also do not send negotiationNeeded event if RTCPeerConnection is closed (covered by added test).

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):

LayoutTests:

* webrtc/negotiatedneeded-event-addStream-expected.txt:
* webrtc/negotiatedneeded-event-addStream.html:

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

2 years agoMark media/modern-media-controls/volume-down-support/volume-down-support.html as...
ryanhaddad@apple.com [Wed, 15 Mar 2017 15:58:18 +0000 (15:58 +0000)]
Mark media/modern-media-controls/volume-down-support/volume-down-support.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169568

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[Modern Media Controls] Always use six digits to display time when overall media...
commit-queue@webkit.org [Wed, 15 Mar 2017 12:42:38 +0000 (12:42 +0000)]
[Modern Media Controls] Always use six digits to display time when overall media duration is an hour or more
https://bugs.webkit.org/show_bug.cgi?id=169668
<rdar://problem/31059699>

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Dean Jackson.

Source/WebCore:

Always use six digits to display times when the overall media duration is an hour or more. This
ensures that we don't display too much white space around labels when we know we will eventually
need six digits to display the full time, but the current time to display is under an hour.

Test: media/modern-media-controls/time-control/time-control-use-six-digits-for-time-labels.html

* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get useSixDigitsForTimeLabels):
(TimeControl.prototype.set useSixDigitsForTimeLabels):
(TimeControl.prototype.set width):
(TimeControl.prototype.get isSufficientlyWide):
(TimeControl.prototype._availableWidthHasChanged):
(TimeControl.prototype.get labelsMayDisplayTimesOverAnHour): Deleted.
(TimeControl.prototype.set labelsMayDisplayTimesOverAnHour): Deleted.
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype._formattedTime):
* Modules/modern-media-controls/media/time-labels-support.js:
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):

LayoutTests:

Rebase some tests due to the rename of the labelsMayDisplayTimesOverAnHour property to
useSixDigitsForTimeLabels. We also add an assertion in long-time.html to check that
we currently use six digits to display a time that is under an hour but where the
media duration is over an hour.

* http/tests/media/modern-media-controls/time-labels-support/long-time-expected.txt:
* http/tests/media/modern-media-controls/time-labels-support/long-time.html:
* media/modern-media-controls/time-control/time-control-use-six-digits-for-time-labels-expected.txt: Renamed from LayoutTests/media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour-expected.txt.
* media/modern-media-controls/time-control/time-control-use-six-digits-for-time-labels.html: Renamed from LayoutTests/media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html.

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

2 years ago[mac-wk1 debug] LayoutTest media/modern-media-controls/airplay-placard/airplay-placar...
commit-queue@webkit.org [Wed, 15 Mar 2017 10:19:04 +0000 (10:19 +0000)]
[mac-wk1 debug] LayoutTest media/modern-media-controls/airplay-placard/airplay-placard-text-section.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=169654
<rdar://problem/31059092>

Patch by Antoine Quint <graouts@apple.com> on 2017-03-15
Reviewed by Dean Jackson.

Using an asynchronous assertion to improve reliability.

* media/modern-media-controls/airplay-placard/airplay-placard-text-section-expected.txt:
* media/modern-media-controls/airplay-placard/airplay-placard-text-section.html:

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

2 years agoSort Xcode project files
dino@apple.com [Wed, 15 Mar 2017 09:51:49 +0000 (09:51 +0000)]
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=169669

Reviewed by Antoine Quint.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:

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

2 years agoMake a base class for WebGL and WebGPU contexts
dino@apple.com [Wed, 15 Mar 2017 09:43:12 +0000 (09:43 +0000)]
Make a base class for WebGL and WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=169651
<rdar://problem/31053489>

Reviewed by Simon Fraser.

Add a new pure virtual base class, GPUBasedCanvasRenderingContext, that
will be used by WebGL and WebGPU rendering contexts. This allows us
to avoid some code duplication, since many places treat the two
as the same.

Also rename is3d() -> isWebGL() and isGPU() -> isWebGPU().

* WebCore.xcodeproj/project.pbxproj: New file.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPUBased):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::isGPU): Deleted.
(WebCore::HTMLCanvasElement::is3D): Deleted.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGL):
(WebCore::CanvasRenderingContext::isWebGPU):
(WebCore::CanvasRenderingContext::isGPUBased):
(WebCore::CanvasRenderingContext::is3d): Deleted.
(WebCore::CanvasRenderingContext::isGPU): Deleted.
* html/canvas/GPUBasedCanvasRenderingContext.h: Added.
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* html/canvas/WebGPURenderingContext.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):

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

2 years agoRewrite 'pull-os-versions' script in Javascript to add support for reporting os revis...
dewei_zhu@apple.com [Wed, 15 Mar 2017 08:35:07 +0000 (08:35 +0000)]
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits.
https://bugs.webkit.org/show_bug.cgi?id=169542

Reviewed by Ryosuke Niwa.

Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range.
Rewrite 'pull-os-versions' in JavaScript and add unit tests for it.
Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'.
Add '.gitignore' file to ommit files generated by while running tests/instances locally.

* .gitignore: Added.
* public/api/commits.php:
* public/api/report-commits.php:
* public/include/commit-log-fetcher.php:
* public/include/db.php: 'null_columns' of prepare_params should be a reference.
* public/include/report-processor.php:
* server-tests/api-commits.js:
(then):
* server-tests/api-report-commits-tests.js:
* server-tests/resources/mock-logger.js: Added.
(MockLogger):
(MockLogger.prototype.log):
(MockLogger.prototype.error):
* server-tests/resources/mock-subprocess.js: Added.
(MockSubprocess.call):
(MockSubprocess.waitingForInvocation):
(MockSubprocess.inject):
(MockSubprocess.reset):
* server-tests/tools-buildbot-triggerable-tests.js:
(MockLogger): Deleted.
(MockLogger.prototype.log): Deleted.
(MockLogger.prototype.error): Deleted.
* server-tests/tools-os-build-fetcher-tests.js: Added.
(beforeEach):
(return.waitingForInvocationPromise.then):
(then):
(string_appeared_here.return.waitingForInvocationPromise.then):
(return.addSlaveForReport.emptyReport.then):
* tools/js/os-build-fetcher.js: Added.
(OSBuildFetcher):
(OSBuildFetcher.prototype._fetchAvailableBuilds):
(OSBuildFetcher.prototype._computeOrder):
(OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.):
(OSBuildFetcher.prototype._commitsForAvailableBuilds):
(OSBuildFetcher.prototype._addSubCommitsForBuild):
(OSBuildFetcher.prototype._submitCommits):
(OSBuildFetcher.prototype.fetchAndReportNewBuilds):
* tools/js/subprocess.js: Added.
(const.childProcess.require.string_appeared_here.Subprocess.prototype.call):
(const.childProcess.require.string_appeared_here.Subprocess):
* tools/pull-os-versions.js: Added.
(main):
(syncLoop):
* tools/sync-commits.py:
(Repository.fetch_commits_and_submit):

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

2 years agoUnreviewed GTK+ build fix. Sprinkle ENABLE(MEDIA_STREAM) build guards
zandobersek@gmail.com [Wed, 15 Mar 2017 07:47:11 +0000 (07:47 +0000)]
Unreviewed GTK+ build fix. Sprinkle ENABLE(MEDIA_STREAM) build guards
in the Internals class to avoid compilation failures when building
with this feature disabled.

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

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

2 years agostart-queue-mac.sh should create logs directory if it doesn't exist
aakash_jain@apple.com [Wed, 15 Mar 2017 06:18:35 +0000 (06:18 +0000)]
start-queue-mac.sh should create logs directory if it doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=169634

Reviewed by Alexey Proskuryakov.

* EWSTools/start-queue-mac.sh: Creating logs directory if it doesn't exist.

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

2 years agoWrong condition in offlineasm/risc.rb
tpopela@redhat.com [Wed, 15 Mar 2017 05:52:08 +0000 (05:52 +0000)]
Wrong condition in offlineasm/risc.rb
https://bugs.webkit.org/show_bug.cgi?id=169597

Reviewed by Mark Lam.

It's missing the 'and' operator between the conditions.

* offlineasm/risc.rb:

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

2 years agoCanvasCapture should not generate a frame per each canvas draw command
commit-queue@webkit.org [Wed, 15 Mar 2017 05:21:06 +0000 (05:21 +0000)]
CanvasCapture should not generate a frame per each canvas draw command
https://bugs.webkit.org/show_bug.cgi?id=169498

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-14
Reviewed by Simon Fraser & Eric Carlson.

Source/WebCore:

Test: fast/mediastream/captureStream/canvas2d-heavy-drawing.html

Making Canvas capture be asynchronous.
This ensures that one frame will be created for a set of synchronous draw commands.
In the future, we should find a better approach, like aligning with requestAnimationFrame.
Adding internals observer API for media stream tracks.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/RealtimeMediaSource.h:
* testing/Internals.cpp:
(WebCore::Internals::~Internals):
(WebCore::Internals::observeMediaStreamTrack):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/mediastream/captureStream/canvas2d-heavy-drawing-expected.txt: Added.
* fast/mediastream/captureStream/canvas2d-heavy-drawing.html: Added.

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

2 years agoUnreviewed, skip fast/media/video-element-in-details-collapse.html on iOS
wenson_hsieh@apple.com [Wed, 15 Mar 2017 03:28:08 +0000 (03:28 +0000)]
Unreviewed, skip fast/media/video-element-in-details-collapse.html on iOS

* platform/ios-simulator/TestExpectations:

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

2 years ago[iOS] -[WKWebView _dataForDisplayedPDF] returns nil when called before an encrypted...
aestes@apple.com [Wed, 15 Mar 2017 03:27:43 +0000 (03:27 +0000)]
[iOS] -[WKWebView _dataForDisplayedPDF] returns nil when called before an encrypted PDF has been unlocked
https://bugs.webkit.org/show_bug.cgi?id=169653
<rdar://problem/24137675>

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView pdfDocument]): Changed to return _cgPDFDocument directly instead of via the
UIPDFDocument, which is only created after the PDF has been unlocked.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/encrypted.pdf: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKPDFView.mm: Added.
(runTest):
(TEST):

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

2 years agoMake server tests return a promise instead of manually calling done
rniwa@webkit.org [Wed, 15 Mar 2017 03:19:02 +0000 (03:19 +0000)]
Make server tests return a promise instead of manually calling done
https://bugs.webkit.org/show_bug.cgi?id=169648

Rubber-stamped by Chris Dumez.

Make the existing server tests always reutrn a promise instead of manually calling "done" callback.
The promise tests are a lot more stable and less error prone.

Also use arrow functions everywhere and use prepareServerTest, renamed from connectToDatabaseInEveryTest,
in more tests instead of manually connecting to database in every test, and reset v3 models.

* server-tests/admin-platforms-tests.js:
* server-tests/admin-reprocess-report-tests.js:
* server-tests/api-build-requests-tests.js:
* server-tests/api-manifest.js:
* server-tests/api-measurement-set-tests.js:
(.postReports): Deleted. Not used in any test.
* server-tests/api-report-commits-tests.js:
* server-tests/api-report-tests.js:
* server-tests/api-update-triggerable.js:
* server-tests/privileged-api-upate-run-status.js:
* server-tests/resources/common-operations.js:
(prepareServerTest): Renamed from connectToDatabaseInEveryTest. Increase the timeout and reset v3 models.
* server-tests/tools-buildbot-triggerable-tests.js:

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

2 years agoREGRESSION (r213882): 12 new/updated web-platform-tests failing
commit-queue@webkit.org [Wed, 15 Mar 2017 02:08:37 +0000 (02:08 +0000)]
REGRESSION (r213882): 12 new/updated web-platform-tests failing
https://bugs.webkit.org/show_bug.cgi?id=169615

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-14

* TestExpectations: Marking tests requiring updated wptserver as failing.

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

2 years agoRenderElements should unregister for viewport visibility callbacks when they are...
wenson_hsieh@apple.com [Wed, 15 Mar 2017 01:20:57 +0000 (01:20 +0000)]
RenderElements should unregister for viewport visibility callbacks when they are destroyed
https://bugs.webkit.org/show_bug.cgi?id=169521
<rdar://problem/30959545>

Reviewed by Simon Fraser.

Source/WebCore:

When registering a RenderElement for viewport visibility callbacks, we always need to make sure that it is unregistered
before it is destroyed. While we account for this in the destructor of RenderElement, we only unregister in the destructor
if we are already registered for visibility callbacks. In the call to RenderObject::willBeDestroyed(), we clear out rare
data, which holds RenderElement's viewport callback registration state, so upon entering the destructor of RenderElement,
we skip unregistration because RenderElement thinks that it is not registered.

We can mitigate this by unregistering the RenderElement earlier, in RenderElement::willBeDestroyed, prior to clearing out
the rare data. However, we'd ideally want to move the cleanup logic out of the destructor altogether and into willBeDestroyed
(see https://bugs.webkit.org/show_bug.cgi?id=169650).

Test: fast/media/video-element-in-details-collapse.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):

LayoutTests:

Adds a new layout test covering this regression. See WebCore ChangeLog for more details.

* fast/media/video-element-in-details-collapse-expected.txt: Added.
* fast/media/video-element-in-details-collapse.html: Added.

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

2 years agoBytecodeGenerator should use the same function to determine if it needs to store...
mark.lam@apple.com [Wed, 15 Mar 2017 00:53:17 +0000 (00:53 +0000)]
BytecodeGenerator should use the same function to determine if it needs to store the DerivedConstructor in an ArrowFunction lexical environment.
https://bugs.webkit.org/show_bug.cgi?id=169647
<rdar://problem/31051832>

Reviewed by Michael Saboff.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::usesDerivedConstructorInArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
(JSC::BytecodeGenerator::emitPutDerivedConstructorToArrowFunctionContextScope):
* bytecompiler/BytecodeGenerator.h:

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

2 years agoRename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
dino@apple.com [Wed, 15 Mar 2017 00:17:27 +0000 (00:17 +0000)]
Rename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=169628
<rdar://problems/31047025>

Fix Windows build.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printLayer):

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

2 years agoWeb Inspector: Exception when fetching computed styles can break future updates of...
commit-queue@webkit.org [Wed, 15 Mar 2017 00:05:27 +0000 (00:05 +0000)]
Web Inspector: Exception when fetching computed styles can break future updates of section
https://bugs.webkit.org/show_bug.cgi?id=169638
<rdar://problem/30588688>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-14
Reviewed by Devin Rousso.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.wrap):
(WebInspector.DOMNodeStyles.prototype.refresh):
Gracefully handle exceptions. If an exception did happen we
would be unable to update these in the future.

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

2 years ago[Cocoa] Web Inspector: generated code for parsing an array of primitive-type enums...
bburg@apple.com [Tue, 14 Mar 2017 23:44:01 +0000 (23:44 +0000)]
[Cocoa] Web Inspector: generated code for parsing an array of primitive-type enums from payload does not work
https://bugs.webkit.org/show_bug.cgi?id=169629

Reviewed by Joseph Pecoraro.

This was encountered while trying to compile new protocol definitions that support the Actions API.

* inspector/scripts/codegen/models.py:
(EnumType.__repr__): Improve debug logging so fields match the class member names.

* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.payload_to_objc_expression_for_member):
If the array elements are actually a primitive type, then there's no need to do any
conversion from a payload. This happens for free since the payload is a tree of
NSDictionary, NSString, NSNumber, etc.

* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
Rebaseline.

* inspector/scripts/tests/generic/type-declaration-object-type.json:
Add new cases for properties that contain an array with enum type references and an array of anonymous enums.

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

2 years agoLet PDFLayerController drive cursor updates so that it's correct more often
timothy_horton@apple.com [Tue, 14 Mar 2017 23:18:55 +0000 (23:18 +0000)]
Let PDFLayerController drive cursor updates so that it's correct more often
https://bugs.webkit.org/show_bug.cgi?id=169626
<rdar://problem/30762943>

Reviewed by Simon Fraser.

* WebProcess/Plugins/PDF/DeprecatedPDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(-[WKPDFLayerControllerDelegate setMouseCursor:]):
(WebKit::PDFPlugin::handleMouseEvent):
(WebKit::PDFPlugin::handleMouseEnterEvent):
(WebKit::pdfLayerControllerCursorTypeToCursor):
(WebKit::PDFPlugin::notifyCursorChanged):
Disable updateCursor and use the setMouseCursor delegate method when possible.

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

2 years agoUpdate ApplePaySession.html after r213949
aestes@apple.com [Tue, 14 Mar 2017 23:17:55 +0000 (23:17 +0000)]
Update ApplePaySession.html after r213949

Rubber-stamped by Beth Dakin.

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:

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

2 years agoRename RootSet to CommitSet
rniwa@webkit.org [Tue, 14 Mar 2017 23:06:40 +0000 (23:06 +0000)]
Rename RootSet to CommitSet
https://bugs.webkit.org/show_bug.cgi?id=169580

Rubber-stamped by Chris Dumez.

Renamed root_sets to commit_sets and roots to commit_set_relationships in the database schema, and renamed
related classes in public/v3/ and tools accordingly.

RootSet, MeasurementRootSet, and CustomRootSet are respectively renamed to CommitSet, MeasurementCommitSet,
and CustomCommitSet.

In order to migrate the database, run:
```
BEGIN;
ALTER TABLE root_sets RENAME TO commit_sets;
ALTER TABLE commit_sets RENAME COLUMN rootset_id TO commitset_id;
ALTER TABLE roots RENAME TO commit_set_relationships;
ALTER TABLE commit_set_relationships RENAME COLUMN root_set TO commitset_set;
ALTER TABLE commit_set_relationships RENAME COLUMN root_commit TO commitset_commit;
ALTER TABLE build_requests RENAME COLUMN request_root_set TO request_commit_set;
END;
```

* browser-tests/index.html:
* init-database.sql:
* public/api/build-requests.php:
(main):
* public/api/test-groups.php:
(main):
(format_test_group):
* public/include/build-requests-fetcher.php:
(BuildRequestsFetcher::__construct):
(BuildRequestsFetcher::results_internal):
(BuildRequestsFetcher::commit_sets): Renamed from root_sets.
(BuildRequestsFetcher::commits): Renamed from roots.
(BuildRequestsFetcher::fetch_commits_for_set_if_needed): Renamed from fetch_roots_for_set_if_needed.
* public/privileged-api/create-test-group.php:
(main):
(ensure_commit_sets): Renamed from commit_sets_from_root_sets.
* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer.prototype.buildRowGroups):
(AnalysisResultsViewer.prototype._collectCommitSetsInTestGroups): Renamed from _collectRootSetsInTestGroups.
(AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
(AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
(AnalysisResultsViewer.CommitSetInTestGroup): Renamed from RootSetInTestGroup.
(AnalysisResultsViewer.CommitSetInTestGroup.prototype.constructor):
(AnalysisResultsViewer.CommitSetInTestGroup.prototype.commitSet): Renamed from rootSet.
(AnalysisResultsViewer.CommitSetInTestGroup.prototype.succeedingCommitSet): Renamed from succeedingRootSet.
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.constructor):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.isComplete):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.startRowIndex):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.endRowIndex):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
* public/v3/components/chart-revision-range.js:
(ChartRevisionRange.prototype._revisionForPoint):
(ChartRevisionRange.prototype._computeRevisionList):
* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm.prototype.constructor):
(CustomizableTestGroupForm.prototype.setCommitSetMap): Renamed from setRootSetMap.
(CustomizableTestGroupForm.prototype._submitted):
(CustomizableTestGroupForm.prototype._computeCommitSetMap): Renamed from _computeRootSetMap.
(CustomizableTestGroupForm.prototype.render): Renamed from render.
(CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):
* public/v3/components/results-table.js:
(ResultsTable.prototype.render):
(ResultsTable.prototype._createRevisionListCells):
(ResultsTable.prototype._computeRepositoryList):
(ResultsTableRow.prototype.constructor):
(ResultsTableRow.prototype.commitSet): Renamed from rootSet.
* public/v3/components/test-group-results-table.js:
(TestGroupResultsTable.prototype.buildRowGroups):
* public/v3/index.html:
* public/v3/models/build-request.js:
(BuildRequest.prototype.constructor):
(BuildRequest.prototype.updateSingleton):
(BuildRequest.prototype.commitSet): Renamed from rootSet.
(BuildRequest.constructBuildRequestsFromData):
* public/v3/models/commit-set.js: Renamed from public/v3/models/root-set.js.
(CommitSet): Renamed from RootSet.
(CommitSet.containsMultipleCommitsForRepository):
(MeasurementCommitSet): Renamed from MeasurementRootSet.
(MeasurementCommitSet.prototype.namedStaticMap):
(MeasurementCommitSet.prototype.ensureNamedStaticMap):
(MeasurementCommitSet.namedStaticMap):
(MeasurementCommitSet.ensureNamedStaticMap):
(MeasurementCommitSet.ensureSingleton):
(CustomCommitSet): Renamed from CustomRootSet.
* public/v3/models/measurement-adaptor.js:
(MeasurementAdaptor.prototype.applyTo):
* public/v3/models/test-group.js:
(TestGroup.prototype.constructor):
(TestGroup.prototype.addBuildRequest):
(TestGroup.prototype.repetitionCount):
(TestGroup.prototype.requestedCommitSets): Renamed from requestedRootSets.
(TestGroup.prototype.requestsForCommitSet): Renamed from requestsForRootSet.
(TestGroup.prototype.labelForCommitSet): Renamed from labelForRootSet.
(TestGroup.prototype.didSetResult):
(TestGroup.prototype.compareTestResults):
(TestGroup.prototype._valuesForCommitSet): Renamed from _valuesForRootSet.
(TestGroup.prototype.createAndRefetchTestGroups):
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage.prototype.render):
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype._createNewTestGroupFromChart):
(AnalysisTaskPage.prototype._createNewTestGroupFromViewer):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
* server-tests/api-build-requests-tests.js:
* server-tests/resources/mock-data.js:
(MockData.resetV3Models):
(MockData.addMockData):
(MockData.addAnotherMockTestGroup):
* tools/detect-changes.js:
(createAnalysisTaskAndNotify):
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._propertiesForBuildRequest):
(BuildbotSyncer.prototype._revisionSetFromCommitSetWithExclusionList):
* tools/js/database.js:
(tableToPrefixMap):
* tools/js/v3-models.js:
* tools/sync-buildbot.js:
(syncLoop):
* tools/sync-with-buildbot.py: Deleted. No longer used.
* unit-tests/analysis-task-tests.js:
* unit-tests/build-request-tests.js:
(sampleBuildRequestData):
* unit-tests/buildbot-syncer-tests.js:
(sampleCommitSetData):
* unit-tests/measurement-adaptor-tests.js:
* unit-tests/measurement-set-tests.js:
* unit-tests/resources/mock-v3-models.js:
(MockModels.inject):
* unit-tests/test-groups-tests.js:
(sampleTestGroup):

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

2 years agoMark imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler...
ryanhaddad@apple.com [Tue, 14 Mar 2017 23:03:47 +0000 (23:03 +0000)]
Mark imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-javascript.html as failing on ios-simulator-wk2.
https://bugs.webkit.org/show_bug.cgi?id=169640

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoMark imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler...
ryanhaddad@apple.com [Tue, 14 Mar 2017 22:59:50 +0000 (22:59 +0000)]
Mark imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-javascript.html as failing on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=169640

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoREGRESSION (r209760): Apple Pay doesn't work on sites that specify empty contact...
aestes@apple.com [Tue, 14 Mar 2017 22:53:32 +0000 (22:53 +0000)]
REGRESSION (r209760): Apple Pay doesn't work on sites that specify empty contact fields
https://bugs.webkit.org/show_bug.cgi?id=169639
<rdar://problem/30957789>

Reviewed by Anders Carlsson.

Shipping and billing contact fields are allowed to be empty.

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

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

2 years agoExtend WKPreferences to include preferences for testing MediaCapture.
commit-queue@webkit.org [Tue, 14 Mar 2017 22:38:21 +0000 (22:38 +0000)]
Extend WKPreferences to include preferences for testing MediaCapture.
https://bugs.webkit.org/show_bug.cgi?id=169560

Patch by Andrew Gold <agold@apple.com> on 2017-03-14
Reviewed by Youenn Fablet.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mockCaptureDevicesEnabled]):
(-[WKPreferences _setMockCaptureDevicesEnabled:]):
(-[WKPreferences _mediaCaptureRequiresSecureConnection]):
(-[WKPreferences _setMediaCaptureRequiresSecureConnection:]):
(-[WKPreferences _enumeratingAllNetworkInterfacesEnabled]):
(-[WKPreferences _setEnumeratingAllNetworkInterfacesEnabled:]):
(-[WKPreferences _iceCandidateFiltertingEnabled]):
(-[WKPreferences _setICECandidateFilteringEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

2 years agoRename WKHTTPCookieStorage to WKHTTPCookieStore.
beidson@apple.com [Tue, 14 Mar 2017 22:36:52 +0000 (22:36 +0000)]
Rename WKHTTPCookieStorage to WKHTTPCookieStore.
https://bugs.webkit.org/show_bug.cgi?id=169630

Reviewed by Tim Horton.

Source/WebKit2:

* CMakeLists.txt:

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

* UIProcess/API/APIHTTPCookieStore.cpp: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp.
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::removeCookiesSinceDate):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::getHTTPCookieAcceptPolicy):
* UIProcess/API/APIHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::httpCookieStore):
(API::WebsiteDataStore::httpCookieStorage): Deleted.
* UIProcess/API/APIWebsiteDataStore.h:

* UIProcess/API/Cocoa/WKHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h.
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm.
(coreCookiesToNSCookies):
(-[WKHTTPCookieStore dealloc]):
(-[WKHTTPCookieStore fetchCookies:]):
(-[WKHTTPCookieStore fetchCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStore setCookie:completionHandler:]):
(-[WKHTTPCookieStore deleteCookie:completionHandler:]):
(-[WKHTTPCookieStore setCookies:forURL:mainDocumentURL:completionHandler:]):
(-[WKHTTPCookieStore removeCookiesSinceDate:completionHandler:]):
(-[WKHTTPCookieStore setCookieAcceptPolicy:completionHandler:]):
(kitCookiePolicyToNSCookiePolicy):
(-[WKHTTPCookieStore fetchCookieAcceptPolicy:]):
(-[WKHTTPCookieStore _apiObject]):
* UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h.
(WebKit::wrapper):

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _httpCookieStore]):
(-[WKWebsiteDataStore _httpCookieStorage]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):

* WebKit2.xcodeproj/project.pbxproj:

Tools:

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

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

2 years agoPropagate PassKit errors
andersca@apple.com [Tue, 14 Mar 2017 22:32:10 +0000 (22:32 +0000)]
Propagate PassKit errors
https://bugs.webkit.org/show_bug.cgi?id=169633
rdar://problem/31043392

Reviewed by Dean Jackson.

Source/WebCore:

* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convert):
(WebCore::convertAndValidate):
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

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

2 years agoFix some typos in this benchmark.
fpizlo@apple.com [Tue, 14 Mar 2017 22:23:06 +0000 (22:23 +0000)]
Fix some typos in this benchmark.

Rubber stamped by Saam Barati.

* benchmarks/HashSetDFGReplay.cpp:
(main):

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

2 years agoSimple line layout: Adjust hyphenation constrains based on the normal line layout...
zalan@apple.com [Tue, 14 Mar 2017 21:58:39 +0000 (21:58 +0000)]
Simple line layout: Adjust hyphenation constrains based on the normal line layout line-breaking logic.
https://bugs.webkit.org/show_bug.cgi?id=169617

Source/WebCore:

Reviewed by Antti Koivisto.

This patch ensures that simple line layout ends up with the same hyphenation context as normal line layout.

Test: fast/text/simple-line-layout-hyphenation-constrains.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::hyphenPositionForFragment): see webkit.org/b/169613
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
* rendering/line/BreakingContext.h: Integral -> fractional.
(WebCore::tryHyphenating):

LayoutTests:

Reviewed by Antti Koivisto.

* fast/text/simple-line-layout-hyphenation-constrains-expected.html: Added.
* fast/text/simple-line-layout-hyphenation-constrains.html: Added.

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

2 years agoWeb Inspector: RTL: add support for Memory timeline
webkit@devinrousso.com [Tue, 14 Mar 2017 21:41:51 +0000 (21:41 +0000)]
Web Inspector: RTL: add support for Memory timeline
https://bugs.webkit.org/show_bug.cgi?id=169584

Reviewed by Brian Burg.

* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view > .details):
(body[dir=ltr] .memory-category-view > .details):
(body[dir=rtl] .memory-category-view > .details):

* UserInterface/Views/MemoryTimelineOverviewGraph.css:
(.timeline-overview-graph.memory > .legend):
(body[dir=ltr] .timeline-overview-graph.memory > .legend):
(body[dir=rtl] .timeline-overview-graph.memory > .legend):
(.timeline-overview-graph.memory .memory-pressure-event):
(body[dir=ltr] .timeline-overview-graph.memory .memory-pressure-event):
(body[dir=rtl] .timeline-overview-graph.memory .memory-pressure-event):

* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WebInspector.MemoryTimelineOverviewGraph.prototype.layout):
Rework the calculation for the marker offset to use "right" in RTL.

* UserInterface/Views/MemoryTimelineView.css:
(.timeline-view.memory > .content > .details > .timeline-ruler):
(body[dir=ltr] .timeline-view.memory > .content > .details > .timeline-ruler):
(body[dir=rtl] .timeline-view.memory > .content > .details > .timeline-ruler):
(.timeline-view.memory > .content > .overview > .divider):
(body[dir=ltr] .timeline-view.memory > .content > .overview > .divider):
(body[dir=rtl] .timeline-view.memory > .content > .overview > .divider):
(.timeline-view.memory .legend):
(body[dir=ltr] .timeline-view.memory .legend):
(body[dir=rtl] .timeline-view.memory .legend):
(.timeline-view.memory .legend > .row):
(.timeline-view.memory .legend > .row > .swatch):
(body[dir=ltr] .timeline-view.memory .legend > .row > .swatch):
(body[dir=rtl] .timeline-view.memory .legend > .row > .swatch):
(body[dir=ltr] .timeline-view.memory .legend > .row > :matches(.label, .size)):
(body[dir=rtl] .timeline-view.memory .legend > .row > :matches(.label, .size)):
(.timeline-view.memory .legend > .row > .label):
(.timeline-view.memory .legend > .row > .size):

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

2 years agoRefactor: Allow WebKit2 to override the creation of RealtimeMediaSources
jer.noble@apple.com [Tue, 14 Mar 2017 21:41:48 +0000 (21:41 +0000)]
Refactor: Allow WebKit2 to override the creation of RealtimeMediaSources
https://bugs.webkit.org/show_bug.cgi?id=169227

Reviewed by Eric Carlson.

Source/WebCore:

Allow clients of RealtimeMediaSourceCenter to specify a factory for creating
RealtimeMediaSources, to be used by subclasess of RealtimeMediaSourceCenter. Add virtual
methods to retrieve the "default" factories for the RealtimeMediaSourceCenter subclass. The
requires moving the creation of sources up from CaptureDeviceManager into
RealtimeMediaSourceCenterMac, and the addition of factory methods to AVAudioCaptureSource
and AVVideoCaptureSource.

* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::deviceWithUID):
(CaptureDeviceManager::bestSourcesForTypeAndConstraints): Deleted.
(CaptureDeviceManager::sourceWithUID): Deleted.
* platform/mediastream/CaptureDeviceManager.h:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::factory):
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::factory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
(WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
(WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::factory):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
(WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::factory):
* platform/mock/MockRealtimeVideoSource.h:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::WebUserMediaClient):
(WebKit::WebUserMediaClient::initializeFactories): Add empty non-Cocoa implementation.
* WebProcess/WebCoreSupport/WebUserMediaClient.h:
* WebProcess/WebCoreSupport/cocoa/WebUserMediaClientMac.mm: Added.
(WebKit::WebUserMediaClient::initializeFactories): Initialize a (for now) pass-through factory.

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

2 years agoRename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
dino@apple.com [Tue, 14 Mar 2017 21:39:22 +0000 (21:39 +0000)]
Rename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=169628
<rdar://problems/31047025>

Reviewed by Simon Fraser.

Rename LayerTypeWebGLLayer to LayerTypeContentsProvidedLayer
and use it for both WebGLLayer and WebGPULayer, to avoid
code duplication.

Source/WebCore:

* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::layerTypeForPlatformLayer):
(PlatformCALayerCocoa::PlatformCALayerCocoa):
(PlatformCALayerCocoa::commonInit):

Source/WebKit2:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(WebKit::PlatformCALayerRemoteCustom::clone):

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

2 years agoRecord the HashSet/HashMap operations in DFG/FTL/B3 and replay them in a benchmark
fpizlo@apple.com [Tue, 14 Mar 2017 21:37:41 +0000 (21:37 +0000)]
Record the HashSet/HashMap operations in DFG/FTL/B3 and replay them in a benchmark
https://bugs.webkit.org/show_bug.cgi?id=169590

Reviewed by Saam Barati.

Source/JavaScriptCore:

Adds code to support logging some hashtable stuff in the DFG.

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::pruneHeap):
* dfg/DFGCombinedLiveness.cpp:
(JSC::DFG::liveNodesAtHead):
(JSC::DFG::CombinedLiveness::CombinedLiveness):
* dfg/DFGCombinedLiveness.h:
* dfg/DFGLivenessAnalysisPhase.cpp:
(JSC::DFG::LivenessAnalysisPhase::run):
(JSC::DFG::LivenessAnalysisPhase::processBlock):
* dfg/DFGNode.cpp:
* dfg/DFGNode.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:

Source/WTF:

This adds LoggingHashSet and LoggingHashMap, which are drop-in replacements for HashSet and
HashMap that log everything that they do, so that you can replay it later.

This also adds a benchmark (HashSetDFGReplay) based on doing a recording of some of the HashSets
in the DFG compiler.

* WTF.xcodeproj/project.pbxproj:
* benchmarks/HashSetDFGReplay.cpp: Added.
(benchmark):
(main):
* wtf/CMakeLists.txt:
* wtf/GlobalVersion.cpp: Added.
(WTF::newGlobalVersion):
* wtf/GlobalVersion.h: Added.
* wtf/HashMap.h:
(WTF::X>::swap):
* wtf/HashSet.h:
(WTF::V>::addVoid):
* wtf/LoggingHashID.h: Added.
(WTF::LoggingHashID::LoggingHashID):
(WTF::LoggingHashID::dump):
* wtf/LoggingHashMap.h: Added.
* wtf/LoggingHashSet.h: Added.
* wtf/LoggingHashTraits.h: Added.
(WTF::LoggingHashKeyTraits::print):
(WTF::LoggingHashValueTraits::print):

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

2 years agoMark imported/w3c/web-platform-tests/cors/status.htm as flaky.
ryanhaddad@apple.com [Tue, 14 Mar 2017 21:16:09 +0000 (21:16 +0000)]
Mark imported/w3c/web-platform-tests/cors/status.htm as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169625

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMake classes used by Media Stream encode/decode friendly
jer.noble@apple.com [Tue, 14 Mar 2017 20:50:47 +0000 (20:50 +0000)]
Make classes used by Media Stream encode/decode friendly
https://bugs.webkit.org/show_bug.cgi?id=169567

Reviewed by Eric Carlson.

Source/WebCore:

Add encode() and decode() methods and implementations to a variety of media stream related classes.

* platform/audio/mac/CAAudioStreamDescription.h:
(WebCore::CAAudioStreamDescription::encode):
(WebCore::CAAudioStreamDescription::decode):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::width):
(WebCore::RealtimeMediaSourceSettings::setWidth):
(WebCore::RealtimeMediaSourceSettings::height):
(WebCore::RealtimeMediaSourceSettings::setHeight):
(WebCore::RealtimeMediaSourceSettings::sampleRate):
(WebCore::RealtimeMediaSourceSettings::setSampleRate):
(WebCore::RealtimeMediaSourceSettings::sampleSize):
(WebCore::RealtimeMediaSourceSettings::setSampleSize):
(WebCore::RealtimeMediaSourceSettings::encode):
(WebCore::RealtimeMediaSourceSettings::decode):
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
(WebCore::RealtimeMediaSourceSupportedConstraints::encode):
(WebCore::RealtimeMediaSourceSupportedConstraints::decode):

Source/WebKit2:

Make the encoder and decoder for MediaConstraintsData a little less wordy.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaConstraintsData>::encode):
(IPC::ArgumentCoder<MediaConstraintsData>::decode):

Source/WTF:

* wtf/MediaTime.h:
(WTF::MediaTime::encode):
(WTF::MediaTime::decode):

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

2 years agoAdapt CARingBuffer to be usable across processes
jer.noble@apple.com [Tue, 14 Mar 2017 20:45:52 +0000 (20:45 +0000)]
Adapt CARingBuffer to be usable across processes
https://bugs.webkit.org/show_bug.cgi?id=169591

Reviewed by Alex Christensen.

Source/WebCore:

When used with a SharedMemory backing store, storing the pointers to channel data at the beginning
of the channel data itself is problematic: when the SharedMemory is mapped on the far side of the
process boundary, it will not exist at the same memory location as it did on the near side. Instead
of storing these pointers inside the channel data, store them in a small (usually 1 or 2 entry) vector
recreated when the backing store is (re-)allocated.

* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::CARingBuffer):
(WebCore::CARingBuffer::allocate):
(WebCore::CARingBuffer::deallocate):
(WebCore::ZeroRange):
(WebCore::StoreABL):
(WebCore::FetchABL):
(WebCore::CARingBuffer::store):
(WebCore::CARingBuffer::getCurrentFrameBounds):
(WebCore::CARingBuffer::fetch):
* platform/audio/mac/CARingBuffer.h:

Source/WebKit2:

Add a new class which wraps a SharedMemory object and uses that shared memory as the
backing store of a CARingBuffer. This backing store can be set to "read only", which
prevents the backing from being de- or re-allocated.

* WebKit2.xcodeproj/project.pbxproj:
* Shared/Cocoa/SharedRingBufferStorage.cpp: Added.
(WebKit::SharedRingBufferStorage::setStorage):
(WebKit::SharedRingBufferStorage::setReadOnly):
(WebKit::SharedRingBufferStorage::allocate):
(WebKit::SharedRingBufferStorage::deallocate):
(WebKit::SharedRingBufferStorage::data):
* Shared/Cocoa/SharedRingBufferStorage.h: Added.
(WebKit::SharedRingBufferStorage::SharedRingBufferStorage):
(WebKit::SharedRingBufferStorage::invalidate):
(WebKit::SharedRingBufferStorage::storage):
(WebKit::SharedRingBufferStorage::readOnly):

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

2 years agoMark imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html as...
ryanhaddad@apple.com [Tue, 14 Mar 2017 20:07:16 +0000 (20:07 +0000)]
Mark imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=169621

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[iOS] The web process should inherit application state from UI process
eric.carlson@apple.com [Tue, 14 Mar 2017 20:03:32 +0000 (20:03 +0000)]
[iOS] The web process should inherit application state from UI process
https://bugs.webkit.org/show_bug.cgi?id=169156
<rdar://problem/30845473>

Reviewed by Brady Eidson.

Move PID proxy setup to platformInitializeWebProcess as suggested in
post-landing feedback.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

2 years agoWeb Inspector: Remove unused Network protocol event
commit-queue@webkit.org [Tue, 14 Mar 2017 20:01:45 +0000 (20:01 +0000)]
Web Inspector: Remove unused Network protocol event
https://bugs.webkit.org/show_bug.cgi?id=169619

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-14
Reviewed by Mark Lam.

* inspector/protocol/Network.json:
This became unused in r213621 and should have been removed
from the protocol file then.

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

2 years agoPulling more frames from AudioSampleDataSource than the last push added will always...
jer.noble@apple.com [Tue, 14 Mar 2017 19:57:11 +0000 (19:57 +0000)]
Pulling more frames from AudioSampleDataSource than the last push added will always fail.
https://bugs.webkit.org/show_bug.cgi?id=168644

Reviewed by Eric Carlson.

Rather than use the delta between the ring buffer's end time and the last pushed timestamp
(or what is effectively the number of samples in the last push operation) to determine if
there is enough buffered data to satisfy a pull operation, use the ring buffer's actual
buffered duration.

Then, instead of saving the last pushed timestamp, explicitly save the last push count, and
use that data to inform how much to offset the output timestamps (or what is effectively how
much to allow the source to pre-buffer).

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
* platform/audio/mac/AudioSampleDataSource.h:

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

2 years agoAdd a null check in VMTraps::willDestroyVM() to handle a race condition.
mark.lam@apple.com [Tue, 14 Mar 2017 19:29:26 +0000 (19:29 +0000)]
Add a null check in VMTraps::willDestroyVM() to handle a race condition.
https://bugs.webkit.org/show_bug.cgi?id=169620

Reviewed by Filip Pizlo.

There exists a race between VMTraps::willDestroyVM() (which removed SignalSenders
from its m_signalSenders list) and SignalSender::send() (which removes itself
from the list).  In the event that SignalSender::send() removes itself between
the time that VMTraps::willDestroyVM() checks if m_signalSenders is empty and the
time it takes a sender from m_signalSenders, VMTraps::willDestroyVM() may end up
with a NULL sender pointer.  The fix is to add the missing null check before using
the sender pointer.

* runtime/VMTraps.cpp:
(JSC::VMTraps::willDestroyVM):
(JSC::VMTraps::fireTrap):
* runtime/VMTraps.h:

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

2 years agoCorrectly export WebItemProviderPasteboard
megan_gardner@apple.com [Tue, 14 Mar 2017 19:22:33 +0000 (19:22 +0000)]
Correctly export WebItemProviderPasteboard
https://bugs.webkit.org/show_bug.cgi?id=169578

Reviewed by Tim Horton.

Source/WebCore:

* platform/ios/WebItemProviderPasteboard.h:

Source/WebKit/mac:

* MigrateHeaders.make:

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

2 years agoWeb Inspector: RTL: add support for Timeline graphs
webkit@devinrousso.com [Tue, 14 Mar 2017 19:20:56 +0000 (19:20 +0000)]
Web Inspector: RTL: add support for Timeline graphs
https://bugs.webkit.org/show_bug.cgi?id=169585

Reviewed by Brian Burg.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Rework the calculation for the icon offset to use "right" in RTL.

* UserInterface/Views/MemoryTimelineOverviewGraph.css:
(body[dir=rtl] .timeline-overview-graph.memory > .stacked-line-chart):
Flip the chart when in RTL.

* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar):
(body[dir=ltr] .timeline-record-bar > .segment.inactive):
(body[dir=rtl] .timeline-record-bar > .segment.inactive):
(body[dir=ltr] .timeline-record-bar.unfinished > .segment):
(body[dir=rtl] .timeline-record-bar.unfinished > .segment):
(body[dir=ltr] .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(body[dir=rtl] .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(body[dir=ltr] :matches(:focus, .force-focus) .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(body[dir=rtl] :matches(:focus, .force-focus) .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(.timeline-record-bar > .segment.inactive,): Deleted.
(.timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
(:matches(:focus, .force-focus) .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.prototype.refresh):
Apply the position updates to "right" in RTL.

* UserInterface/Views/TimelineRecordFrame.js:
(WebInspector.TimelineRecordFrame.prototype.refresh):
Apply the position updates to "right" in RTL.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.layout):
(WebInspector.TimelineRuler.prototype._updatePositionOfElement):
(WebInspector.TimelineRuler.prototype._updateMarkers):
(WebInspector.TimelineRuler.prototype._updateSelection):
Apply the position updates to "right" in RTL.

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

2 years agoUnreviewed, rolling out r213915.
ryanhaddad@apple.com [Tue, 14 Mar 2017 19:16:43 +0000 (19:16 +0000)]
Unreviewed, rolling out r213915.

Caused WK2 LayoutTests to exit early with timeouts.

Reverted changeset:

"Fix uninitialized public members in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=169598
http://trac.webkit.org/changeset/213915

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