WebKit-https.git
3 years ago[GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
eocanha@igalia.com [Wed, 26 Oct 2016 08:40:33 +0000 (08:40 +0000)]
[GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162898

Reviewed by Xabier Rodriguez-Calvar.

Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).

* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
(WebCore::SourceBufferPrivateGStreamer::create):
(WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::setClient):
(WebCore::SourceBufferPrivateGStreamer::append):
(WebCore::SourceBufferPrivateGStreamer::abort):
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
(WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
(WebCore::SourceBufferPrivateGStreamer::readyState):
(WebCore::SourceBufferPrivateGStreamer::setReadyState):
(WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateGStreamer::enqueueSample):
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setActive):
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.

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

3 years ago[GStreamer][MSE] MediaSourceClientGStreamerMSE
eocanha@igalia.com [Wed, 26 Oct 2016 08:39:47 +0000 (08:39 +0000)]
[GStreamer][MSE] MediaSourceClientGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=162896

Reviewed by Xabier Rodriguez-Calvar.

This class encapsulates the MediaSource interaction responsibility for the
GStreamer platform.

* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
(WebCore::MediaSourceClientGStreamerMSE::create):
(WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::duration):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::append):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
(WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.

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

3 years ago[GStreamer] GStreamer Media Sample
eocanha@igalia.com [Wed, 26 Oct 2016 08:39:08 +0000 (08:39 +0000)]
[GStreamer] GStreamer Media Sample
https://bugs.webkit.org/show_bug.cgi?id=162894

Reviewed by Xabier Rodriguez-Calvar.

Implement the MediaSample interface for the GStreamer platform.

* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
(WebCore::GStreamerMediaSample::GStreamerMediaSample):
(WebCore::GStreamerMediaSample::create):
(WebCore::GStreamerMediaSample::createFakeSample):
(WebCore::GStreamerMediaSample::applyPtsOffset):
(WebCore::GStreamerMediaSample::offsetTimestampsBy):
(WebCore::GStreamerMediaSample::~GStreamerMediaSample):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
(WebCore::GStreamerMediaSample::presentationTime):
(WebCore::GStreamerMediaSample::decodeTime):
(WebCore::GStreamerMediaSample::duration):
(WebCore::GStreamerMediaSample::trackID):
(WebCore::GStreamerMediaSample::setTrackID):
(WebCore::GStreamerMediaSample::sizeInBytes):
(WebCore::GStreamerMediaSample::sample):
(WebCore::GStreamerMediaSample::presentationSize):
(WebCore::GStreamerMediaSample::setTimestamps):
(WebCore::GStreamerMediaSample::isDivisable):
(WebCore::GStreamerMediaSample::divide):
(WebCore::GStreamerMediaSample::flags):
(WebCore::GStreamerMediaSample::platformSample):
(WebCore::GStreamerMediaSample::dump):

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

3 years ago[GStreamer] GStreamer Media Description
eocanha@igalia.com [Wed, 26 Oct 2016 08:38:29 +0000 (08:38 +0000)]
[GStreamer] GStreamer Media Description
https://bugs.webkit.org/show_bug.cgi?id=162893

Reviewed by Xabier Rodriguez-Calvar.

Implement the MediaDescription interface for the GStreamer platform.

* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
(WebCore::GStreamerMediaDescription::codec):
(WebCore::GStreamerMediaDescription::isVideo):
(WebCore::GStreamerMediaDescription::isAudio):
(WebCore::GStreamerMediaDescription::isText):
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
(WebCore::GStreamerMediaDescription::create):
(WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
(WebCore::GStreamerMediaDescription::GStreamerMediaDescription):

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

3 years ago[GStreamer][MSE][EME] Append Pipeline
eocanha@igalia.com [Wed, 26 Oct 2016 08:37:49 +0000 (08:37 +0000)]
[GStreamer][MSE][EME] Append Pipeline
https://bugs.webkit.org/show_bug.cgi?id=162874

Reviewed by Žan Doberšek.

This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
support).

* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
(WebCore::dumpAppendState):
(WebCore::appendPipelineElementMessageCallback):
(WebCore::appendPipelineApplicationMessageCallback):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::clearPlayerPrivate):
(WebCore::AppendPipeline::handleElementMessage):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::id):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::checkEndOfAppend):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::appsinkEOS):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::trackId):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::abort):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleNewAppsinkSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineAppsinkCapsChanged):
(WebCore::appendPipelineAppsrcDataLeaving):
(WebCore::appendPipelinePadProbeDebugInformation):
(WebCore::appendPipelineAppsrcNeedData):
(WebCore::appendPipelineDemuxerPadAdded):
(WebCore::appendPipelineDemuxerPadRemoved):
(WebCore::appendPipelineAppsinkNewSample):
(WebCore::appendPipelineAppsinkEOS):
* platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
(WebCore::AppendPipeline::appendState):
(WebCore::AppendPipeline::mediaSourceClient):
(WebCore::AppendPipeline::sourceBufferPrivate):
(WebCore::AppendPipeline::bus):
(WebCore::AppendPipeline::pipeline):
(WebCore::AppendPipeline::appsrc):
(WebCore::AppendPipeline::appsink):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::track):
(WebCore::AppendPipeline::streamType):

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

3 years ago[GStreamer] Drain query support
eocanha@igalia.com [Wed, 26 Oct 2016 08:37:08 +0000 (08:37 +0000)]
[GStreamer] Drain query support
https://bugs.webkit.org/show_bug.cgi?id=162872

Reviewed by Žan Doberšek.

Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
systems. This is because the video sink still holds samples. Proper DRAIN support
fixes this issue and is also good for all the platforms, not only OpenGL ES.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
(WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::drain):
(webkitVideoSinkQuery):
(webkitVideoSinkEvent):
(webkit_video_sink_class_init):
(VideoRenderRequestScheduler::stop): Deleted.
(webkitVideoSinkProposeAllocation): Deleted.

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

3 years ago[GStreamer] Track enhancements for MSE support
eocanha@igalia.com [Wed, 26 Oct 2016 08:36:33 +0000 (08:36 +0000)]
[GStreamer] Track enhancements for MSE support
https://bugs.webkit.org/show_bug.cgi?id=162869

Reviewed by Xabier Rodriguez-Calvar.

Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
work anyway in cases where the demuxer isn't contained in a GstPlaybin.

* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:

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

3 years ago[GTK][GStreamer] Disable MEDIA_SOURCE and ENCRYPTED_MEDIA_V2 by default
eocanha@igalia.com [Wed, 26 Oct 2016 08:35:59 +0000 (08:35 +0000)]
[GTK][GStreamer] Disable MEDIA_SOURCE and ENCRYPTED_MEDIA_V2 by default
https://bugs.webkit.org/show_bug.cgi?id=162623

Reviewed by Xabier Rodriguez-Calvar.

* Source/cmake/OptionsGTK.cmake:

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

3 years agoMake CachedResourceLoader originsMatch check more efficient
commit-queue@webkit.org [Wed, 26 Oct 2016 08:08:11 +0000 (08:08 +0000)]
Make CachedResourceLoader originsMatch check more efficient
https://bugs.webkit.org/show_bug.cgi?id=163938

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

No change of behavior.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::originsMatch): Moved to SecurityOrigin.cpp.
* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
(WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol):
(WebCore::SecurityOrigin::host):
(WebCore::SecurityOrigin::domain):

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

3 years agoREGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
carlosgc@webkit.org [Wed, 26 Oct 2016 07:45:14 +0000 (07:45 +0000)]
REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
https://bugs.webkit.org/show_bug.cgi?id=162776

Reviewed by Xabier Rodriguez-Calvar.

Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
to the menu widget.

* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):

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

3 years ago[DOMJIT] Tell IDL result type to DFG to drop type checks in AI
utatane.tea@gmail.com [Wed, 26 Oct 2016 05:43:04 +0000 (05:43 +0000)]
[DOMJIT] Tell IDL result type to DFG to drop type checks in AI
https://bugs.webkit.org/show_bug.cgi?id=163900

Reviewed by Sam Weinig.

Source/JavaScriptCore:

The IDL tells the conservative result type. While we use the heap prediction
for prediction propagation phase in DOMJIT getter (it is offered by get_by_id!),
we leverage the type told by IDL to produce the abstract value with the proven type
in AI. It effectively drops unnecessary type checks followed by CallDOM operations.

For example, when you write the code like,

    if (node.nodeType === 9) {
        // document.
    }

Previously, we inserted a Int32 check for the result of node.nodeType.
It is dropped now.

We annotate the DOMJIT getter in jsc.cpp to ensure that the unnecessary type checks
are correctly dropped when executing JSTests/stress/domjit-getter.js.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* domjit/DOMJITGetterSetter.h:
(JSC::DOMJIT::GetterSetter::GetterSetter):
(JSC::DOMJIT::GetterSetter::resultType):
* jsc.cpp:
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT):
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT):

Source/WebCore:

Add TestDOMJIT.idl for bindings generation tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GetResultTypeFilter):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
(WebCore::JSTestDOMJITPrototype::create):
(WebCore::JSTestDOMJITPrototype::createStructure):
(WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
(WebCore::JSTestDOMJITConstructor::prototypeForStructure):
(WebCore::JSTestDOMJITConstructor::initializeProperties):
(WebCore::JSTestDOMJITPrototype::finishCreation):
(WebCore::JSTestDOMJIT::JSTestDOMJIT):
(WebCore::JSTestDOMJIT::createPrototype):
(WebCore::JSTestDOMJIT::prototype):
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITAnyAttrGetter):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITBooleanAttrGetter):
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITByteAttr):
(WebCore::jsTestDOMJITByteAttrGetter):
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteAttr):
(WebCore::jsTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITOctetAttrGetter):
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITShortAttr):
(WebCore::jsTestDOMJITShortAttrGetter):
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttrGetter):
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITLongAttr):
(WebCore::jsTestDOMJITLongAttrGetter):
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITLongLongAttrGetter):
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITFloatAttrGetter):
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITDoubleAttrGetter):
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITDomStringAttrGetter):
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITByteStringAttrGetter):
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITUsvStringAttrGetter):
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITNodeAttrGetter):
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITBooleanNullableAttrGetter):
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttrGetter):
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttrGetter):
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttrGetter):
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttrGetter):
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttrGetter):
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttrGetter):
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttrGetter):
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttrGetter):
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttrGetter):
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttrGetter):
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
(WebCore::JSTestDOMJIT::getConstructor):
(WebCore::JSTestDOMJIT::visitChildren):
* bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
(WebCore::JSTestDOMJIT::create):
(WebCore::JSTestDOMJIT::createStructure):
(WebCore::JSTestDOMJIT::wrapped):
(WebCore::JSTestDOMJIT::finishCreation):
* bindings/scripts/test/TestDOMJIT.idl: Added.

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

3 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Wed, 26 Oct 2016 05:12:36 +0000 (05:12 +0000)]
[Win] Unreviewed build fix.

* platform/graphics/GraphicsContext.h: Add missing declaration.

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

3 years agoUpdating attribute by textContent must create a single mutation record and custom...
rniwa@webkit.org [Wed, 26 Oct 2016 04:45:04 +0000 (04:45 +0000)]
Updating attribute by textContent must create a single mutation record and custom element reaction
https://bugs.webkit.org/show_bug.cgi?id=164003

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaselined the test now that all test cases are passing.

* web-platform-tests/custom-elements/reactions/Node-expected.txt:

Source/WebCore:

The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent

Test: fast/dom/MutationObserver/text-content-on-attr.html

* dom/Node.cpp:
(WebCore::Node::setTextContent):

LayoutTests:

Added a test for ensuring mutating the attribute by nodeValue and textContent creates exactly one mutation record.

* fast/custom-elements/reactions-for-webkit-extensions.html: Updated the description.
* fast/dom/MutationObserver/text-content-on-attr-expected.txt: Added.
* fast/dom/MutationObserver/text-content-on-attr.html: Added.

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

3 years ago[Win][Direct2D] Use smart pointers for Direct2D Path types
bfulgham@apple.com [Wed, 26 Oct 2016 01:57:44 +0000 (01:57 +0000)]
[Win][Direct2D] Use smart pointers for Direct2D Path types
https://bugs.webkit.org/show_bug.cgi?id=163994

Reviewed by Alex Christensen.

Tested by existing path tests.

* platform/graphics/Path.h:
(WebCore::Path::platformPath): Use a COMPtr for m_path.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::systemFactory): Present better D2D debug output
when running a debug build.
(WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
native GDI device context.
(WebCore::GraphicsContext::platformStrokeStyle): Added.
(WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
avoid doing math on infinities.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::scratchRenderTarget): Added.
(WebCore::Path::~Path): Switch to COMPtr implementation.
(WebCore::Path::ensurePlatformPath): Ditto.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::initializePathState): Ditto.
(WebCore::Path::strokeContains): Provide an implementation.
(WebCore::Path::transform): Ditto.
(WebCore::Path::addEllipse): No need for explicit construction of the
D2D1::Point2F object.
(WebCore::Path::clear): Switch to COMPtr implementation.

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

3 years agoUnreviewed, fix duplicate GTK expectations
mcatanzaro@igalia.com [Wed, 26 Oct 2016 01:28:03 +0000 (01:28 +0000)]
Unreviewed, fix duplicate GTK expectations

* platform/gtk/TestExpectations:

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

3 years agoString.prototype.replace() should throw an OutOfMemoryError when using too much memory.
mark.lam@apple.com [Wed, 26 Oct 2016 01:15:49 +0000 (01:15 +0000)]
String.prototype.replace() should throw an OutOfMemoryError when using too much memory.
https://bugs.webkit.org/show_bug.cgi?id=163996
<rdar://problem/28263117>

Reviewed by Geoffrey Garen.

JSTests:

* stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js: Added.

Source/JavaScriptCore:

String.prototype.replace() uses a Vector internally for bookkeeping work.
Currently, if this vector gets too big, we just crash on allocation failure.
While this is correct behavior, it is not too friendly.

We now detect the imminent failure, and throw a OutOfMemoryError instead.

* runtime/StringPrototype.cpp:
(JSC::removeUsingRegExpSearch):
(JSC::replaceUsingRegExpSearch):
(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
(JSC::stringProtoFuncReplaceUsingRegExp):

Source/WTF:

* wtf/Vector.h:
(WTF::minCapacity>::tryConstructAndAppend):
(WTF::minCapacity>::tryConstructAndAppendSlowCase):
- Added try versions of constructAndAppend() so that we can handle the failure
  to allocate more gracefully.

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

3 years agoLayoutTest accessibility/mac/meter-gauge-value-description.html failing
n_wang@apple.com [Wed, 26 Oct 2016 01:15:36 +0000 (01:15 +0000)]
LayoutTest accessibility/mac/meter-gauge-value-description.html failing
https://bugs.webkit.org/show_bug.cgi?id=163997
<rdar://problem/28948637>

Reviewed by Chris Fleizach.

Source/WebCore:

I hand-edited the Localizable.strings file in a previous patch and my changes
were replaced by running update-webkit-localizable-strings script. Changed the
key to be the same as the value to keep consistency with other entries.

Re-enabled the failing test.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):

LayoutTests:

* platform/mac/TestExpectations:

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

3 years agoRename the reject() helper function to something more meaningful.
mark.lam@apple.com [Wed, 26 Oct 2016 01:10:24 +0000 (01:10 +0000)]
Rename the reject() helper function to something more meaningful.
https://bugs.webkit.org/show_bug.cgi?id=163549

Reviewed by Saam Barati.

We'll rename reject() to typeError().  The intuition behind this is that all the
clients that uses this function will return typeError(..., shouldThrow, ...).
In a sense, they are returning a "type" of TypeError (which happened to be the
value false).  In addition, it may also throw a JS TypeError if the shouldThrow
parameter is true.

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/GetterSetter.cpp:
(JSC::callSetter):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::setLengthWithArrayStorage):
* runtime/JSArrayBuffer.cpp:
(JSC::JSArrayBuffer::put):
(JSC::JSArrayBuffer::defineOwnProperty):
* runtime/JSArrayBufferView.cpp:
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::putToPrimitiveByIndex):
* runtime/JSDataView.cpp:
(JSC::JSDataView::put):
(JSC::JSDataView::defineOwnProperty):
* runtime/JSFunction.cpp:
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty):
* runtime/JSObject.cpp:
(JSC::ordinarySetSlow):
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putInline):
* runtime/JSProxy.cpp:
(JSC::JSProxy::setPrototype):
* runtime/Lookup.h:
(JSC::putEntry):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):
* runtime/RegExpObject.h:
(JSC::RegExpObject::setLastIndex):
* runtime/Reject.h: Removed.
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::putEntry):
(JSC::SparseArrayValueMap::putDirect):
(JSC::SparseArrayEntry::put):
* runtime/StringObject.cpp:
(JSC::StringObject::put):
(JSC::StringObject::putByIndex):
* runtime/TypeError.h: Copied from Source/JavaScriptCore/runtime/Reject.h.
(JSC::typeError):
(JSC::reject): Deleted.

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

3 years agoMarking accessibility/mac/meter-gauge-value-description.html as failing on mac.
ryanhaddad@apple.com [Wed, 26 Oct 2016 00:11:17 +0000 (00:11 +0000)]
Marking accessibility/mac/meter-gauge-value-description.html as failing on mac.
https://bugs.webkit.org/show_bug.cgi?id=163997

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoCMake build fix.
achristensen@apple.com [Tue, 25 Oct 2016 23:59:32 +0000 (23:59 +0000)]
CMake build fix.

* PlatformMac.cmake:
* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
It couldn't decide whether to use operator const String& or operator NSString*.

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

3 years ago[SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
commit-queue@webkit.org [Tue, 25 Oct 2016 23:42:43 +0000 (23:42 +0000)]
[SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
https://bugs.webkit.org/show_bug.cgi?id=163941

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-10-25
Reviewed by Michael Catanzaro.

equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
"get" instead of "GET".

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):

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

3 years agoHeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarr...
fpizlo@apple.com [Tue, 25 Oct 2016 23:22:48 +0000 (23:22 +0000)]
HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
https://bugs.webkit.org/show_bug.cgi?id=163947

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

I want to introduce another HeapTimer. Prior to this change, that would have meant writing
exact copies of that timer's logic for each platform that has a HeapTimer (CF, GLIB, and
EFL). That logic would in turn be a duplicate of the logic already present in
IncrementalSweeper and GCActivityCallback: all of the subclasses of HeapTimer have their
own code for scheduling timers, so a new subclass would have to duplicate that code. Then,
to add insult to injury, the USE(CF) version of HeapTimer would have to have an extra case
for that new subclass since it doesn't use virtual methods effectively.

This changes HeapTimer on USE(CF) to know to get its runloop from Heap and to use virtual
methods effectively so that it doesn't have to know about all of its subclasses.

This also moves IncrementalSweeper's code for scheduling timers into HeapTimer. This means
that future subclasses of HeapTimer could simply use that logic.

This keeps changes to GCActivityCallback to a minimum. It still has a lot of
platform-specific code and I'm not sure that this code can be trivially deduplicated since
that code has more quirks. That's fine for now, since I mainly just need a sane way of
creating new timers that use IncrementalSweeper-like scheduling logic.

* heap/EdenGCActivityCallback.cpp:
* heap/EdenGCActivityCallback.h:
* heap/FullGCActivityCallback.cpp:
* heap/FullGCActivityCallback.h:
* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::GCActivityCallback):
* heap/GCActivityCallback.h:
* heap/Heap.cpp:
(JSC::Heap::Heap):
* heap/Heap.h:
(JSC::Heap::runLoop):
* heap/HeapTimer.cpp:
(JSC::HeapTimer::HeapTimer):
(JSC::HeapTimer::setRunLoop):
(JSC::HeapTimer::~HeapTimer):
(JSC::HeapTimer::timerDidFire):
(JSC::HeapTimer::scheduleTimer):
(JSC::HeapTimer::cancelTimer):
(JSC::retainAPILock): Deleted.
(JSC::releaseAPILock): Deleted.
* heap/HeapTimer.h:
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::scheduleTimer):
(JSC::IncrementalSweeper::cancelTimer): Deleted.
* heap/IncrementalSweeper.h:

Source/WebCore:

No new tests because no new behavior.

* platform/ios/WebSafeGCActivityCallbackIOS.h:
* platform/ios/WebSafeIncrementalSweeperIOS.h:

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

3 years ago[CSS Parser] Improvements to selector parsing
hyatt@apple.com [Tue, 25 Oct 2016 23:21:03 +0000 (23:21 +0000)]
[CSS Parser] Improvements to selector parsing
https://bugs.webkit.org/show_bug.cgi?id=163964

Reviewed by Zalan Bujtas.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setNth):
* css/CSSSelector.h:
(WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parserAppendRule):
(WebCore::StyleSheetContents::ruleAt):
(WebCore::StyleSheetContents::ruleCount):
(WebCore::StyleSheetContents::clearRules):
(WebCore::StyleSheetContents::wrapperInsertRule):
(WebCore::StyleSheetContents::wrapperDeleteRule):
* css/StyleSheetContents.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSelector):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setAttribute):
(WebCore::CSSParserSelector::setArgument):
(WebCore::CSSParserSelector::setNth):
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumeCompoundSelector):
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::isPseudoClassFunction):
(WebCore::isPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeCombinator):

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

3 years agoNumbered list should be represented without ‘…’
bdakin@apple.com [Tue, 25 Oct 2016 23:01:18 +0000 (23:01 +0000)]
Numbered list should be represented without ‘…’
https://bugs.webkit.org/show_bug.cgi?id=163992
-and corresponding-
rdar://problem/28911337

Reviewed by Darin Adler.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::insertListTypeNumbered):

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

3 years agoRemove redundant argument count check
jfbastien@apple.com [Tue, 25 Oct 2016 22:41:09 +0000 (22:41 +0000)]
Remove redundant argument count check

Indexing argument out of bounds already returns jsUndefined().

Remove redundant argument count check
https://bugs.webkit.org/show_bug.cgi?id=163957

Reviewed by Keith Miller.

* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):

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

3 years agoAdd ThrowScope::release() calls at all call sites of jsMakeNontrivialString().
mark.lam@apple.com [Tue, 25 Oct 2016 22:30:08 +0000 (22:30 +0000)]
Add ThrowScope::release() calls at all call sites of jsMakeNontrivialString().
https://bugs.webkit.org/show_bug.cgi?id=163990

Reviewed by Geoffrey Garen.

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):

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

3 years agoWeb Inspector: Cmd-+ doesn't "zoom in" to increase text size in the Web Inspector
commit-queue@webkit.org [Tue, 25 Oct 2016 22:27:06 +0000 (22:27 +0000)]
Web Inspector: Cmd-+ doesn't "zoom in" to increase text size in the Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=163961
<rdar://problem/28895308>

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

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Add a duplicate set of keyboard shortcuts for the Shift variants.

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

3 years agoJSStringJoiner::joinedLength() should limit joined string lengths to INT_MAX.
mark.lam@apple.com [Tue, 25 Oct 2016 22:19:37 +0000 (22:19 +0000)]
JSStringJoiner::joinedLength() should limit joined string lengths to INT_MAX.
https://bugs.webkit.org/show_bug.cgi?id=163937
<rdar://problem/28642990>

Reviewed by Geoffrey Garen.

JSTests:

* stress/joined-strings-should-not-exceed-max-string-length.js: Added.

Source/JavaScriptCore:

JSStringJoiner::joinedLength() was previously limiting it to UINT_MAX.  This is
inconsistent with other parts of string code which expects a max length of INT_MAX.
This is now fixed.

Also fixed jsMakeNontrivialString() to ensure that the resultant string length
is valid.  It was previously allowing lengths greater than INT_MAX.  This was
caught by the new assertion in JSString::setLength().

There are already pre-existing assertions in various JSString::finishCreation()
which do RELEASE_ASSERTs on the string length.  To be consistent, I'm making the
assertion in JSString::setLength() a RELEASE_ASSERT.  If this proves to be a
performance issue, I'll change this to a debug ASSERT later.

* runtime/JSString.cpp:
(JSC::JSRopeString::resolveRopeInternal8):
(JSC::JSRopeString::resolveRopeInternal8NoSubstring):
(JSC::JSRopeString::resolveRopeInternal16):
(JSC::JSRopeString::resolveRopeInternal16NoSubstring):
(JSC::JSRopeString::resolveRopeToAtomicString):
(JSC::JSRopeString::resolveRopeToExistingAtomicString):
(JSC::JSRopeString::resolveRope):
(JSC::JSRopeString::resolveRopeSlowCase8):
(JSC::JSRopeString::resolveRopeSlowCase):
(JSC::JSString::getStringPropertyDescriptor):
* runtime/JSString.h:
(JSC::JSString::finishCreation):
(JSC::JSString::length):
(JSC::JSString::isValidLength):
(JSC::JSString::toBoolean):
(JSC::JSString::canGetIndex):
(JSC::JSString::setLength):
(JSC::JSString::getStringPropertySlot):
(JSC::JSRopeString::unsafeView):
(JSC::JSRopeString::viewWithUnderlyingString):
* runtime/JSStringBuilder.h:
(JSC::jsMakeNontrivialString):
* runtime/JSStringJoiner.cpp:
(JSC::JSStringJoiner::joinedLength):

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

3 years agoREGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
dbates@webkit.org [Tue, 25 Oct 2016 22:07:20 +0000 (22:07 +0000)]
REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
https://bugs.webkit.org/show_bug.cgi?id=163978
<rdar://problem/25962131>

Reviewed by Darin Adler.

Source/WebCore:

During the tokenization process of an HTML tag the start and end positions of each of its
attributes is tracked so that the XSS Auditor can request a snippet around a suspected
injected attribute. We need to take care to consider document.write() boundaries when
tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
receives the correct snippet. Following r178265 we no longer consider document.write()
boundaries when tracking the start and end positions of attributes. So, the substring
represented by the start and end positions of an attribute may correspond to some other
attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
snippet it requested may not be the snippet that it intended to request.

Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
       http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
       http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html

* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
start position.
(WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
longer adjust it here because it was adjusted with respect to the attribute base offset, which
takes into account document.write() boundaries.
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::setAttributeBaseOffset): Added.
(WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
(WebCore::HTMLToken::endAttribute): Ditto.
* html/parser/HTMLTokenizer.h:
(WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.

LayoutTests:

Add tests to ensure that the XSS Auditor blocks a document.write() of an incomplete HTML image tag.

* http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror-expected.txt: Added.
* http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html: Added.
* http/tests/security/xssAuditor/dom-write-location-open-img-onerror-expected.txt: Added.
* http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html: Added.
* http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror-expected.txt: Added.
* http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html: Added.
* http/tests/security/xssAuditor/resources/echo-nested-dom-write-location.html: Added.

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

3 years agoIDBDatabase.transaction() should take a union in parameter
cdumez@apple.com [Tue, 25 Oct 2016 22:01:55 +0000 (22:01 +0000)]
IDBDatabase.transaction() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163966

Reviewed by Sam Weinig.

IDBDatabase.transaction() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode

No new tests, no expected Web-exposed behavior change.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:

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

3 years agoWebAssembly JS API: simple Module test
jfbastien@apple.com [Tue, 25 Oct 2016 21:48:19 +0000 (21:48 +0000)]
WebAssembly JS API: simple Module test
https://bugs.webkit.org/show_bug.cgi?id=163963

Reviewed by Filip Pizlo.

* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.get return): get the ArrayBuffer
(export.default.LowLevelBinary.prototype.hexdump): Deleted.
(export.default.LowLevelBinary.prototype._maybeGrow): Deleted.
* wasm/js-api/test_Module.js: Added.
(EmptyModule): The most basic module possible

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

3 years agoIndexedDB 2.0: Support IDBObjectStore openKeyCursor.
beidson@apple.com [Tue, 25 Oct 2016 21:42:57 +0000 (21:42 +0000)]
IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
<rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954

Reviewed by Andy Estes.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor-expected.txt:

Source/WebCore:

No new tests (Covered by changes to existing tests)

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
* Modules/indexeddb/IDBCursor.h:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestOpenCursor):

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
  if the cursor is KeyAndValue.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
  object store cursor if it's both KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.h:

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
* Modules/indexeddb/shared/IDBCursorInfo.h:

LayoutTests:

* storage/indexeddb/modern/cursor-1-expected.txt:
* storage/indexeddb/modern/cursor-1-private-expected.txt:
* storage/indexeddb/modern/resources/cursor-1.js:

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

3 years agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Tue, 25 Oct 2016 21:31:14 +0000 (21:31 +0000)]
Unreviewed GTK test gardening

* platform/gtk/TestExpectations:
* platform/gtk/fast/attachment/attachment-select-on-click-expected.txt:
* platform/gtk/fast/css/word-space-extra-expected.txt:
* platform/gtk/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt:
* platform/gtk/fast/dom/Window/window-properties-performance-expected.txt:

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

3 years agoWebAssembly: fix unknown section name handling, and check for section size overflow
jfbastien@apple.com [Tue, 25 Oct 2016 21:10:46 +0000 (21:10 +0000)]
WebAssembly: fix unknown section name handling, and check for section size overflow
https://bugs.webkit.org/show_bug.cgi?id=163959

See: https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#high-level-structure

Name length and name are already included in the payload length.

Reviewed by Filip Pizlo.

* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):

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

3 years agojsc.cpp is leaking memory allocated by readline in runInteractive
commit-queue@webkit.org [Tue, 25 Oct 2016 20:33:46 +0000 (20:33 +0000)]
jsc.cpp is leaking memory allocated by readline in runInteractive
https://bugs.webkit.org/show_bug.cgi?id=163958

According to http://web.mit.edu/gnu/doc/html/rlman_2.html,
"The line readline returns is allocated with malloc ();
you should free () the line when you are done with it."
The memory allocated by readline is not being freed when it should.

Patch by Christopher Reid <Christopher.Reid@am.sony.com> on 2016-10-25
Reviewed by Mark Lam.

* jsc.cpp:

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

3 years agoSupport InputEvent.dataTransfer for the InputEvent spec
wenson_hsieh@apple.com [Tue, 25 Oct 2016 20:23:10 +0000 (20:23 +0000)]
Support InputEvent.dataTransfer for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163213
<rdar://problem/28700407>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
"insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
and getData("text/html"), respectively.

To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
for the requested type and returns the result, if any.

An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
plaintext strings, and then vend this information to its dispatched input events by overriding
CompositeEditCommand::inputEventDataTransfer.

Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
it, then simulate selecting the content and generating markup from the selection to create a sanitized
DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.

Tests: fast/events/input-events-paste-rich-datatransfer.html
       fast/events/input-events-spell-checking-datatransfer.html

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformWin.cmake:

Add StaticPasteboard.cpp.

* WebCore.xcodeproj/project.pbxproj:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::DataTransfer):
(WebCore::DataTransfer::createForInputEvent):

Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
given HTML text.

* dom/DataTransfer.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
(WebCore::InputEvent::dataTransfer):
* dom/InputEvent.h:
* dom/InputEvent.idl:

Add the InputEvent.dataTransfer attribute.

* dom/Node.cpp:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::inputEventDataTransfer):

Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
this is null.

* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
(WebCore::ReplaceRangeWithTextCommand::doApply):
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
* editing/ReplaceRangeWithTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):

Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
inserted in the process.

(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
(WebCore::ReplaceSelectionCommand::ensureReplacementFragment):

Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
ReplacementFragment may be initialized either in willApplyCommand or in doApply.

* editing/ReplaceSelectionCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::willApplyCommand):
(WebCore::SpellingCorrectionCommand::doApply):
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
* editing/SpellingCorrectionCommand.h:

Using the replacement text fragment, create and return a DataTransfer for input events.

* platform/Pasteboard.h:
* platform/StaticPasteboard.cpp: Added.
(WebCore::StaticPasteboard::create):
(WebCore::StaticPasteboard::StaticPasteboard):
(WebCore::StaticPasteboard::hasData):
(WebCore::StaticPasteboard::types):
(WebCore::StaticPasteboard::readString):
* platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeMarkup):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeMarkup):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeMarkup):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):

To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
unimplemented on these platforms.

LayoutTests:

Adds 2 new layout tests verifying that input events dispatched as a result of pasting or spell checking contain
DataTransfers that have rich and plain text representations of the contents being inserted.

* fast/events/input-events-fired-when-typing-expected.txt:
* fast/events/input-events-fired-when-typing.html:
* fast/events/input-events-paste-rich-datatransfer-expected.txt: Added.
* fast/events/input-events-paste-rich-datatransfer.html: Added.
* fast/events/input-events-spell-checking-datatransfer-expected.txt: Added.
* fast/events/input-events-spell-checking-datatransfer.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoImplement rel=noopener
aestes@apple.com [Tue, 25 Oct 2016 20:17:36 +0000 (20:17 +0000)]
Implement rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=155166
<rdar://problem/25193787>

Reviewed by Brent Fulgham.

Source/WebCore:

Added support for rel=noopener to a and area elements.

Tests: fast/dom/Window/a-rel-noopener.html
       fast/dom/Window/area-rel-noopener.html

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
(WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
two values.
(WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
(WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
(WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
FrameLoader::urlSelected() if rel=noopener was specified.
* html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
(HTMLAnchorElement is still 128 bytes on 64-bit).
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
urlSelected() that did not take a downloadAttribute parameter.
* loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
and set a default argument for downloadAttribute instead of having a second version of
urlSelected().

LayoutTests:

* fast/dom/DOMTokenList-supports-expected.txt:
* fast/dom/DOMTokenList-supports.html:
* fast/dom/Window/a-rel-noopener-expected.txt: Added.
* fast/dom/Window/a-rel-noopener.html: Added.
* fast/dom/Window/area-rel-noopener-expected.txt: Added.
* fast/dom/Window/area-rel-noopener.html: Added.
* fast/dom/Window/resources/rel-noopener.js: Added.

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

3 years ago[MediaStream] Add "has capture device" bit to media state flags
eric.carlson@apple.com [Tue, 25 Oct 2016 20:07:25 +0000 (20:07 +0000)]
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952

Source/WebCore:

Reviewed by Jer Noble.

No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
and webaudio/web-audio-is-playing.html.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
  actually producing data.

* page/MediaProducer.h: Add HasMediaCaptureDevice bit.

* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Reviewed by Sam Weinig.

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
* UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.

LayoutTests:

Reviewed by Jer Noble.

* fast/mediastream/MediaStream-page-muted-expected.txt:
* fast/mediastream/MediaStream-page-muted.html:
* media/muted-video-is-playing-audio-expected.txt:
* media/muted-video-is-playing-audio.html:
* webaudio/web-audio-is-playing.html:
* webaudio/web-audio-is-playing-expected.txt:

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

3 years agoWeb Inspector: Remove dead code in FrameTreeElement
commit-queue@webkit.org [Tue, 25 Oct 2016 20:04:03 +0000 (20:04 +0000)]
Web Inspector: Remove dead code in FrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=163914

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

* UserInterface/Views/FrameTreeElement.js:

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

3 years agoUnreviewed, rolling out r207827 and r207828.
commit-queue@webkit.org [Tue, 25 Oct 2016 19:37:15 +0000 (19:37 +0000)]
Unreviewed, rolling out r207827 and r207828.
https://bugs.webkit.org/show_bug.cgi?id=163965

Caused LayoutTest webaudio/web-audio-is-playing.html to time
out on macOS. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207827

"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207828

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

3 years ago[cmake] Don't enable ld.gold by default on non-ELF platforms
annulen@yandex.ru [Tue, 25 Oct 2016 19:25:54 +0000 (19:25 +0000)]
[cmake] Don't enable ld.gold by default on non-ELF platforms
https://bugs.webkit.org/show_bug.cgi?id=163946

Reviewed by Alex Christensen.

For example, MinGW toolchain may be shipped with gold, but it fails to link
WebKit.

* Source/cmake/OptionsCommon.cmake:

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

3 years ago[Modern Media Controls] Media Controller: skip back support
commit-queue@webkit.org [Tue, 25 Oct 2016 19:22:54 +0000 (19:22 +0000)]
[Modern Media Controls] Media Controller: skip back support
https://bugs.webkit.org/show_bug.cgi?id=163725
<rdar://problem/27989480>

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

Source/WebCore:

We introduce the SkipBackSupport class which brings support for skipping back
30 seconds into the media by clicking on the skip back button in the media controls.

Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html

* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(SkipBackSupport.prototype.get control):
(SkipBackSupport.prototype.buttonWasClicked):
(SkipBackSupport):
* WebCore.xcodeproj/project.pbxproj:

Tools:

* Scripts/webkitpy/layout_tests/servers/aliases.json: Adding a new alias such that we may
access the modern-media-controls source files through the web server.

LayoutTests:

Added a new test for the SkipBackButton class to ensure that we correctly seek back by 30 seconds when pressed.
Updated the other tests to reflect the addition of the SkipBackSupport class.

* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt: Added.
* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html: Added.
* media/modern-media-controls/media-controller/media-controller-constructor.html:
* media/modern-media-controls/media-controller/media-controller-resize.html:
* media/modern-media-controls/mute-support/mute-support-button-click.html:
* media/modern-media-controls/mute-support/mute-support-media-api.html:
* media/modern-media-controls/mute-support/mute-support-muted.html:
* media/modern-media-controls/start-support/start-support-audio.html:
* media/modern-media-controls/start-support/start-support-autoplay.html:
* media/modern-media-controls/start-support/start-support-click-to-start.html:
* media/modern-media-controls/start-support/start-support-error.html:
* media/modern-media-controls/start-support/start-support-fullscreen.html:
* media/modern-media-controls/start-support/start-support-manual-play.html:
* media/modern-media-controls/start-support/start-support-no-source.html:

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

3 years agoUnreviewed, rolling out r207578.
commit-queue@webkit.org [Tue, 25 Oct 2016 19:22:12 +0000 (19:22 +0000)]
Unreviewed, rolling out r207578.
https://bugs.webkit.org/show_bug.cgi?id=163962

Broke quip.com so that user can no longer type a space
(Requested by rniwa on #webkit).

Reverted changeset:

"Add a plain space instead of &nbsp; between text nodes"
https://bugs.webkit.org/show_bug.cgi?id=123163
http://trac.webkit.org/changeset/207578

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

3 years agoLOG_WITH_STREAM() macro should not have a semi colon at the end
cdumez@apple.com [Tue, 25 Oct 2016 19:20:59 +0000 (19:20 +0000)]
LOG_WITH_STREAM() macro should not have a semi colon at the end
https://bugs.webkit.org/show_bug.cgi?id=163951

Reviewed by Simon Fraser.

* platform/LogMacros.h:

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

3 years agoIDBObjectStore.createIndex() should take a union in parameter
cdumez@apple.com [Tue, 25 Oct 2016 19:17:38 +0000 (19:17 +0000)]
IDBObjectStore.createIndex() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163935

Reviewed by Darin Adler.

IDBObjectStore.createIndex() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore

No new tests, no expected Web-exposed behavior change.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::IDBKeyPath::isValid): Deleted.
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPath::isNull):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

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

3 years ago[cmake] Check if jscLib and WebKitGUID targets exist before using them
annulen@yandex.ru [Tue, 25 Oct 2016 19:14:55 +0000 (19:14 +0000)]
[cmake] Check if jscLib and WebKitGUID targets exist before using them
https://bugs.webkit.org/show_bug.cgi?id=163945

Reviewed by Alex Christensen.

Currently these targets are used under WIN32 condition, however they
are defined in PlatformWin.cmake, causing CMake warnings if port
supports WIN32 but does not use PlatformWin.cmake

Source/JavaScriptCore:

* shell/CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

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

3 years agoWebCryptoAPI test gardening after r207809.
ryanhaddad@apple.com [Tue, 25 Oct 2016 18:43:50 +0000 (18:43 +0000)]
WebCryptoAPI test gardening after r207809.
https://bugs.webkit.org/show_bug.cgi?id=159638

Unreviewed test gardening.

* TestExpectations:

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

3 years ago[WebIDL] Move more types over to the new JSConverter based toJS functions
weinig@apple.com [Tue, 25 Oct 2016 18:35:03 +0000 (18:35 +0000)]
[WebIDL] Move more types over to the new JSConverter based toJS functions
https://bugs.webkit.org/show_bug.cgi?id=163920

Reviewed by Darin Adler.

- Adds WebIDL-extension type IDLDate, and use it for Date conversions.
- Move JSDOMIterator over to using IDLType based conversions. Make them more
  explicit by adding a traits template argument which describes the iterator.
- Add correct parsing for WebIDL iterable, parsing the parameter types into
  domTypes.
- Support non-Optional nullable types via trait-like functions on IDLTypes.

* bindings/generic/IDLTypes.h:
(WebCore::IDLType::isNullValue):
(WebCore::IDLType::extractValueFromNullable):
(WebCore::IDLString::isNullValue):
(WebCore::IDLString::extractValueFromNullable):
(WebCore::IDLInterface::isNullValue):
(WebCore::IDLInterface::extractValueFromNullable):
(WebCore::IDLDate::isNullValue):
(WebCore::IDLDate::extractValueFromNullable):
Add isNullValue and extractValueFromNullable functions to allow non-Optional
based nullable types.

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::stylePropertyGetter):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
Switch to IDLType based toJS.

* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringOrNull): Deleted.
(WebCore::jsDateOrNull): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::jsPair): Deleted.
(WebCore::toJSNullableString): Deleted.
Remove now unusued toJS functions.

* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLNullable<T>>::convert):
Use new functions to detect and extract nullable values.

(WebCore::Converter<IDLBufferSource>::convert):
Moved to be with the other converters.

(WebCore::Converter<IDLDate>::convert):
(WebCore::JSConverter<IDLDate>::convert):
Added.

* bindings/js/JSDOMIterator.h:
(WebCore::jsPair):
(WebCore::iteratorCreate):
(WebCore::IteratorTraits>::asJS):
(WebCore::appendForEachArguments):
(WebCore::iteratorForEach):
(WebCore::IteratorTraits>::destroy):
(WebCore::IteratorTraits>::next):
(WebCore::IteratorTraits>::finishCreation):
(WebCore::IteratorInspector::decltype): Deleted.
(WebCore::IteratorInspector::test): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
Switch to new Traits based model, and have the generated code pass in
the type (map or set) and key/value types. With the explicit types known,
we can use the new toJS functions.

Also, moved the jsPair functions here from JSDOMBinding.h, since this was
the only place it was used.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions):
Add iterator trait definition and update for new parameters to JSDOMIterator
and JSDOMIteratorPrototype.

(GetBaseIDLType):
Add IDLDate, and move IDLBufferSource up to the simple path.

(JSValueToNativeIsHandledByDOMConvert):
Allow Date.

(JSValueToNative):
Remove special case for Date.

(NativeToJSValueIsHandledByDOMConvert):
Allow Date and remove restriction of nullable string-like types.

(NativeToJSValueDOMConvertNeedsState):
Add Date to list of types needing state.

(NativeToJSValue):
Remove special cases for Date and nullable-strings.

* bindings/scripts/IDLParser.pm:
(parseOptionalIterableInterface):
Add correct parsing of iterable.

* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.

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

3 years ago[MediaStream] Add "has capture device" bit to media state flags
eric.carlson@apple.com [Tue, 25 Oct 2016 18:00:59 +0000 (18:00 +0000)]
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952

Reviewed by Sam Weinig.

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
* UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.

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

3 years ago[MediaStream] Add "has capture device" bit to media state flags
eric.carlson@apple.com [Tue, 25 Oct 2016 17:34:07 +0000 (17:34 +0000)]
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952

Reviewed by Jer Noble.

Source/WebCore:

No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
  actually producing data.

* page/MediaProducer.h: Add HasMediaCaptureDevice bit.

* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/mediastream/MediaStream-page-muted-expected.txt:
* fast/mediastream/MediaStream-page-muted.html:
* media/muted-video-is-playing-audio-expected.txt:
* media/muted-video-is-playing-audio.html:

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

3 years ago[cmake] Don't add -fPIC flag when on Windows (MinGW)
annulen@yandex.ru [Tue, 25 Oct 2016 17:27:00 +0000 (17:27 +0000)]
[cmake] Don't add -fPIC flag when on Windows (MinGW)
https://bugs.webkit.org/show_bug.cgi?id=163949

Reviewed by Michael Catanzaro.

-fPIC flag does not do anything on Windows and produces warning noise
with MinGW. There is no position independent code in Unix sense on
32-bit Windows, and 64-bit Windows code is always relocatable.

For reference see
https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00836.html

* Source/cmake/WebKitHelpers.cmake:

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

3 years agoWebAssembly JS API: implement Module
jfbastien@apple.com [Tue, 25 Oct 2016 17:23:53 +0000 (17:23 +0000)]
WebAssembly JS API: implement Module

This implementation allows us to:
 - Syncrhonously create a WebAssembly.Module with a typed array.
 - Creates a compilation plan.
 - Parse the Module and creates corresponding code.
 - Throw WebAssembly.CompileError with mildly helpful [*] error messages on
   failure.

Consult the API documentation for expected behavior: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodule-constructor

For now the implementation discards the generated code.

The next steps will be:
 - Expose a Module's exports.
 - Implement WebAssembly.Instance, which allows instantiating and running a
   compiled Module.
 - Beef up the testing infrastructure under JSTests/wasm so that more complex
   modules can be created and tested (instead of writing the bits by hand).

This patch also:
 - Adds assert.instanceof in assert.js.
 - Refactors Wasm::Parser and friends to accept const uint8_t* as well as a
   Vector, to avoid copying when invoked synchronously.
 - Remove useless Structure from some of the wasm constructors: they're already
   on the JSGlobalObject, visited properly and all.
 - Fix off-by-one error in parsing: Parser::parseUInt32 failed if the integer
   was exactly at end of file.

 [*] On error messages while parsing: I filed https://bugs.webkit.org/show_bug.cgi?id=163919

WebAssembly JS API: implement Module
https://bugs.webkit.org/show_bug.cgi?id=163903

Reviewed by Keith Miller.

JSTests:

* wasm/assert.js: use underscore in name, and remove when exporting to avoid clasing with builtin names
(const._notUndef):
(const._isUndef):
(const._eq):
(const._ge):
(const._throws):
* wasm/js-api/test_basic_api.js: test the WebAssembly.Module API
(const.c.in.constructorProperties.switch):

Source/JavaScriptCore:

* runtime/ExceptionHelpers.cpp:
(JSC::defaultSourceAppender): make this public so that WebAssembly can use it: it generates those fancy (evaluating '...') messages at the end
* runtime/ExceptionHelpers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): remove the useless Structure from the WebAssembly objects (it's already in this file, no need to hold two references and visit them twice)
* testWasm.cpp:
(runWasmTests): update API
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile): use updated API
* wasm/WasmB3IRGenerator.h:
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::FunctionParser): use updated API
(JSC::Wasm::FunctionParser<Context>::parseExpression): use updated API
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse): generate error messages
* wasm/WasmModuleParser.h:
(JSC::Wasm::ModuleParser::ModuleParser):
(JSC::Wasm::ModuleParser::failed):
(JSC::Wasm::ModuleParser::errorMessage):
(JSC::Wasm::ModuleParser::functionInformation):
(JSC::Wasm::ModuleParser::memory):
* wasm/WasmParser.h: use update non-public API
(JSC::Wasm::Parser::parseVarUInt32):
(JSC::Wasm::Parser::parseVarUInt64):
(JSC::Wasm::Parser::source):
(JSC::Wasm::Parser::length):
(JSC::Wasm::Parser::Parser):
(JSC::Wasm::Parser::consumeCharacter):
(JSC::Wasm::Parser::consumeString):
(JSC::Wasm::Parser::parseUInt32):
(JSC::Wasm::Parser::parseUInt7):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::~Plan):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::failed):
(JSC::Wasm::Plan::errorMessage):
(JSC::Wasm::Plan::resultSize):
(JSC::Wasm::Plan::result):
(JSC::Wasm::Plan::memory):
* wasm/js/JSWebAssemblyCompileError.cpp:
(JSC::createWebAssemblyCompileError): makes it easier to throw a WebAssembly.CompileError from Module
* wasm/js/JSWebAssemblyCompileError.h:
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::WebAssemblyCompileErrorConstructor::create):
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::create):
(JSC::WebAssemblyInstanceConstructor::finishCreation):
(JSC::WebAssemblyInstanceConstructor::visitChildren):
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::WebAssemblyMemoryConstructor::create):
(JSC::WebAssemblyMemoryConstructor::finishCreation):
(JSC::WebAssemblyMemoryConstructor::visitChildren):
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::create):
(JSC::WebAssemblyModuleConstructor::finishCreation):
(JSC::WebAssemblyModuleConstructor::visitChildren):
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::WebAssemblyRuntimeErrorConstructor::create):
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::WebAssemblyTableConstructor::create):
(JSC::WebAssemblyTableConstructor::finishCreation):
(JSC::WebAssemblyTableConstructor::visitChildren):
* wasm/js/WebAssemblyTableConstructor.h:

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

3 years agoAdd trivial Wasm conversion opcodes
keith_miller@apple.com [Tue, 25 Oct 2016 17:12:20 +0000 (17:12 +0000)]
Add trivial Wasm conversion opcodes
https://bugs.webkit.org/show_bug.cgi?id=163950

Reviewed by Filip Pizlo.

This patch differentiates between Wasm opcodes that are trivially mapped to a B3 opcode and
those that are not.  Some of the Wasm opcodes that are currently a non-simple opcode will
become simple as we add B3 opcodes for Wasm operations.  The remaining opcodes will need to
be added via patchpoints in a later patch.

JSTests:

* wasm/generate-wasmops-header.js:
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.Wasm.inline.bool.isSimple):
* wasm/wasm.json:

Source/JavaScriptCore:

* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmOps.h:
(JSC::Wasm::isSimple):

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

3 years agoUnreviewed, rolling out r207494.
cdumez@apple.com [Tue, 25 Oct 2016 16:34:32 +0000 (16:34 +0000)]
Unreviewed, rolling out r207494.

iOS SDK has been updated on the bots now so rollout the
rollout

Reverted changeset:

"Unreviewed, rolling out r207413."
https://bugs.webkit.org/show_bug.cgi?id=163547
http://trac.webkit.org/changeset/207494

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

3 years agoUnreviewed build fix.
jbedard@apple.com [Tue, 25 Oct 2016 16:26:18 +0000 (16:26 +0000)]
Unreviewed build fix.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.

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

3 years agoIndexedDB 2.0: Support new IDBTransaction interfaces.
beidson@apple.com [Tue, 25 Oct 2016 16:25:27 +0000 (16:25 +0000)]
IndexedDB 2.0: Support new IDBTransaction interfaces.
<rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore-rename-abort-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore-rename-store-expected.txt:
* web-platform-tests/IndexedDB/idbtransaction_objectStoreNames-expected.txt:
* web-platform-tests/IndexedDB/transaction-abort-multiple-metadata-revert-expected.txt:
* web-platform-tests/IndexedDB/transaction-abort-object-store-metadata-revert-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
       storage/indexeddb/modern/idbtransaction-objectstores-1.html
       At least partially passing results on 5 previously failed W3C tests.

The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStoreNames):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:

LayoutTests:

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

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

3 years agoAdd WKWebView fullscreen delegate SPI
jer.noble@apple.com [Tue, 25 Oct 2016 15:52:25 +0000 (15:52 +0000)]
Add WKWebView fullscreen delegate SPI
https://bugs.webkit.org/show_bug.cgi?id=163674

Reviewed by Anders Carlsson.

Source/WebKit2:

Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.

* UIProcess/API/APIFullscreenClient.h: Added.
(API::FullscreenClient::~FullscreenClient):
(API::FullscreenClient::willEnterFullscreen):
(API::FullscreenClient::didEnterFullscreen):
(API::FullscreenClient::willExitFullscreen):
(API::FullscreenClient::didExitFullscreen):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setFullscreenDelegate:]):
(-[WKWebView _fullscreenDelegate]):
(-[WKWebView _isInFullscreen]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
* UIProcess/Cocoa/FullscreenClient.h: Added.
(WebKit::FullscreenClient::~FullscreenClient):
* UIProcess/Cocoa/FullscreenClient.mm: Added.
(WebKit::FullscreenClient::FullscreenClient):
(WebKit::FullscreenClient::delegate):
(WebKit::FullscreenClient::setDelegate):
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setFullscreenClient):
(WebKit::WebPageProxy::fullScreenManager): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::fullscreenClient):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add a new API test which verifies that the fullscreen delegate receives notifications.

* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
(-[FullscreenDelegateMessageHandler userContentController:didReceiveScriptMessage:]):
(-[FullscreenDelegateMessageHandler _webViewWillEnterFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewDidEnterFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewWillExitFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewDidExitFullscreen:]):
(TestWebKitAPI::TEST):

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

3 years agoNon-specialized version of deleteObject should not have template argument
annulen@yandex.ru [Tue, 25 Oct 2016 15:52:10 +0000 (15:52 +0000)]
Non-specialized version of deleteObject should not have template argument
https://bugs.webkit.org/show_bug.cgi?id=163943

Reviewed by Anders Carlsson.

Fixes compilation of GDIObject.h with MinGW

* wtf/win/GDIObject.h:
(WTF::deleteObject):

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

3 years agoMediaEndpointConfiguration does not need to be refcounted
commit-queue@webkit.org [Tue, 25 Oct 2016 15:02:39 +0000 (15:02 +0000)]
MediaEndpointConfiguration does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163888

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-25
Reviewed by Eric Carlson.

No change of behavior.

Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
This allows ensuring that the configuration is not null and removes the need to ref-count it.

Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
Updated MediaEndpointOwr and mock implementations accordingly.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setConfiguration):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
(WebCore::MediaEndpointConfiguration::iceServers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
* platform/mock/MockMediaEndpoint.h:

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

3 years agoCachedResourceLoader should set headers of the HTTP request prior checking for the...
commit-queue@webkit.org [Tue, 25 Oct 2016 14:16:15 +0000 (14:16 +0000)]
CachedResourceLoader should set headers of the HTTP request prior checking for the cache
https://bugs.webkit.org/show_bug.cgi?id=163103

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

No expected change of behavior.

Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
This allows simplifying vary header checks and is more inline with the fetch specification.

To compute the referrer value, we need to know whether the request is cross-origin.
A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.

We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
This could be done as a follow-up patch.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::load):
(WebCore::CachedResource::varyHeaderValuesMatch):
(WebCore::addAdditionalRequestHeadersToRequest): Deleted.
(WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
(WebCore::isRequestCrossOrigin):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setOrigin):

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

3 years agoUnreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
carlosgc@webkit.org [Tue, 25 Oct 2016 12:16:26 +0000 (12:16 +0000)]
Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.

* NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.

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

3 years agoUnreviewed. Fix Soup based ports debug build after r207813.
carlosgc@webkit.org [Tue, 25 Oct 2016 10:36:41 +0000 (10:36 +0000)]
Unreviewed. Fix Soup based ports debug build after r207813.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::authenticateCallback):
(WebKit::NetworkDataTaskSoup::requestStartedCallback):

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

3 years agoMore PassRefPtr purging in WebCore.
akling@apple.com [Tue, 25 Oct 2016 10:27:12 +0000 (10:27 +0000)]
More PassRefPtr purging in WebCore.
<https://webkit.org/b/163895>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::contentToCSSValue):
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertQuotes):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList):
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/InputType.cpp:
(WebCore::InputType::themeSupportsDataListUI):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldHaveSpinButton):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
* page/FrameView.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
(WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
(WebCore::PropertyWrapperShape::PropertyWrapperShape):
(WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
* platform/PopupMenuClient.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::createScrollbar):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::createNativeScrollbar):
* platform/Scrollbar.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/FilterEffectRenderer.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::createLocalTransformState):
(WebCore::RenderLayer::hitTestLayerByApplyingTransform):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderMenuList.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar):
* rendering/RenderScrollbar.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderSearchField.h:
* rendering/RenderTheme.h:
(WebCore::RenderTheme::defaultTheme):
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::create):
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeEfl.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeMac.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidget):
* rendering/RenderWidget.h:
* rendering/style/CursorData.h:
(WebCore::CursorData::CursorData):
(WebCore::CursorData::setImage):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::setImage):
* rendering/style/QuotesData.cpp:
(WebCore::QuotesData::create):
* rendering/style/QuotesData.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor):
(WebCore::RenderStyle::setCursorList):
(WebCore::RenderStyle::setQuotes):
(WebCore::RenderStyle::setWillChange):
(WebCore::RenderStyle::setContent):
(WebCore::RenderStyle::setListStyleImage):
(WebCore::RenderStyle::setBorderImageSource):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setMaskImage):
(WebCore::RenderStyle::setMaskBoxImageSource):
(WebCore::RenderStyle::setBoxReflect):
(WebCore::RenderStyle::setShapeOutside):
(WebCore::RenderStyle::setClipPath):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue):
* rendering/style/StyleGeneratedImage.h:
* rendering/style/StyleImage.h:
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareInheritedData.h:

Source/WebKit2:

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar):

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

3 years agoNetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask imple...
carlosgc@webkit.org [Tue, 25 Oct 2016 10:25:29 +0000 (10:25 +0000)]
NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
https://bugs.webkit.org/show_bug.cgi?id=163777

Reviewed by Alex Christensen.

The subclass model allows us to choose the implementation at run time, so we could add other implementations
like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
in WebKit2.

* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/NetworkDataTask.cpp: Added.
(WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
(WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
here to handle the early failures.
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::failureTimerFired):
* NetworkProcess/NetworkDataTask.h: Remove platform specific members.
(WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
(WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
(WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
(WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
* NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
* NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
(WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
the custom protocol manager, otherwise simply create a default session.
(WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
NetworkSessionSoup here.
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/NetworkSession.h: Remove platform specific members.
(WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
(WebKit::NetworkSession::clearCredentials): Ditto.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::didSendData):
(WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
(WebKit::NetworkDataTaskCocoa::didReceiveResponse):
(WebKit::NetworkDataTaskCocoa::didReceiveData):
(WebKit::NetworkDataTaskCocoa::didBecomeDownload):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
(WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
(WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
(WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
(WebKit::NetworkDataTaskCocoa::suggestedFilename):
(WebKit::NetworkDataTaskCocoa::cancel):
(WebKit::NetworkDataTaskCocoa::resume):
(WebKit::NetworkDataTaskCocoa::suspend):
(WebKit::NetworkDataTaskCocoa::state):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(WebKit::configurationForSessionID):
(WebKit::NetworkSessionCocoa::setCustomProtocolManager):
(WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
(WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
(WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::defaultSession):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
(WebKit::NetworkSessionCocoa::clearCredentials):
(WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
(WebKit::NetworkSessionCocoa::addDownloadID):
(WebKit::NetworkSessionCocoa::downloadID):
(WebKit::NetworkSessionCocoa::takeDownloadID):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::suggestedFilename):
(WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::clearRequest):
(WebKit::NetworkDataTaskSoup::resume):
(WebKit::NetworkDataTaskSoup::suspend):
(WebKit::NetworkDataTaskSoup::cancel):
(WebKit::NetworkDataTaskSoup::invalidateAndCancel):
(WebKit::NetworkDataTaskSoup::state):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::startTimeout):
(WebKit::NetworkDataTaskSoup::stopTimeout):
(WebKit::NetworkDataTaskSoup::sendRequestCallback):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::didReceiveResponse):
(WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
(WebKit::NetworkDataTaskSoup::authenticateCallback):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
(WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
(WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
(WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::readCallback):
(WebKit::NetworkDataTaskSoup::read):
(WebKit::NetworkDataTaskSoup::didRead):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::requestNextPartCallback):
(WebKit::NetworkDataTaskSoup::requestNextPart):
(WebKit::NetworkDataTaskSoup::didRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::gotHeadersCallback):
(WebKit::NetworkDataTaskSoup::didGetHeaders):
(WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
(WebKit::NetworkDataTaskSoup::didWriteBodyData):
(WebKit::NetworkDataTaskSoup::download):
(WebKit::NetworkDataTaskSoup::writeDownloadCallback):
(WebKit::NetworkDataTaskSoup::writeDownload):
(WebKit::NetworkDataTaskSoup::didWriteDownload):
(WebKit::NetworkDataTaskSoup::didFinishDownload):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEventCallback):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::startingCallback):
(WebKit::NetworkDataTaskSoup::requestStartedCallback):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::restartedCallback):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
(WebKit::NetworkSessionSoup::~NetworkSessionSoup):
(WebKit::NetworkSessionSoup::soupSession):
(WebKit::NetworkSessionSoup::invalidateAndCancel):
* NetworkProcess/soup/NetworkSessionSoup.h: Added.
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
* PlatformEfl.cmake: Add new files to compilation.
* PlatformGTK.cmake: Ditto.
* WebKit2.xcodeproj/project.pbxproj: Ditto.
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.

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

3 years agoAdd support for introducing simulated latency in network process
antti@apple.com [Tue, 25 Oct 2016 08:22:19 +0000 (08:22 +0000)]
Add support for introducing simulated latency in network process
https://bugs.webkit.org/show_bug.cgi?id=163902

Reviewed by Alex Christensen.

For testing purposes it is useful to have a mechanism for simulating high latency.
This patch adds a basic mechanism that introduces a delay to each response in network
process. In Safari it can be used with

     defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200

Setting the delay to 0 disables the feature.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::Throttle::Throttle):
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::didReceiveData):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::throttleDelayCompleted):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::loadThrottleLatency):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

3 years agoRebase test after r207805
achristensen@apple.com [Tue, 25 Oct 2016 07:01:57 +0000 (07:01 +0000)]
Rebase test after r207805
https://bugs.webkit.org/show_bug.cgi?id=163929

* fetch/fetch-url-serialization-expected.txt:

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

3 years agoCustom elements reactions should have a queue per element
rniwa@webkit.org [Tue, 25 Oct 2016 06:18:13 +0000 (06:18 +0000)]
Custom elements reactions should have a queue per element
https://bugs.webkit.org/show_bug.cgi?id=163878

Reviewed by Antti Koivisto.

Source/WebCore:

This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
and introduces the backup element queue:
https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue

In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
for each custom element when it is synchronously constructed or enqueued to upgrade.

Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
CustomElementReactionQueueItem stores JSCustomElementInterface.

The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.

ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
fallback to the backup queue when the stack is empty as specified:
https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue

Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
the element queue will have duplicates only when each reaction queue has more than one item.

Tests: fast/custom-elements/backup-element-queue.html
       fast/custom-elements/custom-element-reaction-queue.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
(WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
is explicitly cleared in Element::setIsFailedCustomElement.
(WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
each item in the queue no longer stores Element or JSCustomElementInterface.
(WebCore::CustomElementReactionQueue::clear):
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::invokeAll):
(WebCore::CustomElementReactionStack::ElementQueue::add): Added.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
(WebCore::CustomElementReactionStack::ensureCurrentQueue):
(WebCore::BackupElementQueueMicrotask): Added.
(WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
(WebCore::CustomElementReactionStack::processBackupQueue): Added.
(WebCore::CustomElementReactionStack::backupElementQueue): Added.
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
* dom/Document.cpp:
(WebCore::createFallbackHTMLElement):
* dom/Element.cpp:
(WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
(WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
(WebCore::Element::enqueueToUpgrade): Added.
(WebCore::Element::reactionQueue): Added.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
(WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.

LayoutTests:

Added a W3C style testharness.js test for making sure the custom element reaction queue exists per element,
and added a WebKit style test for making sure that the backup element queue exists.

* fast/custom-elements/backup-element-queue-expected.txt: Added.
* fast/custom-elements/backup-element-queue.html: Added.
* fast/custom-elements/custom-element-reaction-queue-expected.txt: Added.
* fast/custom-elements/custom-element-reaction-queue.html: Added.

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

3 years agoUpdate SubtleCrypto::generateKey to match the latest spec
jiewen_tan@apple.com [Tue, 25 Oct 2016 06:07:04 +0000 (06:07 +0000)]
Update SubtleCrypto::generateKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=163718
<rdar://problem/28864380>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* WebCryptoAPI/generateKey/test_aes-cbc-expected.txt:
* WebCryptoAPI/generateKey/test_aes-cbc.html:
* WebCryptoAPI/generateKey/test_aes-ctr-expected.txt:
* WebCryptoAPI/generateKey/test_aes-ctr.html:
* WebCryptoAPI/generateKey/test_failures-expected.txt:
* WebCryptoAPI/generateKey/test_failures.html:
* WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt:
* WebCryptoAPI/generateKey/test_failures_AES-CBC.html:
* WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt:
* WebCryptoAPI/generateKey/test_failures_AES-CTR.html:
* WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt:
* WebCryptoAPI/generateKey/test_failures_AES-GCM.html:
* WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt:
* WebCryptoAPI/generateKey/test_failures_AES-KW.html:
* WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt:
* WebCryptoAPI/generateKey/test_failures_ECDH.html:
* WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt:
* WebCryptoAPI/generateKey/test_failures_ECDSA.html:
* WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt:
* WebCryptoAPI/generateKey/test_failures_HMAC.html:
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt:
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html:
* WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt:
* WebCryptoAPI/generateKey/test_failures_RSA-PSS.html:
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt:
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html:
* WebCryptoAPI/generateKey/test_successes-expected.txt:
* WebCryptoAPI/generateKey/test_successes.html:
* WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt:
* WebCryptoAPI/generateKey/test_successes_AES-CBC.html:
* WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt:
* WebCryptoAPI/generateKey/test_successes_AES-CTR.html:
* WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt:
* WebCryptoAPI/generateKey/test_successes_AES-GCM.html:
* WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt:
* WebCryptoAPI/generateKey/test_successes_AES-KW.html:
* WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt:
* WebCryptoAPI/generateKey/test_successes_ECDH.html:
* WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt:
* WebCryptoAPI/generateKey/test_successes_ECDSA.html:
* WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt:
* WebCryptoAPI/generateKey/test_successes_HMAC.html:
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt:
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html:
* WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt:
* WebCryptoAPI/generateKey/test_successes_RSA-PSS.html:
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt:
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::generateKey method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
   It also refers to the latest Editor's Draft at a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
   HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.

Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
       crypto/subtle/aes-cbc-generate-key-length-192.html
       crypto/subtle/aes-cbc-generate-key-length-256.html
       crypto/subtle/aes-generate-key-malformed-parameters.html
       crypto/subtle/aes-kw-generate-key.html
       crypto/subtle/generate-key-malformed-paramters.html
       crypto/subtle/hmac-generate-key-customized-length.html
       crypto/subtle/hmac-generate-key-hash-object.html
       crypto/subtle/hmac-generate-key-malformed-parameters.html
       crypto/subtle/hmac-generate-key-sha1.html
       crypto/subtle/hmac-generate-key-sha224.html
       crypto/subtle/hmac-generate-key-sha256.html
       crypto/subtle/hmac-generate-key-sha384.html
       crypto/subtle/hmac-generate-key-sha512.html
       crypto/subtle/rsa-generate-key-malformed-parameters.html
       crypto/subtle/rsa-oaep-generate-key.html
       crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
       crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
       crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
       crypto/webkitSubtle/hmac-generate-key.html:
       crypto/workers/subtle/aes-generate-key.html
       crypto/workers/subtle/hmac-generate-key.html
       crypto/workers/subtle/rsa-generate-key.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp: Added.
(WebCore::toHashIdentifier):
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::createAlgorithm):
(WebCore::rejectWithException):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::JSSubtleCrypto::generateKey):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::generateKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::generateKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h: Added.
(WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::parametersClass):
* crypto/CryptoAlgorithmParameters.idl: Added.
* crypto/CryptoAlgorithmParametersDeprecated.h:
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::setUsagesBitmap):
* crypto/CryptoKey.h:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::generate):
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::generate):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesKeyGenParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
(WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
* crypto/parameters/HmacKeyGenParams.idl: Added.
* crypto/parameters/RsaHashedKeyGenParams.idl: Added.
* crypto/parameters/RsaKeyGenParams.idl: Added.

LayoutTests:

Besides adding tests for SubtleCrypto::generateKey related stuff and fixing HMAC. This patch also add
shouldReject(_a, _rejectCallback, _resolveCallback, _message) in js-test-pre.js.

* TestExpectations:
* crypto/subtle/aes-cbc-generate-key-length-128-expected.txt: Added.
* crypto/subtle/aes-cbc-generate-key-length-128.html: Added.
* crypto/subtle/aes-cbc-generate-key-length-192-expected.txt: Added.
* crypto/subtle/aes-cbc-generate-key-length-192.html: Added.
* crypto/subtle/aes-cbc-generate-key-length-256-expected.txt: Added.
* crypto/subtle/aes-cbc-generate-key-length-256.html: Added.
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-generate-key-malformed-parameters.html: Added.
* crypto/subtle/aes-kw-generate-key-expected.txt: Added.
* crypto/subtle/aes-kw-generate-key.html: Added.
* crypto/subtle/generate-key-malformed-paramters-expected.txt: Added.
* crypto/subtle/generate-key-malformed-paramters.html: Added.
* crypto/subtle/hmac-generate-key-customized-length-expected.txt: Added.
* crypto/subtle/hmac-generate-key-customized-length.html: Added.
* crypto/subtle/hmac-generate-key-hash-object-expected.txt: Added.
* crypto/subtle/hmac-generate-key-hash-object.html: Added.
* crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/hmac-generate-key-malformed-parameters.html: Added.
* crypto/subtle/hmac-generate-key-sha1-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sha1.html: Added.
* crypto/subtle/hmac-generate-key-sha224-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sha224.html: Added.
* crypto/subtle/hmac-generate-key-sha256-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sha256.html: Added.
* crypto/subtle/hmac-generate-key-sha384-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sha384.html: Added.
* crypto/subtle/hmac-generate-key-sha512-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sha512.html: Added.
* crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-generate-key-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-generate-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-key.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html: Added.
* crypto/webkitSubtle/hmac-generate-key-expected.txt:
* crypto/webkitSubtle/hmac-generate-key.html:
* crypto/workers/subtle/aes-generate-key-expected.txt: Added.
* crypto/workers/subtle/aes-generate-key.html: Added.
* crypto/workers/subtle/hmac-generate-key-expected.txt: Added.
* crypto/workers/subtle/hmac-generate-key.html: Added.
* crypto/workers/subtle/resources/aes-generate-key.js: Added.
* crypto/workers/subtle/resources/hmac-generate-key.js: Added.
* crypto/workers/subtle/resources/rsa-generate-key.js: Added.
* crypto/workers/subtle/rsa-generate-key-expected.txt: Added.
* crypto/workers/subtle/rsa-generate-key.html: Added.
* resources/js-test-pre.js:

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

3 years agoRemove unused ANGLE.vcxproj after switching to CMake on Windows
achristensen@apple.com [Tue, 25 Oct 2016 05:26:35 +0000 (05:26 +0000)]
Remove unused ANGLE.vcxproj after switching to CMake on Windows

* ANGLE.vcxproj: Removed.
* ANGLE.vcxproj/ANGLERelease.props: Removed.
* ANGLE.vcxproj/DirectX32.props: Removed.
* ANGLE.vcxproj/DirectX64.props: Removed.
* ANGLE.vcxproj/libEGL.vcxproj: Removed.
* ANGLE.vcxproj/libEGL.vcxproj.filters: Removed.
* ANGLE.vcxproj/libEGLCommon.props: Removed.
* ANGLE.vcxproj/libGLESv2.vcxproj: Removed.
* ANGLE.vcxproj/libGLESv2.vcxproj.filters: Removed.
* ANGLE.vcxproj/libGLESv2Common.props: Removed.
* ANGLE.vcxproj/preprocessor.vcxproj: Removed.
* ANGLE.vcxproj/preprocessor.vcxproj.filters: Removed.
* ANGLE.vcxproj/translatorCommon.props: Removed.
* ANGLE.vcxproj/translator_common.vcxproj: Removed.
* ANGLE.vcxproj/translator_common.vcxproj.filters: Removed.
* ANGLE.vcxproj/translator_glsl.vcxproj: Removed.
* ANGLE.vcxproj/translator_glsl.vcxproj.filters: Removed.
* ANGLE.vcxproj/translator_hlsl.vcxproj: Removed.
* ANGLE.vcxproj/translator_hlsl.vcxproj.filters: Removed.

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

3 years agoREGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
mitz@apple.com [Tue, 25 Oct 2016 05:22:40 +0000 (05:22 +0000)]
REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
https://bugs.webkit.org/show_bug.cgi?id=163879
<rdar://problem/28728735>

Reviewed by Darin Adler.

* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
  the UI process, is sandboxed before trying to find out if the Web process is being
  debugged.

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

3 years agoIDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary...
cdumez@apple.com [Tue, 25 Oct 2016 05:16:00 +0000 (05:16 +0000)]
IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
https://bugs.webkit.org/show_bug.cgi?id=163916

Reviewed by Darin Adler.

Source/WebCore:

IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters

Align our IDL with the specification.

No new tests, no expected Web-exposed behavior change.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath):
* Modules/indexeddb/IDBKeyPath.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBDatabaseCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(GenerateConstructorDefinition):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
* dom/MessageEvent.h:
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):

LayoutTests:

Rebaseline existing tests now that the exception messages differ slightly.

* storage/indexeddb/create-object-store-options-expected.txt:
* storage/indexeddb/create-object-store-options-private-expected.txt:

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

3 years agoURLParser should match old URL::parse with %2E in path
achristensen@apple.com [Tue, 25 Oct 2016 04:40:23 +0000 (04:40 +0000)]
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.

* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

LayoutTests:

* fast/url/path-expected.txt:
* fast/url/standard-url-expected.txt:

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

3 years agoDo not update selection rect on dirty lineboxes.
zalan@apple.com [Tue, 25 Oct 2016 04:19:09 +0000 (04:19 +0000)]
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>

Reviewed by Simon Fraser.

Source/WebCore:

In certain cases RenderBlock::updateFirstLetter() triggers
unwanted render tree mutation while the caller assumes intact renderers.
This patch ensures that no renderers gets destroyed while computing the preferred widths
when we are outside of layout context.

Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter):
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter):
* rendering/RenderTable.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter):
* rendering/svg/RenderSVGText.h:

LayoutTests:

* fast/css-generated-content/dynamic-first-letter-selection-clear-crash-expected.txt: Added.
* fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html: Added.

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

3 years agoUnreviewed, rolling out r207795.
ryanhaddad@apple.com [Tue, 25 Oct 2016 03:46:32 +0000 (03:46 +0000)]
Unreviewed, rolling out r207795.

Introduced API test failures on iOS and macOS.

Reverted changeset:

"URLParser should match old URL::parse with %2E in path"
https://bugs.webkit.org/show_bug.cgi?id=163929
http://trac.webkit.org/changeset/207795

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

3 years agoUnreviewed, attempt to fix Windows build after r207787
utatane.tea@gmail.com [Tue, 25 Oct 2016 02:55:22 +0000 (02:55 +0000)]
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657

Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
It's a bit unfortunate that we need to introduce a workaround here.

* domjit/DOMJITAbstractHeapRepository.h:

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

3 years agoArrow functions with concise bodies cannot return regular expressions
utatane.tea@gmail.com [Tue, 25 Oct 2016 02:35:59 +0000 (02:35 +0000)]
Arrow functions with concise bodies cannot return regular expressions
https://bugs.webkit.org/show_bug.cgi?id=163162

Reviewed by Filip Pizlo.

JSTests:

* ChakraCore/test/Operators/instanceof.baseline-jsc:
* ChakraCore/test/Regex/nul_character.baseline-jsc:
* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/parse-regexp-as-token.js: Added.
(shouldBe):

Source/JavaScriptCore:

When we encounter the RegExp in the parser, we first scan it as / or /=.
And if / or /= is parsed under the primary expression context, we rescan it
as RegExp. However, we did not update the token record information. So the
token record still says "I'm / or /=".

When we parse the string "() => /hello/", the last token becomes "/", which is
the first character of the RegExp, instead of "/hello/". Since the arrow
function parsing utilizes the end offset of the last token, we accidentally
recognize the range of the above arrow function as "() => /".

In this patch, we update the token when rescanning under the RegExp context.
This logic is similar to parsing Tail Template Literal token.

We also refine the error message for regular expression literals. And since
the REGEXP token is now introduced, the other error messages using that token
are improved too.

Currently, unterminated error messages can be seen in Parser.cpp. However,
these messages cannot be shown to users if the lexer has m_error. So these
code is meaningless. I'll move these tokenizing errors to the lexer in the
subsequent patch[1].

[1]: https://bugs.webkit.org/show_bug.cgi?id=163928

* parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTrailingTemplateString):
(JSC::Lexer<T>::skipRegExp): Deleted.
* parser/Lexer.h:
(JSC::Lexer::getToken):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::getToken):
* parser/ParserTokens.h:

LayoutTests:

* fast/regex/dom/non-pattern-characters-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/regexp-compile-crash-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt:

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

3 years agoevent.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
cdumez@apple.com [Tue, 25 Oct 2016 01:48:42 +0000 (01:48 +0000)]
event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
https://bugs.webkit.org/show_bug.cgi?id=19893
<rdar://problem/6055546>

Reviewed by Ryosuke Niwa.

Source/WebCore:

We now write selection as HTML as well to the pasteboard so that
event.(dataTransfer|clipboardData).getData('text/html') now works.

I have verified manually that it is still possible to copy text from
Safari and paste it to Excel 2011 Mac after this change. The text is
now pasted as HTML instead of text, which is fine because Excel can
display HTML.

No new tests, unskipped existing tests.

* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionInHTMLFormat):
(WebCore::Editor::writeSelectionToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):

LayoutTests:

Unskip corresponding tests on Mac.

* editing/pasteboard/onpaste-text-html-expected.txt:
* fast/events/ondrop-text-html-expected.txt:
* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:

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

3 years agoURLParser should match old URL::parse with %2E in path
achristensen@apple.com [Tue, 25 Oct 2016 01:31:42 +0000 (01:31 +0000)]
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.

* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

LayoutTests:

* fast/url/path-expected.txt:
* fast/url/standard-url-expected.txt:
* fetch/fetch-url-serialization-expected.txt:

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

3 years ago[Win] CMake build type is not set.
pvollan@apple.com [Tue, 25 Oct 2016 00:45:03 +0000 (00:45 +0000)]
[Win] CMake build type is not set.
https://bugs.webkit.org/show_bug.cgi?id=163917

Reviewed by Alex Christensen.

The CMAKE_BUILD_TYPE variable should be set to Debug or Release.

Source/JavaScriptCore:

* JavaScriptCore.vcxproj/JavaScriptCore.proj:

Source/WebCore:

* WebCore.vcxproj/WebCore.proj:

Source/WebKit:

* WebKit.vcxproj/WebKit.proj:

Source/WTF:

* WTF.vcxproj/WTF.proj:

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

3 years agoUnreviewed, attempt to fix Windows build after r207787
utatane.tea@gmail.com [Tue, 25 Oct 2016 00:31:05 +0000 (00:31 +0000)]
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657

According to the similar code in WebKit, I guess that
Visual C++ requires friend class declaration is done
in the private section to access private members.

And I also changed ::instance to ::shared to align to
the existing WebCore code.

* domjit/DOMJITAbstractHeapRepository.cpp:
(WebCore::DOMJIT::AbstractHeapRepository::shared):
(WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):

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

3 years agoFix the lifetime of strings used in LOG_WITH_STREAM
simon.fraser@apple.com [Tue, 25 Oct 2016 00:22:08 +0000 (00:22 +0000)]
Fix the lifetime of strings used in LOG_WITH_STREAM
https://bugs.webkit.org/show_bug.cgi?id=163923

Reviewed by Brent Fulgham.

Make sure the const char* passed to WTFLog() outlives the call.

Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
pattern.

* platform/LogMacros.h:
* platform/Logging.cpp:
(WebCore::logFunctionResult): Deleted.

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

3 years agoReduce special handling for typed arrays in JSDOMConvert.h
cdumez@apple.com [Tue, 25 Oct 2016 00:16:29 +0000 (00:16 +0000)]
Reduce special handling for typed arrays in JSDOMConvert.h
https://bugs.webkit.org/show_bug.cgi?id=163907

Reviewed by Sam Weinig.

Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
function on JSGenericTypedArrayView, similarly to other wrapper types.

Source/JavaScriptCore:

* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::typedImpl):
(JSC::JSGenericTypedArrayView<Adaptor>::toWrapped):

Source/WebCore:

No new tests, no web-exposed behavior change.

* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.

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

3 years agoUnreviewed, rolling out r207783.
ryanhaddad@apple.com [Tue, 25 Oct 2016 00:11:38 +0000 (00:11 +0000)]
Unreviewed, rolling out r207783.

This change appears to have caused fast/selectors/invalid-
functional-pseudo-class.html to crash on iOS and macOS

Reverted changeset:

"[CSS Parser] Fix :lang argument parsing"
https://bugs.webkit.org/show_bug.cgi?id=163913
http://trac.webkit.org/changeset/207783

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

3 years ago[DOMJIT][DFG] CallDOM never writes Stack
utatane.tea@gmail.com [Tue, 25 Oct 2016 00:07:15 +0000 (00:07 +0000)]
[DOMJIT][DFG] CallDOM never writes Stack
https://bugs.webkit.org/show_bug.cgi?id=163926

Reviewed by Filip Pizlo and Saam Barati.

There is no way to write(Stack) in CallDOM.
This worst case (the most clobbering case) scenario
should be aligned to the one of Call, read(World) and write(Heap).

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

3 years agoIndexedDB 2.0: Support new IDBKeyRange interfaces.
beidson@apple.com [Tue, 25 Oct 2016 00:05:24 +0000 (00:05 +0000)]
IndexedDB 2.0: Support new IDBKeyRange interfaces.
<rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910

Reviewed by Andy Estes.

Source/WebCore:

No new tests (Covered by additions to existing test)

The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::contains):
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:

LayoutTests:

* storage/indexeddb/keyrange-expected.txt:
* storage/indexeddb/keyrange-private-expected.txt:
* storage/indexeddb/resources/keyrange.js:

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

3 years ago[DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
utatane.tea@gmail.com [Mon, 24 Oct 2016 23:34:32 +0000 (23:34 +0000)]
[DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
https://bugs.webkit.org/show_bug.cgi?id=163657

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch introduces DOMJIT::Effect. It describes the side effects of
the DOMJIT::CallDOMPatchpoint. DOMJIT::CallDOMPatchpoint can use this
feature to teach the compilers about the effects. And the compilers
will perform CSE based on the reported effects.

As the same to B3's HeapRange, the effects are represented as a pair of
integers. [begin, end) pair will represents the range of the abstract
heap. We encode the abstract heap hierarchy into these pairs. Like,

                        Root: [0, 32)
         Child1: [0, 20)             Child2: [20, 32)
Child11: [0, 4) Child12: [4, 20)

This simplifies the representation of the abstract heap. And WebCore
just tells pairs of integers and it does not tell any detailed hierarchy.
So, DFG and FTL can optimize DOM operations without deep knowledge of
the DOM abstract heap hierarchy. For example, WebCore will tell that
firstChild will read Node_firstChild abstract heap. But this information
is encoded to the pair and DFG does not know the details. But still
DFG can understand the abstract heap hierarchy and can query whether the
given abstract heap overlaps with some abstract heap.

The heap range told by the WebCore is represented as DOMJIT::HeapRange.
DFG will handle this under the DOMState abstract heap. DOMJIT::HeapRange
is stored in DFG::AbstractHeap's Payload. We maintain the hierarchy by
DOMJIT::HeapRange in the DOMState abstract heap. We add a necessary
handling in DFG's AbstractHeap and ClobberSet.

And we also introduce DOMStateLoc for HeapLocation. It is combined with
DOMState AbstractHeap with DOMJIT::HeapRange. For example, we can
represent Node.firstChild as `read(DOMState:Node_firstChild)` and
`def(HeapLocation(node, DOMState:Node_firstChild))` thingy. This allows us
to perform CSE onto DOM getters that will read some of DOM heap!

For simplicity, we convert CallDOM from NodeVarArgs to the normal one.
CallDOM is now just used for DOMJIT getter. So its children is at most 2.
It may have either 1 or 2 children. If the global object is required
by CallDOMPatchpoint, it has 2 children. And we changed the order of
the children to further simplify the code. Before this change, the order
is 1: globalObject 2: base. After this patch, the order becomes 1: base,
and 2: globalObject. And the child2 may not exists if the global object
is not required. We changed all the existing DOMJIT patchpoint to this
form.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::emitDOMJITGetter):
* dfg/DFGAbstractHeap.cpp:
(JSC::DFG::AbstractHeap::dump):
* dfg/DFGAbstractHeap.h:
(JSC::DFG::AbstractHeap::isStrictSubtypeOf):
(JSC::DFG::AbstractHeap::overlaps):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::blessCallDOM):
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
* dfg/DFGClobberSet.cpp:
(JSC::DFG::ClobberSet::overlaps):
* dfg/DFGClobberSet.h:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGNode.h:
(JSC::DFG::Node::hasCallDOMData):
(JSC::DFG::Node::callDOMData):
(JSC::DFG::Node::hasCallDOMPatchpoint): Deleted.
(JSC::DFG::Node::callDOMPatchpoint): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOM):
* domjit/DOMJITAbstractHeap.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(JSC::DOMJIT::AbstractHeap::compute):
(JSC::DOMJIT::AbstractHeap::dump):
(JSC::DOMJIT::AbstractHeap::shallowDump):
(JSC::DOMJIT::AbstractHeap::deepDump):
* domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(JSC::DOMJIT::AbstractHeap::AbstractHeap):
(JSC::DOMJIT::AbstractHeap::setParent):
(JSC::DOMJIT::AbstractHeap::isRoot):
(JSC::DOMJIT::AbstractHeap::isComputed):
(JSC::DOMJIT::AbstractHeap::range):
* domjit/DOMJITCallDOMPatchpoint.h:
* domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(JSC::DOMJIT::Effect::forReadWrite):
(JSC::DOMJIT::Effect::forPure):
(JSC::DOMJIT::Effect::forDef):
(JSC::DOMJIT::Effect::mustGenerate):
* domjit/DOMJITHeapRange.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(JSC::DOMJIT::HeapRange::dump):
* domjit/DOMJITHeapRange.h: Added.
(JSC::DOMJIT::HeapRange::HeapRange):
(JSC::DOMJIT::HeapRange::fromRaw):
(JSC::DOMJIT::HeapRange::begin):
(JSC::DOMJIT::HeapRange::end):
(JSC::DOMJIT::HeapRange::rawRepresentation):
(JSC::DOMJIT::HeapRange::operator bool):
(JSC::DOMJIT::HeapRange::operator==):
(JSC::DOMJIT::HeapRange::top):
(JSC::DOMJIT::HeapRange::none):
(JSC::DOMJIT::HeapRange::isStrictSubtypeOf):
(JSC::DOMJIT::HeapRange::isSubtypeOf):
(JSC::DOMJIT::HeapRange::overlaps):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOM):
* jsc.cpp:

Source/WebCore:

CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
heap. And then it encodes these information into the pairs of the integers.

And this patch also changes the DOMJIT::PatchpointParams' parameter order.
So we change them in all the DOMJIT::CallDOMPatchpoint sites.

* CMakeLists.txt:
* ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* WebCore.xcodeproj/project.pbxproj:
* domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
(WebCore::DOMJIT::AbstractHeapRepository::instance):
* domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
(WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
(WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
(WebCore::DOMJITHelpers::toWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNode): Deleted.
(WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
(WebCore::DOMJITHelpers::branchIfElement): Deleted.
(WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
(WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::callDOM):

Source/WTF:

Simplify nonEmptyRangesOverlap.

* wtf/MathExtras.h:
(WTF::nonEmptyRangesOverlap):

LayoutTests:

* js/dom/domjit-accessor-different-effect-expected.txt: Added.
* js/dom/domjit-accessor-different-effect.html: Added.
* js/dom/domjit-accessor-effect-expected.txt: Added.
* js/dom/domjit-accessor-effect-should-overlap-with-call-expected.txt: Added.
* js/dom/domjit-accessor-effect-should-overlap-with-call.html: Added.
* js/dom/domjit-accessor-effect.html: Added.
* js/dom/domjit-accessor-licm-expected.txt: Added.
* js/dom/domjit-accessor-licm.html: Added.
* js/dom/domjit-accessor-node-type-effect-should-not-overlap-with-call-since-pure-expected.txt: Added.
* js/dom/domjit-accessor-node-type-effect-should-not-overlap-with-call-since-pure.html: Added.

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

3 years agoFont variations test gardening
mmaxfield@apple.com [Mon, 24 Oct 2016 23:12:15 +0000 (23:12 +0000)]
Font variations test gardening

Unreviewed.

* platform/mac/TestExpectations:

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

3 years agoJSONParse should not crash with null Strings
achristensen@apple.com [Mon, 24 Oct 2016 22:51:59 +0000 (22:51 +0000)]
JSONParse should not crash with null Strings
https://bugs.webkit.org/show_bug.cgi?id=163918
<rdar://problem/28834095>

Reviewed by Michael Saboff.

When JSONParse is called with a null String, it calls String::is8bit, which dereferences a null pointer.
This is happening with new work in the Fetch API, but callers of JSONParse should not have to check
if the String is null.

* API/tests/JSONParseTest.cpp: Added.
(testJSONParse):
* API/tests/JSONParseTest.h: Added.
* API/tests/testapi.c:
(main):
Test parsing null Strings.  They should have the same result as parsing empty Strings.
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSONObject.cpp:
(JSC::JSONParse):
Check for null Strings.
* shell/PlatformWin.cmake:

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

3 years agoWeb Inspector: Scope chain shouldn't show empty Closure sections
commit-queue@webkit.org [Mon, 24 Oct 2016 22:09:29 +0000 (22:09 +0000)]
Web Inspector: Scope chain shouldn't show empty Closure sections
https://bugs.webkit.org/show_bug.cgi?id=152348

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-24
Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(isEmptyObject):
(InjectedScript.CallFrameProxy._createScopeJson):
If the scope object has no properties, set empty to true.

* inspector/protocol/Debugger.json:
Added empty property to Scope type.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
* UserInterface/Models/ScopeChainNode.js:
(WebInspector.ScopeChainNode):
(WebInspector.ScopeChainNode.prototype.get empty):
Added support for new empty property.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
Only create and display a DetailsSection if the scope is not empty (via empty).

LayoutTests:

* inspector/model/scope-chain-node-expected.txt:
* inspector/model/scope-chain-node.html:
Added "empty" indicators to scopes without any property descriptors.

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

3 years ago[CSS Parser] Fix :lang argument parsing
hyatt@apple.com [Mon, 24 Oct 2016 21:51:44 +0000 (21:51 +0000)]
[CSS Parser] Fix :lang argument parsing
https://bugs.webkit.org/show_bug.cgi?id=163913

Reviewed by Zalan Bujtas.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Modify the map to support versions of the function pseudos
without the left paren included.

* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setLangArgumentList):
* css/parser/CSSParserValues.h:
Add a helper to just directly pass an AtomicString Vector through.

* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumePseudo):
Add a new consumeLangArgumentList to collect the languages into
an AtomicString Vector.

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

3 years agoWeb Inspector: Improve Quick Open sorting algorithm
commit-queue@webkit.org [Mon, 24 Oct 2016 21:48:13 +0000 (21:48 +0000)]
Web Inspector: Improve Quick Open sorting algorithm
https://bugs.webkit.org/show_bug.cgi?id=163705

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-24
Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Models/ResourceQueryResult.js:
(WebInspector.ResourceQueryResult.prototype._calculateRank.getMultiplier):
(WebInspector.ResourceQueryResult.prototype._calculateRank):
Added logic to multiply the ranking increment/decrement based on whether the current match
is part of a sequence, whether that sequence began with a special character, and the length
of the current sequence.

LayoutTests:

* inspector/unit-tests/resource-query-controller-expected.txt:
* inspector/unit-tests/resource-query-controller.html:
Changed the ExecuteQueryGeneralRankings and ExecuteQueryPositionRankings tests to reflect
the new ranking logic.  Added ExecuteQueryConsecutiveRankings to test more realistic
scenarios and ensure better ranking.

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

3 years agoWasm should support floating point operations.
keith_miller@apple.com [Mon, 24 Oct 2016 21:44:34 +0000 (21:44 +0000)]
Wasm should support floating point operations.
https://bugs.webkit.org/show_bug.cgi?id=163770

Reviewed by Michael Saboff.

JSTests:

Add appropriate b3op names for floating point wasm bytecodes, where they exist.
Also, fix some WASM => Wasm in WasmOps.h generator script that I missed
the first time I made the change.

* wasm/generate-wasmops-header.js:
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.template.typename.Int.inline.bool.isValidOpType): Deleted.
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.BinaryOpType): Deleted.
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.UnaryOpType): Deleted.
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.LoadOpType): Deleted.
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.StoreOpType): Deleted.
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.undef.CREATE_ENUM_VALUE.inline.bool.isControlOp): Deleted.
* wasm/wasm.json:

Source/JavaScriptCore:

Since we now have a Double => Float Trunc in B3, we can now support calls in Wasm
that take floating point arguments. This patch also enables most of the Wasm
floating point operations, as the associated B3 opcode has been linked via wasm.json.
If there is no direct mapping to a B3 opcode the Wasm is not yet implemented. This
patch also fixes a bug in calls where the arguments would be reversed.

* testWasm.cpp:
(cast):
(invoke):
(boxf):
(boxd):
(runWasmTests):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::createJSWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::loadArguments):
(JSC::Wasm::CallingConvention::setupCall):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* wasm/WasmOps.h:

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

3 years agoFix AppleWin build after r207720.
achristensen@apple.com [Mon, 24 Oct 2016 21:34:09 +0000 (21:34 +0000)]
Fix AppleWin build after r207720.

* html/canvas/OESVertexArrayObject.cpp:

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

3 years agoFix AppleWin build after r207720.
achristensen@apple.com [Mon, 24 Oct 2016 21:17:14 +0000 (21:17 +0000)]
Fix AppleWin build after r207720.

* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:

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

3 years agoRebaseline tests for ios-simulator after r207757.
ryanhaddad@apple.com [Mon, 24 Oct 2016 21:16:17 +0000 (21:16 +0000)]
Rebaseline tests for ios-simulator after r207757.
https://bugs.webkit.org/show_bug.cgi?id=163904

Unreviewed test gardening.

* platform/ios-simulator/svg/W3C-SVG-1.1/text-align-06-b-expected.txt:
* platform/ios-simulator/svg/batik/text/verticalText-expected.txt:
* platform/ios-simulator/svg/batik/text/verticalTextOnPath-expected.txt:
* platform/ios-simulator/svg/text/text-align-06-b-expected.txt:
* platform/ios-simulator/svg/text/text-vkern-expected.txt:

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

3 years agoRebase tests after r207767
achristensen@apple.com [Mon, 24 Oct 2016 21:01:53 +0000 (21:01 +0000)]
Rebase tests after r207767
https://bugs.webkit.org/show_bug.cgi?id=163891

* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
No more CSSCharsetRule.

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

3 years agoFix Windows build after r207767 and r207769
achristensen@apple.com [Mon, 24 Oct 2016 20:53:28 +0000 (20:53 +0000)]
Fix Windows build after r207767 and r207769

* css/CSSAllInOne.cpp:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::getProtectionSpace):

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

3 years ago[Win] AVCF based media engine does not block cross-site/cross-domain loads.
pvollan@apple.com [Mon, 24 Oct 2016 20:47:04 +0000 (20:47 +0000)]
[Win] AVCF based media engine does not block cross-site/cross-domain loads.
https://bugs.webkit.org/show_bug.cgi?id=163783

Reviewed by Brent Fulgham.

Prevent cross-site/cross-domain loads by setting appropriate AVCF options.

No new tests; covered by media/video-canvas-source.html. Media tests are
currently skipped on Windows.

* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
(WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
(WebCore::AVFWrapper::createAssetForURL):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:

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

3 years agoFix build with newer versions of clang
andersca@apple.com [Mon, 24 Oct 2016 20:42:48 +0000 (20:42 +0000)]
Fix build with newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=163908
rdar://problem/28852016

Reviewed by Tim Horton.

Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.

* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):

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

3 years agoRemove unnecessary unused variable stubs
commit-queue@webkit.org [Mon, 24 Oct 2016 20:25:02 +0000 (20:25 +0000)]
Remove unnecessary unused variable stubs
https://bugs.webkit.org/show_bug.cgi?id=163688

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-24
Reviewed by Simon Fraser.

* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::toDictionary):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::toDictionary):

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