WebKit-https.git
19 months agoUnreviewed, rolling out r231223 and r231288.
commit-queue@webkit.org [Thu, 3 May 2018 16:37:01 +0000 (16:37 +0000)]
Unreviewed, rolling out r231223 and r231288.
https://bugs.webkit.org/show_bug.cgi?id=185256

The change in r231223 breaks internal builds, and r231288 is a
dependent change. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Use default std::optional if it is provided"
https://bugs.webkit.org/show_bug.cgi?id=185159
https://trac.webkit.org/changeset/231223

"Use pointer instead of
std::optional<std::reference_wrapper<>>"
https://bugs.webkit.org/show_bug.cgi?id=185186
https://trac.webkit.org/changeset/231288

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

19 months agoAn error message is written to stderr when the WebContent process is blocking WindowS...
pvollan@apple.com [Thu, 3 May 2018 16:31:53 +0000 (16:31 +0000)]
An error message is written to stderr when the WebContent process is blocking WindowServer access.
https://bugs.webkit.org/show_bug.cgi?id=184701

Reviewed by Brent Fulgham.

Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
access to the WindowServer in the WebContent process, will remove this error message. After this change,
the url of the WebContent process is still showing up in Activity Monitor, which previously was a
problem when calling 'setApplicationIsDaemon(true)'.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

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

19 months agoUnreviewed, rolling out r231253.
ryanhaddad@apple.com [Thu, 3 May 2018 16:01:26 +0000 (16:01 +0000)]
Unreviewed, rolling out r231253.

The API test added with this change is crashing on the bots.

Reverted changeset:

"Web Inspector: opt out of process swap on navigation if a Web
Inspector frontend is connected"
https://bugs.webkit.org/show_bug.cgi?id=184861
https://trac.webkit.org/changeset/231253

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

19 months agoUnreviewed GTK+ gardening after r231300.
magomez@igalia.com [Thu, 3 May 2018 15:43:20 +0000 (15:43 +0000)]
Unreviewed GTK+ gardening after r231300.

* platform/gtk/TestExpectations:
* platform/gtk/compositing/layer-creation/overlap-animation-expected.txt: Removed.
* platform/gtk/editing/selection/select-all-004-expected.png:
* platform/gtk/editing/selection/select-all-004-expected.txt: Added.

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

19 months agoA MediaStream being played should allow removing some of its tracks
youenn@apple.com [Thu, 3 May 2018 15:08:48 +0000 (15:08 +0000)]
A MediaStream being played should allow removing some of its tracks
https://bugs.webkit.org/show_bug.cgi?id=185233

Reviewed by Eric Carlson.

Source/WebCore:

Update the tracks out of the for loop.
Test: fast/mediastream/change-tracks-media-stream-being-played.html

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfType):

LayoutTests:

* fast/mediastream/change-tracks-media-stream-being-played-expected.txt: Added.
* fast/mediastream/change-tracks-media-stream-being-played.html: Added.

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

19 months agoRe-eneable Network Extension support in the WebContent process
bfulgham@apple.com [Thu, 3 May 2018 13:46:06 +0000 (13:46 +0000)]
Re-eneable Network Extension support in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=185236
<rdar://problem/39883004>

Reviewed by Eric Carlson.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoDisable usage of fused multiply-add instructions for JSC with compiler flag
commit-queue@webkit.org [Thu, 3 May 2018 11:58:50 +0000 (11:58 +0000)]
Disable usage of fused multiply-add instructions for JSC with compiler flag
https://bugs.webkit.org/show_bug.cgi?id=184909

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-03
Reviewed by Yusuke Suzuki.

Adds -ffp-contract as compiler flag for building JSC. This ensures that functions
like parseInt() do not return slightly different results depending on whether the
compiler was able to use fused multiply-add instructions or not.

* CMakeLists.txt:

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

19 months agoWebCore::TextureMapperLayer object used after freed
magomez@igalia.com [Thu, 3 May 2018 10:17:02 +0000 (10:17 +0000)]
WebCore::TextureMapperLayer object used after freed
https://bugs.webkit.org/show_bug.cgi?id=184729

Reviewed by Michael Catanzaro.

Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
inside TextureMapperLayer.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
(WebCore::TextureMapperLayer::setMaskLayer):
(WebCore::TextureMapperLayer::setReplicaLayer):
* platform/graphics/texmap/TextureMapperLayer.h:

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

19 months agoREGRESSION (r231014): Entitlements are not applied to XPC services on macOS
timothy_horton@apple.com [Thu, 3 May 2018 08:50:09 +0000 (08:50 +0000)]
REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
https://bugs.webkit.org/show_bug.cgi?id=185241

Reviewed by Dan Bernstein.

* Configurations/BaseXPCService.xcconfig:
* Configurations/WebContentService.Development.xcconfig:
* Configurations/WebContentService.xcconfig:

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

19 months agoREGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit...
carlosgc@webkit.org [Thu, 3 May 2018 08:45:32 +0000 (08:45 +0000)]
REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
https://bugs.webkit.org/show_bug.cgi?id=183348

Reviewed by Michael Catanzaro.

Source/WebKit:

When connection doesn't exit in case of sync message failure, always exit in case of failing to send
GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
and destroyed quickly.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::ensureWebToStorageProcessConnection):

Tools:

Add a test case to reproduce the crash.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewCloseQuickly):
(beforeAll):

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

19 months ago[Curl] Add OpenSSL/LibreSSL multi-threading support
commit-queue@webkit.org [Thu, 3 May 2018 07:23:08 +0000 (07:23 +0000)]
[Curl] Add OpenSSL/LibreSSL multi-threading support
https://bugs.webkit.org/show_bug.cgi?id=185138

The older OpenSSL manual says the locking_function and threadid_function should
be set when use it in multi-threading environment. This applies to LibreSSL also.
https://www.openssl.org/docs/man1.0.2/crypto/threads.html

For unix and other similar os, the default threadId_function implementation is
good enough. We'll set custom callback only for Windows OS.

Note it's not required for OpenSSL 1.1.0 and after.
https://www.openssl.org/blog/blog/2017/02/21/threads/

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-05-03
Reviewed by Per Arne Vollan.

* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
(WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
(WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::ThreadSupport::setup):
(WebCore::CurlSSLHandle::ThreadSupport::singleton):
(WebCore::CurlSSLHandle::ThreadSupport::lock):
(WebCore::CurlSSLHandle::ThreadSupport::unlock):

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

19 months agoCreate analysis task should sync analysis task status after creation.
dewei_zhu@apple.com [Thu, 3 May 2018 07:06:16 +0000 (07:06 +0000)]
Create analysis task should sync analysis task status after creation.
https://bugs.webkit.org/show_bug.cgi?id=185222

Reviewed by Ryosuke Niwa.

* public/v3/models/analysis-task.js:
(AnalysisTask.async.create): Fetch newly-created analysis task right about its creation.
(AnalysisTask):
* tools/js/measurement-set-analyzer.js:
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet): Adjust as 'AnalysisTask.create' now
returns an anlysis task instance.
(MeasurementSetAnalyzer):
* unit-tests/analysis-task-tests.js: Added a unit test for this change.
(async):
* unit-tests/measurement-set-analyzer-tests.js: Update unit tests accordingly.
Fix a typo in one previous unit test.
(async):

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

19 months agoAX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
n_wang@apple.com [Thu, 3 May 2018 06:05:57 +0000 (06:05 +0000)]
AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
https://bugs.webkit.org/show_bug.cgi?id=185237

Reviewed by Dan Bernstein.

When libAccessibility.dylib is missing, the compiler would optimize out the global
notification and lead to a crash. Fixed it by using the isNullFunction check instead,
since we are sure the global notification would be there when the corresponding function
is available.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

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

19 months agoRemove superfluous check for a null attribute value check in Element::removeAttribute...
rniwa@webkit.org [Thu, 3 May 2018 03:40:29 +0000 (03:40 +0000)]
Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
https://bugs.webkit.org/show_bug.cgi?id=185227

Reviewed by Chris Dumez.

Removed the check. The attribute value string can never be null.

* dom/Element.cpp:
(WebCore::Element::removeAttributeInternal):

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

19 months ago[LFC] Implement LayoutContext::createDisplayBox
zalan@apple.com [Thu, 3 May 2018 03:19:33 +0000 (03:19 +0000)]
[LFC] Implement LayoutContext::createDisplayBox
https://bugs.webkit.org/show_bug.cgi?id=185158

Reviewed by Antti Koivisto.

Now compute*() functions take both the const layout and the corresponding non-const display boxes.
Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
(This might need to change in the future if we decide to arrange them in some sort of painting order)

* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::computePosition):
* layout/FloatingContext.h:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeStaticPosition const):
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createDisplayBox):
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::parent const): Deleted.
(WebCore::Display::Box::nextSibling const): Deleted.
(WebCore::Display::Box::previousSibling const): Deleted.
(WebCore::Display::Box::firstChild const): Deleted.
(WebCore::Display::Box::lastChild const): Deleted.
(WebCore::Display::Box::setParent): Deleted.
(WebCore::Display::Box::setNextSibling): Deleted.
(WebCore::Display::Box::setPreviousSibling): Deleted.
(WebCore::Display::Box::setFirstChild): Deleted.
(WebCore::Display::Box::setLastChild): Deleted.
(): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
* layout/inlineformatting/InlineFormattingContext.h:

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

19 months agoHiding then showing an <object> of type image makes the underlaying image disappear
commit-queue@webkit.org [Thu, 3 May 2018 01:17:55 +0000 (01:17 +0000)]
Hiding then showing an <object> of type image makes the underlaying image disappear
https://bugs.webkit.org/show_bug.cgi?id=185216
<rdar://problem/39055630>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-05-02
Reviewed by Youenn Fablet.

Source/WebCore:

Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
RenderImage with the CachedImage of its ImageLoader when the RenderImage
is recreated.

Test: fast/images/object-image-hide-show.html

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAttachRenderers):
This is very similar to what we do in HTMLImageElement::didAttachRenderers().

LayoutTests:

* fast/images/object-image-hide-show-expected.html: Added.
* fast/images/object-image-hide-show.html: Added.

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

19 months agoUse RetainPtr for form input type
bfulgham@apple.com [Thu, 3 May 2018 01:08:55 +0000 (01:08 +0000)]
Use RetainPtr for form input type
https://bugs.webkit.org/show_bug.cgi?id=185210
<rdar://problem/39734040>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Refactor our HTMLInputElement class to store its InputType member as a RefPtr.

Test: fast/forms/access-key-mutation-2.html.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
(WebCore::HTMLInputElement::accessKeyAction):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::appendFormData):
* html/HTMLInputElement.h:
* html/InputType.cpp:
(WebCore::createInputType):
(WebCore::InputType::create):
(WebCore::InputType::createText):
* html/InputType.h:

LayoutTests:

* fast/forms/access-key-mutation-2-expected.txt: Added.
* fast/forms/access-key-mutation-2.html: Added.

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

19 months agoUnreviewed, fix build failure in ARM, ARMv7 and MIPS
utatane.tea@gmail.com [Thu, 3 May 2018 01:03:26 +0000 (01:03 +0000)]
Unreviewed, fix build failure in ARM, ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=185192

compareDouble relies on MacroAssembler::invert function.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::compareDouble):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::compareDouble): Deleted.
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::compareDouble): Deleted.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::compareDouble): Deleted.

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

19 months ago[JSC] Add MacroAssembler::and16 and store16
utatane.tea@gmail.com [Thu, 3 May 2018 00:53:41 +0000 (00:53 +0000)]
[JSC] Add MacroAssembler::and16 and store16
https://bugs.webkit.org/show_bug.cgi?id=185188

Reviewed by Mark Lam.

r231129 requires and16(ImplicitAddress, RegisterID) and store16(RegisterID, ImplicitAddress) implementations.
This patch adds these methods for ARM.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::and16):
(JSC::MacroAssemblerARM::store16):

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

19 months agoUse pointer instead of std::optional<std::reference_wrapper<>>
utatane.tea@gmail.com [Thu, 3 May 2018 00:50:19 +0000 (00:50 +0000)]
Use pointer instead of std::optional<std::reference_wrapper<>>
https://bugs.webkit.org/show_bug.cgi?id=185186

Reviewed by Alex Christensen.

std::optional<T&> is not accepted in C++17 spec. So we replaced it
with std::optional<std::reference_wrapper<T>>.

In this patch, we replace it with T*, which is well-aligned to
WebKit's convention.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::item const):
(WebCore::DatasetDOMStringMap::namedItem const):
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):
* dom/Element.h:
* html/canvas/CanvasStyle.cpp:
(WebCore::parseColor):
* inspector/DOMEditor.cpp:
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::getPostData):
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPOST):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDMInstance::updateLicense):
* testing/MockCDMFactory.h:

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

19 months agoSkip transitions/opacity-transition-zindex.html.
ryanhaddad@apple.com [Thu, 3 May 2018 00:49:20 +0000 (00:49 +0000)]
Skip transitions/opacity-transition-zindex.html.
https://bugs.webkit.org/show_bug.cgi?id=184947

Unreviewed test gardening.

* TestExpectations: Remove old expectation that is no longer applicable.
* platform/mac-wk2/TestExpectations:

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

19 months ago[DFG] Unify compare related code in 32bit and 64bit
utatane.tea@gmail.com [Thu, 3 May 2018 00:48:22 +0000 (00:48 +0000)]
[DFG] Unify compare related code in 32bit and 64bit
https://bugs.webkit.org/show_bug.cgi?id=185189

Reviewed by Mark Lam.

This patch unifies some part of compare related code in 32bit and 64bit
to reduce the size of 32bit specific DFG code.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileInt32Compare):
(JSC::DFG::SpeculativeJIT::compileDoubleCompare):
(JSC::DFG::SpeculativeJIT::compileObjectEquality):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileInt32Compare): Deleted.
(JSC::DFG::SpeculativeJIT::compileDoubleCompare): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileInt32Compare): Deleted.
(JSC::DFG::SpeculativeJIT::compileDoubleCompare): Deleted.

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

19 months ago[JSC] Add compareDouble and compareFloat for ARM64, X86, and X86_64
utatane.tea@gmail.com [Thu, 3 May 2018 00:46:09 +0000 (00:46 +0000)]
[JSC] Add compareDouble and compareFloat for ARM64, X86, and X86_64
https://bugs.webkit.org/show_bug.cgi?id=185192

Reviewed by Mark Lam.

Now Object.is starts using compareDouble. So we would like to have
efficient implementation for compareDouble and compareFloat for
major architectures, ARM64, X86, and X86_64.

This patch adds compareDouble and compareFloat implementations for
these architectures. And generic implementation is moved to each
architecture's MacroAssembler implementation.

We also add tests for them in testmasm. To implement this test
easily, we also add loadFloat(TrustedImmPtr, FPRegisterID) for the
major architectures.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::compareDouble): Deleted.
(JSC::MacroAssembler::compareFloat): Deleted.
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::compareDouble):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::compareDouble):
(JSC::MacroAssemblerARM64::compareFloat):
(JSC::MacroAssemblerARM64::loadFloat):
(JSC::MacroAssemblerARM64::floatingPointCompare):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::compareDouble):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::compareDouble):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::loadFloat):
(JSC::MacroAssemblerX86Common::compareDouble):
(JSC::MacroAssemblerX86Common::compareFloat):
(JSC::MacroAssemblerX86Common::floatingPointCompare):
* assembler/X86Assembler.h:
(JSC::X86Assembler::movss_mr):
(JSC::X86Assembler::movss_rm):
* assembler/testmasm.cpp:
(JSC::floatOperands):
(JSC::testCompareFloat):
(JSC::run):

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

19 months agoUnreviewed, fix 32bit DFG code
utatane.tea@gmail.com [Thu, 3 May 2018 00:42:12 +0000 (00:42 +0000)]
Unreviewed, fix 32bit DFG code
https://bugs.webkit.org/show_bug.cgi?id=185065

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSameValue):

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

19 months agoJSC should know how to cache custom getter accesses on the prototype chain
fpizlo@apple.com [Thu, 3 May 2018 00:37:30 +0000 (00:37 +0000)]
JSC should know how to cache custom getter accesses on the prototype chain
https://bugs.webkit.org/show_bug.cgi?id=185213

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/get-custom-getter.js: Added.
(test):

Source/JavaScriptCore:

This was a simple fix after the work I did for bug 185174. >4x speed-up on the new get-custom-getter.js test.

* jit/Repatch.cpp:
(JSC::tryCacheGetByID):

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

19 months agoAdd facility for tracking times and results of page and resource loading
krollin@apple.com [Thu, 3 May 2018 00:31:50 +0000 (00:31 +0000)]
Add facility for tracking times and results of page and resource loading
https://bugs.webkit.org/show_bug.cgi?id=184838
<rdar://problem/36548974>

Reviewed by Brent Fulgham.

Source/WebCore:

Update FrameProgressTracker to send the necessary page load start/stop
signals so that we can track the entire page load at a network level.
Add an empty override of the pure virtual
LoaderStrategy::pageLoadCompleted method.

No new tests. There is no testable effect from these changes. On
Cocoa, measurable changes take place in another (non-WebKit) process.
On non-Cocoa systems, this facility is currently disabled.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
* loader/LoaderStrategy.h:

Source/WebKit:

Add NetworkActivityTracker. The idea behind this facility is to create
and destroy them around networking activity that we want to track for
the purpose of measuring overall network health. They can be created
around the loading of pages or individual resources, and can be
arranged in a parent/child hierarchy to indicate what pages the
resources are part of. The NetworkActivity tracker tracks load times
and results. On Cocoa, it can be integrated with CFNetwork in order to
associate WebKit activity with low-level networking activity.

* CMakeLists.txt:
* Configurations/WebKit.xcconfig:
* NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
(WebKit::NetworkActivityTracker::NetworkActivityTracker):
(WebKit::NetworkActivityTracker::~NetworkActivityTracker):
(WebKit::NetworkActivityTracker::setParent):
(WebKit::NetworkActivityTracker::start):
(WebKit::NetworkActivityTracker::complete):
* NetworkProcess/NetworkActivityTracker.h: Added.
(WebKit::NetworkActivityTracker::getPlatformObject):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
(WebKit::networkActivityTrackingEnabled):
(WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
(WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
(WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::trackNetworkActivity const):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::cleanup):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
(WebKit::NetworkActivityTracker::NetworkActivityTracker):
(WebKit::NetworkActivityTracker::~NetworkActivityTracker):
(WebKit::NetworkActivityTracker::setParent):
(WebKit::NetworkActivityTracker::start):
(WebKit::NetworkActivityTracker::complete):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationTrackNetworkActivity):
(WKContextConfigurationSetTrackNetworkActivity):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration trackNetworkActivity]):
(-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::pageLoadCompleted):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

Add an empty override of the pure virtual
LoaderStrategy::pageLoadCompleted method.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::pageLoadCompleted):
* WebCoreSupport/WebResourceLoadScheduler.h:

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

19 months agoUnreviewed, rolling out r231251.
commit-queue@webkit.org [Thu, 3 May 2018 00:28:27 +0000 (00:28 +0000)]
Unreviewed, rolling out r231251.
https://bugs.webkit.org/show_bug.cgi?id=185229

__cpp_lib_optional should be used after including <optional>
since it is defined in <optional> (Requested by yusukesuzuki
on #webkit).

Reverted changeset:

"Follow-up build fix for r231223"
https://bugs.webkit.org/show_bug.cgi?id=185159
https://trac.webkit.org/changeset/231251

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

19 months agoVersioning.
jmarcell@apple.com [Wed, 2 May 2018 23:10:37 +0000 (23:10 +0000)]
Versioning.

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

19 months ago[iOS] Provide audio route information when invoking AirPlay picker
eric.carlson@apple.com [Wed, 2 May 2018 23:08:20 +0000 (23:08 +0000)]
[iOS] Provide audio route information when invoking AirPlay picker
https://bugs.webkit.org/show_bug.cgi?id=185199
<rdar://problem/39853103>

Unreviewed, another attempted build fix.

* pal/spi/mac/AVFoundationSPI.h:

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

19 months agoOpen audio/video sandbox services for minimal simulator
jer.noble@apple.com [Wed, 2 May 2018 23:00:19 +0000 (23:00 +0000)]
Open audio/video sandbox services for minimal simulator
https://bugs.webkit.org/show_bug.cgi?id=185217
<rdar://problem/39918909>

Reviewed by Per Arne Vollan.

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoCan't copy and paste URLs that have no title into Mail (macOS)
commit-queue@webkit.org [Wed, 2 May 2018 22:55:44 +0000 (22:55 +0000)]
Can't copy and paste URLs that have no title into Mail (macOS)
https://bugs.webkit.org/show_bug.cgi?id=185205
<rdar://problem/36352406>

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-05-02
Reviewed by Tim Horton.

Source/WebCore:

The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.

To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.

Augmented WebKitLegacy.ContextMenuCanCopyURL test

* platform/mac/PasteboardMac.mm:
(WebCore::writeURLForTypes):

Tools:

Added test to verify behavior when copying and pasting a URL without a title.

* TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.html:
* TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
(TestWebKitAPI::TEST):

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

19 months agoRebase imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request...
youenn@apple.com [Wed, 2 May 2018 22:50:01 +0000 (22:50 +0000)]
Rebase imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html expectation
https://bugs.webkit.org/show_bug.cgi?id=185221

Unreviewed.

* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:

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

19 months agoCleanup NetworkResourceLoader::didReceiveResponse()
dbates@webkit.org [Wed, 2 May 2018 22:22:21 +0000 (22:22 +0000)]
Cleanup NetworkResourceLoader::didReceiveResponse()
https://bugs.webkit.org/show_bug.cgi?id=185209

Reviewed by Chris Dumez.

Use early returns to make the control flow easier to read and reason about. Disregarding a
From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
when the load is for a main resource and hence it must wait for the embedding client to allow
the load before continuing with it. With regards to a From-Origin violation, the network
process schedules to fail the load in a subsequent turn of the event loop before returning
NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
fail it on the next turn of the event loop).

Additionally, remove all logging about the return value as we no longer have a need for
such logging.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):

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

19 months ago[WinCairo] Unreviewed gardening. Add missing Skip for http/wpt.
ross.kirsling@sony.com [Wed, 2 May 2018 22:11:22 +0000 (22:11 +0000)]
[WinCairo] Unreviewed gardening. Add missing Skip for http/wpt.

* platform/wincairo/TestExpectations:

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

19 months agoREGRESSION(r225868): Release assert when removing an SVGUseElement from Document...
rniwa@webkit.org [Wed, 2 May 2018 21:42:54 +0000 (21:42 +0000)]
REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
https://bugs.webkit.org/show_bug.cgi?id=182188
<rdar://problem/36689240>

Reviewed by Antti Koivisto.

Fixed the crash by removing up the release assert.

The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.

There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.

This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
and there is no evidence that r225868 has led to new UAFs even after five months.

No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.

* dom/Document.cpp:
(WebCore::Document::removeSVGUseElement):

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

19 months agogetCharNumAtPosition should take DOMPointInit as argument
commit-queue@webkit.org [Wed, 2 May 2018 21:38:53 +0000 (21:38 +0000)]
getCharNumAtPosition should take DOMPointInit as argument
https://bugs.webkit.org/show_bug.cgi?id=184695

Patch by Dirk Schulze <dschulze@chromium.org> on 2018-05-02
Reviewed by Antti Koivisto.

Source/WebCore:

Extend existing tests for getCharNumAtPosition.

* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::getCharNumAtPosition):
* svg/SVGTextContentElement.h:
* svg/SVGTextContentElement.idl: Use DOMPointInit argument.

LayoutTests:

* svg/text/lengthAdjust-text-metrics.html: Run tests with dictionary.

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

19 months agoDisable VCP for iOS until it is fully working
youenn@apple.com [Wed, 2 May 2018 21:38:04 +0000 (21:38 +0000)]
Disable VCP for iOS until it is fully working
https://bugs.webkit.org/show_bug.cgi?id=185201
<rdar://problem/39773857>

Reviewed by Eric Carlson.

Disable VCP for iOS unconditionally.
Add check to getkVTVideoEncoderSpecification_Usage to not set this property if not defined as it is optional soft linked.
Replace use of VTSessionSetProperty by CompressionSessionSetProperty as the latter is a macro
that works for both VT and VCP.

* Source/webrtc/sdk/WebKit/EncoderUtilities.h:
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(-[RTCVideoEncoderH264 configureCompressionSession]):
(-[RTCVideoEncoderH264 setEncoderBitrateBps:]):
(-[RTCVideoEncoderH264 frameWasEncoded:flags:sampleBuffer:codecSpecificInfo:width:height:renderTimeMs:timestamp:rotation:]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h:

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

19 months agoAdd WKWebsiteDataStorePrivate._proxyConfiguration SPI
commit-queue@webkit.org [Wed, 2 May 2018 21:17:58 +0000 (21:17 +0000)]
Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
https://bugs.webkit.org/show_bug.cgi?id=185179

Patch by Alex Christensen <achristensen@webkit.org> on 2018-05-02
Reviewed by Andy Estes.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setProxyConfiguration:]):
(-[WKWebsiteDataStore _proxyConfiguration]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setProxyConfiguration):
(WebKit::WebsiteDataStore::proxyConfiguration):

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

19 months agoUse NetworkLoadChecker for navigation loads
youenn@apple.com [Wed, 2 May 2018 21:13:28 +0000 (21:13 +0000)]
Use NetworkLoadChecker for navigation loads
https://bugs.webkit.org/show_bug.cgi?id=184892
<rdar://problem/39652686>

Reviewed by Chris Dumez.

Source/WebCore:

Sanitize headers according response tainting.
If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
If tainting is Opaque, we filter all uncommon headers.
If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
Covered by updated test.

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:

Source/WebKit:

Compute whether a response is same origin in no-cors case.
This allows providing more precise filtering.
In case of navigate loads, set the tainting to basic which will make filtering to the minimum.

Pass the sourceOrigin for navigation loads as well.
Enable to restrict HTTP response access for navigation load.

Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
They should be reenabled as a follow-up.

Add a specific case to allow any redirection to about:// URLs.
While this does not conform with the spec, this keeps the existing WebKit behavior.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::continueCheckingRequest):
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
We only do security checks if this runtime flag is on.
* WebProcess/Network/WebLoaderStrategy.h:

LayoutTests:

Updated header-filtering.https.html to expect full headers except cookie-related for same origin loads.
Updated expected.txt files accordingly.

* http/wpt/service-workers/header-filtering.https-expected.txt:
* http/wpt/service-workers/header-filtering.https.html:
* platform/mac/http/tests/webarchive/test-preload-resources-expected.txt:

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

19 months agoCollection fragment identifiers don't use PostScript names
mmaxfield@apple.com [Wed, 2 May 2018 20:34:07 +0000 (20:34 +0000)]
Collection fragment identifiers don't use PostScript names
https://bugs.webkit.org/show_bug.cgi?id=184624
Source/WebCore:

<rdar://problem/39432089>

Reviewed by Simon Fraser.

In a previous version of the CSS Fonts spec, there was text saying that items in font collections
should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
inserting an item into the middle of a collection would throw off all content that uses the file.
Instead, the spec has since changed to use PostScript names (so the content instead would say
MyFonts.ttc#MyFont-Regular).

Test: fast/text/font-collection.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateItemInCollection const):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createCustomFontData):
(WebCore::CachedFont::calculateIndex const): Deleted.
* loader/cache/CachedFont.h:
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:

LayoutTests:

Reviewed by Simon Fraser.

* fast/text/font-collection-expected.html:
* fast/text/font-collection.html:
* fast/text/resources/collection.ttc: I generated this font collection by hand. The "Ahemerator" font inside it is missing the
"A" glyph.

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

19 months ago[iOS] Provide audio route information when invoking AirPlay picker
eric.carlson@apple.com [Wed, 2 May 2018 20:26:31 +0000 (20:26 +0000)]
[iOS] Provide audio route information when invoking AirPlay picker
https://bugs.webkit.org/show_bug.cgi?id=185199
<rdar://problem/39853103>

Unreviewed build fix.

* pal/spi/mac/AVFoundationSPI.h:

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

19 months agoMake EncryptedMediaAPIEnabled an experimental feature
jer.noble@apple.com [Wed, 2 May 2018 20:22:16 +0000 (20:22 +0000)]
Make EncryptedMediaAPIEnabled an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=185212

Reviewed by Eric Carlson.

* Shared/WebPreferences.yaml:

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

19 months ago[GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkit...
clopez@igalia.com [Wed, 2 May 2018 20:07:58 +0000 (20:07 +0000)]
[GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkitgtk.org (follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=184699

Unreviewed follow-up fix after r231230.

* Scripts/generate-jsc-bundle:
(generate_wrapper_script): Quote the arguments passed to jsc.

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

19 months agoLayout Test http/wpt/service-workers/header-filtering.https.html is a flaky failure
youenn@apple.com [Wed, 2 May 2018 19:53:38 +0000 (19:53 +0000)]
Layout Test http/wpt/service-workers/header-filtering.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=184469
<rdar://problem/39428226>

Reviewed by Chris Dumez.

Ensure that the message posted for the loading of the initial iframe is actually received before doing further tests.

* http/wpt/service-workers/header-filtering.https.html:
* platform/mac-wk2/TestExpectations:

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

19 months agoAdjust sandbox profile in simulator mode.
pvollan@apple.com [Wed, 2 May 2018 19:29:30 +0000 (19:29 +0000)]
Adjust sandbox profile in simulator mode.
https://bugs.webkit.org/show_bug.cgi?id=185172
<rdar://problem/39876860>

Reviewed by Brent Fulgham.

Fix some sandbox violations.

* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoWeb Inspector: opt out of process swap on navigation if a Web Inspector frontend...
bburg@apple.com [Wed, 2 May 2018 19:17:49 +0000 (19:17 +0000)]
Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
https://bugs.webkit.org/show_bug.cgi?id=184861
<rdar://problem/39153768>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Notify the client of the current connection count whenever a frontend connects or disconnects.

Covered by new API test.

* inspector/InspectorClient.h:
(WebCore::InspectorClient::frontendCountChanged):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
* inspector/InspectorController.h:

Source/WebKit:

We need to track how many frontends are attached to the web page (both local and remote).
InspectorController propagates this out to WebKit via InspectorClient. This is then
kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
new process for a navigation, return early with "no" if any frontends are open for the
page being navigated.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didChangeInspectorFrontendCount):
(WebKit::WebPageProxy::inspectorFrontendCount const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::frontendCountChanged):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::inspectorFrontendCountChanged):
* WebProcess/WebPage/WebPage.h:

Tools:

Add a new test that checks whether a new process is used for navigation when
an Inspector is shown. Also check that the behavior reverts to normal after
the Inspector has been closed.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

19 months agotest262/Runner.pm: save summary to file
commit-queue@webkit.org [Wed, 2 May 2018 19:08:33 +0000 (19:08 +0000)]
test262/Runner.pm: save summary to file
https://bugs.webkit.org/show_bug.cgi?id=185200

Patch by Valerie R Young <valerie@bocoup.com> on 2018-05-02
Reviewed by Michael Saboff.

.:

* .gitignore:

Tools:

* Scripts/test262/Runner.pm:
(processCLI):
(main):
(summarizeResults):

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

19 months agoFollow-up build fix for r231223
jbedard@apple.com [Wed, 2 May 2018 18:54:27 +0000 (18:54 +0000)]
Follow-up build fix for r231223
https://bugs.webkit.org/show_bug.cgi?id=185159
<rdar://problem/39891074>

Unreviewed build fix.

We should be consistent about when we include <optional> vs define our own.

* wtf/Optional.h:

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

19 months agoJSC should be able to cache custom setter calls on the prototype chain
fpizlo@apple.com [Wed, 2 May 2018 18:51:16 +0000 (18:51 +0000)]
JSC should be able to cache custom setter calls on the prototype chain
https://bugs.webkit.org/show_bug.cgi?id=185174

Reviewed by Saam Barati.

We broke custom-setter-on-the-prototype-chain caching when we fixed a bug involving the conditionSet.isEmpty()
condition being used to determine if we have an alternateBase. The fix in r222671 incorrectly tried to add
impossible-to-validate conditions to the conditionSet by calling generateConditionsForPrototypePropertyHit() instead
of generateConditionsForPrototypePropertyHitCustom(). The problem is that the former function will always fail for
custom accessors because it won't find the custom property in the structure.

The fix is to add a virtual hasAlternateBase() function and use that instead of conditionSet.isEmpty().

This is a 4x speed-up on assign-custom-setter.js.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::hasAlternateBase const):
(JSC::AccessCase::alternateBase const):
(JSC::AccessCase::generateImpl):
* bytecode/AccessCase.h:
(JSC::AccessCase::alternateBase const): Deleted.
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::hasAlternateBase const):
(JSC::GetterSetterAccessCase::alternateBase const):
* bytecode/GetterSetterAccessCase.h:
* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::generateConditionsForPrototypePropertyHitCustom):
* bytecode/ObjectPropertyConditionSet.h:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):

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

19 months ago[GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
clopez@igalia.com [Wed, 2 May 2018 18:44:10 +0000 (18:44 +0000)]
[GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
https://bugs.webkit.org/show_bug.cgi?id=185207

Reviewed by Michael Catanzaro.

Remove unneeded include of gstgldisplay_wayland.h

No new tests, no change in behaviour.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

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

19 months agodocument.open() event listener removal is not immediate
cdumez@apple.com [Wed, 2 May 2018 18:39:20 +0000 (18:39 +0000)]
document.open() event listener removal is not immediate
https://bugs.webkit.org/show_bug.cgi?id=185191

Reviewed by Darin Adler.

Source/WebCore:

We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
whenever they get removed from the EventListenerMap. We were doing so correctly
in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
updates clear() accordingly.

The reason we need to set this flag is that RegisteredEventListeners is RefCounted
and EventTarget::fireEventListeners() may be currently running and calling
each listener one by one, holding a reference to all listener of a given event.

Test: fast/dom/Document/document-open-removes-all-listeners.html

* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):

LayoutTests:

Add layout test coverage.

* fast/dom/Document/document-open-removes-all-listeners-expected.txt: Added.
* fast/dom/Document/document-open-removes-all-listeners.html: Added.

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

19 months agoAdopt -destinationWindowToExitFullScreenForWindow:
jer.noble@apple.com [Wed, 2 May 2018 18:37:27 +0000 (18:37 +0000)]
Adopt -destinationWindowToExitFullScreenForWindow:
https://bugs.webkit.org/show_bug.cgi?id=185204
<rdar://problem/22486621>

Reviewed by Eric Carlson.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):

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

19 months agoDisable Media capture rules in sandbox for simulator.
pvollan@apple.com [Wed, 2 May 2018 18:35:01 +0000 (18:35 +0000)]
Disable Media capture rules in sandbox for simulator.
https://bugs.webkit.org/show_bug.cgi?id=185206
<rdar://problem/39910015>

Reviewed by Eric Carlson.

These rules are not relevant in this case.

* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoUse WeakPtr in GridCell
zalan@apple.com [Wed, 2 May 2018 18:18:10 +0000 (18:18 +0000)]
Use WeakPtr in GridCell
https://bugs.webkit.org/show_bug.cgi?id=185180
<rdar://problem/39432165>

Reviewed by Antti Koivisto.

Since GridCell does not own the renderers, it should
construct weak pointers.

Unable to create a reliably reproducible test case.

* rendering/Grid.cpp:
(WebCore::Grid::insert):
(WebCore::GridIterator::nextGridItem):
* rendering/Grid.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::firstLineBaseline const):

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

19 months ago[iOS] Provide audio route information when invoking AirPlay picker
eric.carlson@apple.com [Wed, 2 May 2018 17:51:45 +0000 (17:51 +0000)]
[iOS] Provide audio route information when invoking AirPlay picker
https://bugs.webkit.org/show_bug.cgi?id=185199
<rdar://problem/39853103>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, this requires a specific hardware setup.

* dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
* dom/Document.h:

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.

* loader/EmptyClients.h:
* page/ChromeClient.h:

* page/Page.cpp:
(WebCore::Page::showPlaybackTargetPicker): Ditto.
* page/Page.h:

* platform/audio/AudioSession.cpp:
(WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
(WebCore::routingContextUID const): Ditto.
* platform/audio/AudioSession.h:

* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
(WebCore::AudioSession::routingContextUID const): Return the route context UID.

Source/WebCore/PAL:

* pal/spi/mac/AVFoundationSPI.h: Add additional AVAudioSession SPI.

Source/WebKit:

* Scripts/webkit/messages.py:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
(-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.

* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
(-[WKAirPlayRoutePicker showFromView:]): Deleted.

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::showPlaybackTargetPicker):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.

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

19 months agoDraw SystemPreview badge to specification on iOS
dino@apple.com [Wed, 2 May 2018 17:36:59 +0000 (17:36 +0000)]
Draw SystemPreview badge to specification on iOS
https://bugs.webkit.org/show_bug.cgi?id=185203
<rdar://problem/39908855>

Reviewed by Tim Horton.

Use CoreImage to render a badge with a blurred background,
at particular sizes.

This will be tested internally while we're getting artwork
from WebKitAdditions.

* Configurations/WebCore.xcconfig: Link against CoreImage.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
in the iOS platform RenderTheme that draws the system preview.

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

19 months ago[MIPS] Implement and16 and store16 for MacroAssemblerMIPS
commit-queue@webkit.org [Wed, 2 May 2018 17:19:12 +0000 (17:19 +0000)]
[MIPS] Implement and16 and store16 for MacroAssemblerMIPS
https://bugs.webkit.org/show_bug.cgi?id=185195

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-02
Reviewed by Mark Lam.

This implements the given function for MIPS, such that it builds again.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::and16):
(JSC::MacroAssemblerMIPS::store16):

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

19 months agoGet the WebKit.framework bundle by asking for WKWebView
jer.noble@apple.com [Wed, 2 May 2018 17:14:10 +0000 (17:14 +0000)]
Get the WebKit.framework bundle by asking for WKWebView
https://bugs.webkit.org/show_bug.cgi?id=185175

Reviewed by Tim Horton.

* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeSandbox):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeSandbox):

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

19 months agoExpose "$262.agent.monotonicNow()" for use in testing Atomic operation timeouts
commit-queue@webkit.org [Wed, 2 May 2018 17:05:50 +0000 (17:05 +0000)]
Expose "$262.agent.monotonicNow()" for use in testing Atomic operation timeouts
https://bugs.webkit.org/show_bug.cgi?id=185043

Patch by Rick Waldron <waldron.rick@gmail.com> on 2018-05-02
Reviewed by Filip Pizlo.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionDollarAgentMonotonicNow):

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

19 months ago[ARM] Implement and16 and store16 for MacroAssemblerARMv7
commit-queue@webkit.org [Wed, 2 May 2018 16:49:57 +0000 (16:49 +0000)]
[ARM] Implement and16 and store16 for MacroAssemblerARMv7
https://bugs.webkit.org/show_bug.cgi?id=185196

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-02
Reviewed by Mark Lam.

This implements and16 and store16 for MacroAssemblerARMv7 such that JSC builds again.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::and16):
(JSC::MacroAssemblerARMv7::store16):

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

19 months agoSource/WebCore:
bfulgham@apple.com [Wed, 2 May 2018 16:49:04 +0000 (16:49 +0000)]
Source/WebCore:
Prevent Debug ASSERT when changing forms
https://bugs.webkit.org/show_bug.cgi?id=185173
<rdar://problem/39738669>

Reviewed by Ryosuke Niwa.

Form submission could trigger a debug assertion during validation when
a form is changed during an input submission. Fix this by cleaning up
the event handling logic and make it more consistent with modern WebKit
coding style.

Test: fast/forms/form-submission-crash-3.html

* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
attempting to perform event handling.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::reportValidity): Ditto.
(WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
since we expect this to happen earlier in the layout pass. Add an assertion that the
tree is not dirty.
* html/ImageInputType.cpp:
(WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
attempting to perform event handling.
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.

LayoutTests:
Prevent assertion when changing forms
https://bugs.webkit.org/show_bug.cgi?id=185173
<rdar://problem/39738669>

Reviewed by Ryosuke Niwa.

* fast/forms/form-submission-crash-3-expected.txt: Added.
* fast/forms/form-submission-crash-3.html: Added.

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

19 months agoCannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
youenn@apple.com [Wed, 2 May 2018 16:42:10 +0000 (16:42 +0000)]
Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
https://bugs.webkit.org/show_bug.cgi?id=181009
<rdar://problem/36144555>

Reviewed by Eric Carlson.

On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
No error is raised which leads to sending STUN requests with that IP address.
Once the request times out, the ICE candidate gathering finishes with host candidates only.

This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
STUN is used for NAT traversal which is for IPv4 addresses.
Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.

Manually tested on iOS with IPv4/IPv6 and IPv6 networks.

* NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
(WebKit::resolvedName):

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

19 months agoCacheStorage::Engine should keep a list of initialization callback
youenn@apple.com [Wed, 2 May 2018 16:41:55 +0000 (16:41 +0000)]
CacheStorage::Engine should keep a list of initialization callback
https://bugs.webkit.org/show_bug.cgi?id=185184
<rdar://problem/38875651>

Reviewed by Antti Koivisto.

Source/WebKit:

Keep each initialize callback in a Vector so as to compute the salt only once.
Call all callbacks then in a loop.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::~Engine):
(WebKit::CacheStorage::Engine::initialize):
* NetworkProcess/cache/CacheStorageEngine.h:

LayoutTests:

* http/wpt/cache-storage/a-cache-open.https-expected.txt: Added.
* http/wpt/cache-storage/a-cache-open.https.html: Added.

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

19 months agoUnreviewed; address review comments made before landing r231231.
jer.noble@apple.com [Wed, 2 May 2018 16:13:38 +0000 (16:13 +0000)]
Unreviewed; address review comments made before landing r231231.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::volume const):

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

19 months agoEnable HAVE_AVKIT for the MINIMAL_SIMULATOR
jer.noble@apple.com [Wed, 2 May 2018 15:51:22 +0000 (15:51 +0000)]
Enable HAVE_AVKIT for the MINIMAL_SIMULATOR
https://bugs.webkit.org/show_bug.cgi?id=185183

Reviewed by Daniel Bates.

* wtf/Platform.h:

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

19 months agoPipe volume through PlaybackSessionManager/Proxy.
jer.noble@apple.com [Wed, 2 May 2018 15:50:33 +0000 (15:50 +0000)]
Pipe volume through PlaybackSessionManager/Proxy.
https://bugs.webkit.org/show_bug.cgi?id=185182

Reviewed by Eric Carlson.

Source/WebCore:

Add support for the volume property to PlaybackSessionModel, and all its clients.

* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::volumeChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::setVolume):
(WebCore::PlaybackSessionModelMediaElement::volume const):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController volume]):
(-[WebAVPlayerController setVolume:]):
(-[WebAVPlayerController volumeChanged:]):
(-[WebAVPlayerController resetMediaState]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::volumeChanged):
(VideoFullscreenControllerContext::volume const):
(VideoFullscreenControllerContext::setVolume):

Source/WebKit:

* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::setVolume):
(WebKit::PlaybackSessionModelContext::volumeChanged):
(WebKit::PlaybackSessionManagerProxy::volumeChanged):
(WebKit::PlaybackSessionManagerProxy::setVolume):
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.messages.in:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::volumeChanged):
(WebKit::PlaybackSessionManager::volumeChanged):
(WebKit::PlaybackSessionManager::setVolume):

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

19 months ago[GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkit...
clopez@igalia.com [Wed, 2 May 2018 12:00:37 +0000 (12:00 +0000)]
[GTK] Generate a JSC bundle on the 64 and 32 bit release bots and upload it to webkitgtk.org
https://bugs.webkit.org/show_bug.cgi?id=184699

Reviewed by Gustavo Noronha Silva.

This adds a new step for the GTK 64-bit release build bot and the
GTK 32-bit release build&test bot.

This step will be run as one of the lasts ones (after the product
is built) and will execute the script generate-jsc-bundle.
This script will take care of creating a JSC bundle and uploading
it to a server defined on a configuration file that has to be
deployed on the bots with the required server data and credentials
for this upload.

In this case, the built products should then be accessible at
<https://webkitgtk.org/jsc-built-products>. But the implementation
is not tied to any specific server. All the details about where
to upload the file is done in configuration file that is kept
private on each bot outside of the WebKit source tree.

The script also supports generating a JSC bundle locally and not
uploading it anywhere. This is the default mode of running.
The remote upload will only be activated if a --remote-config-file
parameter is passed (which is done from the buildbot config)

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/factories.py:
(BuildFactory):
(BuildFactory.__init__):
(TestFactory):
(TestFactory.__init__):
(BuildAndGenerateJSCBundleFactory):
(BuildAndNonLayoutTestAndGenerateJSCBundleFactory):
* BuildSlaveSupport/build.webkit.org-config/steps.py:
(GenerateJSCBundle):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* Scripts/generate-jsc-bundle: Added.
(ldd_get_libs_and_interpreter):
(generate_readme):
(generate_wrapper_script):
(copy_and_remove_rpath):
(createJSCBundle):
(sha256sum):
(uploadJSCBundle):
(main):

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

19 months agoemitCodeToGetArgumentsArrayLength should not crash on PhantomNewArrayWithSpread
rmorisset@apple.com [Wed, 2 May 2018 11:21:28 +0000 (11:21 +0000)]
emitCodeToGetArgumentsArrayLength should not crash on PhantomNewArrayWithSpread
https://bugs.webkit.org/show_bug.cgi?id=183172

Reviewed by Filip Pizlo.

JSTests:

* stress/length-of-new-array-with-spread.js: Added.
(foo):
(bar):
(baz):

Source/JavaScriptCore:

DFGArgumentsEliminationPhase.cpp currently believes that allocations of NewArrayWithSpread can be deleted if they are only used by GetArrayLength,
but when it then calls emitCodeToGetArgumentsArrayLength, the latter has no idea what to do with GetArrayLength.

I fix the problem by teaching emitCodeToGetArgumentsArrayLength how to deal with GetArrayLength.
Because this requires emitting an Add that can overflow and thus exit, we also tell DFGArgumentsEliminationPhase to give up on eliminating
a NewArrayWithSpread when it is used by a GetArrayLength that is not allowed to exit.

* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::emitCodeToGetArgumentsArrayLength):

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

19 months agoUpdate document-create-touch.html expectations for r231114
Ms2ger@igalia.com [Wed, 2 May 2018 11:06:50 +0000 (11:06 +0000)]
Update document-create-touch.html expectations for r231114
https://bugs.webkit.org/show_bug.cgi?id=185193

Unreviewed test gardening.

* fast/events/touch/document-create-touch-expected.txt:
* fast/events/touch/document-create-touch.html:

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

19 months agoUnreviewed, stackPointer signature is different from declaration
utatane.tea@gmail.com [Wed, 2 May 2018 10:06:05 +0000 (10:06 +0000)]
Unreviewed, stackPointer signature is different from declaration
https://bugs.webkit.org/show_bug.cgi?id=184790

* runtime/MachineContext.h:
(JSC::MachineContext::stackPointer):

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

19 months agoUnreviewed, fix build in WinCairo
utatane.tea@gmail.com [Wed, 2 May 2018 06:26:35 +0000 (06:26 +0000)]
Unreviewed, fix build in WinCairo
https://bugs.webkit.org/show_bug.cgi?id=185169

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowBase.h:

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

19 months agoWrite a script that detects chart changes by using v3 API.
dewei_zhu@apple.com [Wed, 2 May 2018 06:16:16 +0000 (06:16 +0000)]
Write a script that detects chart changes by using v3 API.
https://bugs.webkit.org/show_bug.cgi?id=184419

Reviewed by Ryosuke Niwa.

Added a script that detects chart changes and schedule confirming analysis task.

* browser-tests/async-task-tests.js: Added a unit test for 'AsyncTask'.
* browser-tests/index.html: Added import for 'AsyncTask' for testing.
* public/shared/statistics.js: Make 'findRangesForChangeDetectionsWithWelchsTTest' defaults to 0.99 one sided possibility.
(Statistics.new.this.findRangesForChangeDetectionsWithWelchsTTest):
* public/v3/async-task.js:
(AsyncTask.isAvailable): Helper function to determine whether AsyncTask is available or not as 'Worker' is
not available in nodejs.
(AsyncTask):
* public/v3/models/bug.js: Export as a module.
* public/v3/models/measurement-set.js:
(MeasurementSet.prototype._invokeSegmentationAlgorithm): Added a check to avoid using AsyncTask when running in NodeJs.
(MeasurementSet):
* server-tests/resources/common-operations.js: Added a helper function to assert certain exception is thrown.
(async.assertThrows):
* tools/js/measurement-set-analyzer.js: Added 'MeasurementSetAnalyzer' module for analyzing measurement set.
(MeasurementSetAnalyzer):
(MeasurementSetAnalyzer.prototype.async.analyzeOnce):
(MeasurementSetAnalyzer.measurementSetListForAnalysis):
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
* tools/js/v3-models.js: Added import for 'Bug' object.
* tools/run-analysis.js: Added this script to detect measurement set changes.
(main):
(async.analysisLoop):
* unit-tests/measurement-set-analyzer-tests.js: Added unit tests for 'MeasurementSetAnalyzer'.
* unit-tests/resources/mock-v3-models.js: Reset 'MeasurementSet._set' every time.
Update mock platform to include lastModifiedByMetric information.
(MockModels.inject):

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

19 months ago[JSC] Add SameValue DFG node
utatane.tea@gmail.com [Wed, 2 May 2018 05:51:33 +0000 (05:51 +0000)]
[JSC] Add SameValue DFG node
https://bugs.webkit.org/show_bug.cgi?id=185065

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/object-is.js: Added.
(incognito):
(sameValue):
(test1):
(test2):
(test3):
(test4):
(test5):
(test6):
* stress/object-is.js: Added.
(shouldBe):
(is1):
(is2):
(is3):
(is4):
(is5):
(is6):
(is7):
(is8):
(is9):
(is10):
(is11):
(is12):
(is13):
(is14):
(is15):

Source/JavaScriptCore:

This patch adds Object.is handling in DFG and FTL. Object.is is converted to SameValue DFG node.
And DFG fixup phase attempts to convert SameValue node to CompareStrictEq with type filter edges
if possible. Since SameValue(Untyped, Untyped) and SameValue(Double, Double) have different semantics
from CompareStrictEq, we do not convert SameValue to CompareStrictEq for them. DFG and FTL have
implementations for these SameValue nodes.

This old MacroAssemblerX86Common::compareDouble was dead code since the derived class, "MacroAssembler"
has a generalized compareDouble, which just uses branchDouble. Since this was not used, this function
was broken. This patch fixes issues and move compareDouble to MacroAssemblerX86Common, and remove a
generalized compareDouble for x86 arch to use this specialized efficient version instead. The fixes are
correctly using set32 to zero-extending the result, and setting the initial value of `dest` register
correctly for DoubleEqual and DoubleNotEqualOrUnordered cases.

Added microbenchmark shows performance improvement.

    object-is           651.0053+-38.8204    ^    241.3467+-15.8753       ^ definitely 2.6974x faster

* assembler/MacroAssembler.h:
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::compareDouble):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::compareDouble): Deleted.
* assembler/testmasm.cpp:
(JSC::doubleOperands):
(JSC::testCompareDouble):
(JSC::run):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSameValue):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileSameValue):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/ObjectConstructor.cpp:

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

19 months agoUse default std::optional if it is provided
utatane.tea@gmail.com [Wed, 2 May 2018 04:32:33 +0000 (04:32 +0000)]
Use default std::optional if it is provided
https://bugs.webkit.org/show_bug.cgi?id=185159

Reviewed by JF Bastien.

Source/WebCore:

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::item const):
(WebCore::DatasetDOMStringMap::namedItem const):
(WebCore:: const): Deleted.
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):
* dom/Element.h:
* inspector/DOMEditor.cpp:
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::getPostData):
(): Deleted.
* platform/network/curl/CurlFormDataStream.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDMInstance::updateLicense):
(WebCore:: const): Deleted.
* testing/MockCDMFactory.h:

Source/WebKit:

* Shared/SandboxExtension.h:
(WebKit::SandboxExtension::Handle::decode):
* Shared/TouchBarMenuItemData.cpp:
(WebKit::TouchBarMenuItemData::decode):

Source/WTF:

Now C++17 flag is enabled. It means that any standard libraries can use <optional> internally.
If we define std::optional regardless of the existence of the standard library's <optional>,
it causes compile errors. For example, in GCC 7 (specifically GCC 7.3.0) environment,
<optional> is included in <unordered_map>.
We do not define std::optional in WebKit side if <optional> is offered.

And we also remove std::optional<T&> use since this is not accepted in C++17. Use
std::optional<std::reference_wrapper<T>> instead.

* wtf/Expected.h:
constexpr does not mean const in C++17.

* wtf/Optional.h:
Do not define std::optional if <optional> is provided.

(WTF::valueOrCompute):

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

19 months agoPSON: Make WebKitTestRunner work with process swap on navigation turned on
rniwa@webkit.org [Wed, 2 May 2018 04:05:41 +0000 (04:05 +0000)]
PSON: Make WebKitTestRunner work with process swap on navigation turned on
https://bugs.webkit.org/show_bug.cgi?id=185111

Reviewed by Chris Dumez.

Add the basic support for running layout tests with process-swap-on-navigation turned on.

First, move m_whatToDump, m_dumpPixels, m_waitToDump, and m_dumpFrameLoadCallbacks from WebContent process
to UI process so that calls to waitUntilDone, dumpAsText, etc... persist across process swaps.

In addition, initialize the injected bundle inside a new WebContent process when the first page is created.
This instantiates objects such as TestRunner, GCController, etc... in the new process. The initialization
can't be done in InjectedBundle::beginTesting because some steps in InjectedBundle::initialize require
the current PageGroup and Page objects. We avoid clearing databases and app cache in this case.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didCreatePage): Send "Initialization" message to UI process. This message returns
all the dictionary values usually present in "BeginTest" message from UI process as well as "ResumeTesting"
boolean which is set when this process was created as a result of a process swap on navgation. Invoke
beginTesting with BegingTestingMode::Resume when this boolean is set.
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::beginTesting): Don't clear database, app cache, etc... when initializing an injected
bundle after a process swap on navigation.
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dump):
(WTR::InjectedBundlePage::frameDidChangeLocation):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
(WTR::TestRunner::shouldDumpPixels const): Added.
(WTR::TestRunner::setDumpPixels): Added.
(WTR::TestRunner::dumpAsText):
(WTR::TestRunner::whatToDump const): Added.
(WTR::TestRunner::setWhatToDump): Added.
(WTR::TestRunner::waitUntilDone):
(WTR::TestRunner::setWaitUntilDone): Added.
(WTR::TestRunner::shouldWaitUntilDone): Added.
(WTR::TestRunner::notifyDone):
(WTR::TestRunner::forceImmediateCompletion):
(WTR::TestRunner::setShouldDumpFrameLoadCallbacks): Added.
(WTR::TestRunner::shouldDumpFrameLoadCallbacks): Added.
(WTR::TestRunner::setAudioResult):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::dumpChildFramesAsText):
(WTR::TestRunner::dumpDOMAsWebArchive):
(WTR::TestRunner::setShouldDumpFrameLoadCallbacks): Moved to cpp.
(WTR::TestRunner::whatToDump const): Moved to cpp.
(WTR::TestRunner::shouldDumpMainFrameScrollPosition const):
(WTR::TestRunner::shouldDumpPixels const): Moved to cpp.
(WTR::TestRunner::shouldDumpFrameLoadCallbacks const): Moved to cpp.
(WTR::TestRunner::waitToDump const): Renamed to shouldWaitUntilDone and moved to cpp.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation): Initialize m_dumpFrameLoadCallbacks here.
(WTR::TestInvocation::shouldLogFrameLoadDelegates const): Deleted.
(WTR::TestInvocation::createTestSettingsDictionary): Extracted from invoke().
(WTR::TestInvocation::invoke): Sets m_startedTesting to true immediately afte sending "BeginTest" message.
m_startedTesting is later used in didReceiveSynchronousMessageFromInjectedBundle to detect whether a given
"Initialization" message is sent from a regular WebContent process (m_startedTesting is false) or the one
started as a result of a process swap on navigation (m_startedTesting is true).
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): Added a bunch of new messgaes to
support initializing the injected bundle in a process swapped after navigation and set/get messages for
the states which must persist across process swaps within a test.
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* Tools/WebKitTestRunner/WhatToDump.h:
(WTR::WhatToDump): Added.

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

19 months agoAdd release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threadin...
cdumez@apple.com [Wed, 2 May 2018 03:33:55 +0000 (03:33 +0000)]
Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
https://bugs.webkit.org/show_bug.cgi?id=185181

Reviewed by Geoffrey Garen.

Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
the UIthread instead of the WebThread on iOS WebKitLegacy.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::scheduleStreams):
(WebCore::SocketStreamHandleImpl::readStreamCallback):

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

19 months agoUnreviewed, remove an unused variable in RuntimeEnabledFeatures.h
wenson_hsieh@apple.com [Wed, 2 May 2018 00:01:49 +0000 (00:01 +0000)]
Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h

* page/RuntimeEnabledFeatures.h:

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

19 months agoAuto save the results for Test262
commit-queue@webkit.org [Tue, 1 May 2018 23:38:40 +0000 (23:38 +0000)]
Auto save the results for Test262
https://bugs.webkit.org/show_bug.cgi?id=184926

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-01
Reviewed by Michael Saboff.
Tools:

* Scripts/test262/Runner.pm:
(processCLI):
(main):
(parseError):
(processResult):
(summarizeResults):
* Scripts/test262/config.yaml: Renamed from Tools/Scripts/test262/test262-config.yaml.

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

19 months agoWeb Inspector: Canvas tab: determine hasVisibleEffect for all actions immediately...
webkit@devinrousso.com [Tue, 1 May 2018 23:37:59 +0000 (23:37 +0000)]
Web Inspector: Canvas tab: determine hasVisibleEffect for all actions immediately after recording is added
https://bugs.webkit.org/show_bug.cgi?id=182995

Reviewed by Matt Baker.

Source/WebInspectorUI:

Previously, we'd swizzle the entirety of the `WI.Recording` in one, which would usually
freeze the UI, especially for larger recordings. This patch uses `WI.YieldableTask` to split
the work and allow the rest of the UI to still be usable while `WI.Recording` are processing.
Additionally, since we no longer have to worry about hangs, we can do more work upfront,
such as calculating `hasVisibleEffect` and the current state of 2D canvases.

These changes require that all uses of `WI.Recording` call `process()` before attempting to
use any `frames`/`actions`/`initialState`, as they will have their original payload values
and will have not been swizzled or applied.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Models/Recording.js:
(WI.Recording):
(WI.Recording.prototype.process):
(WI.Recording.prototype.createContext): Added.
(WI.Recording.prototype.async yieldableTaskWillProcessItem): Added.
(WI.Recording.prototype.async yieldableTaskDidFinish): Added.

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction):
(WI.RecordingAction.prototype.process): Added.
(WI.RecordingAction.prototype.async swizzle): Added.
(WI.RecordingAction.prototype.apply):
(WI.RecordingAction.prototype.toJSON):
(WI.RecordingAction.prototype.set state): Deleted.
(WI.RecordingAction.prototype.swizzle): Deleted.
(WI.RecordingAction.prototype.apply.getContent): Deleted.
(WI.RecordingAction.prototype.async _swizzle): Deleted.
* UserInterface/Models/RecordingInitialStateAction.js:
(WI.RecordingInitialStateAction):

* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel):
(WI.CanvasSidebarPanel.prototype.set action):
(WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange):
(WI.CanvasSidebarPanel.prototype._recordingChanged):

* UserInterface/Views/CanvasSidebarPanel.css:
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .indeterminate-progress-spinner):

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement):
(WI.RecordingActionTreeElement.prototype.onattach):
(WI.RecordingActionTreeElement.prototype._handleHasVisibleEffectChanged): Deleted.

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.get navigationItems):
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype._generateContentCanvas2D): Added.
(WI.RecordingContentView.prototype._generateContentCanvasWebGL): Added.
(WI.RecordingContentView.prototype._updateCanvasPath):
(WI.RecordingContentView.prototype._updateProcessProgress): Added.
(WI.RecordingContentView.prototype._handleRecordingProcessedActionSwizzle): Added.
(WI.RecordingContentView.prototype._handleRecordingProcessedActionApply): Added.
(WI.RecordingContentView.supportsCanvasPathDebugging): Deleted.
(WI.RecordingContentView.prototype.async _generateContentCanvas2D): Deleted.
(WI.RecordingContentView.prototype.async _generateContentCanvasWebGL): Deleted.

* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording > .preview-container):

* UserInterface/Base/ImageUtilities.js:
(WI.ImageUtilities.supportsCanvasPathDebugging):

LayoutTests:

* inspector/canvas/resources/recording-utilities.js:

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

19 months agoProduction build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is...
jer.noble@apple.com [Tue, 1 May 2018 22:19:46 +0000 (22:19 +0000)]
Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
https://bugs.webkit.org/show_bug.cgi?id=185171

Reviewed by Timothy Hatcher.

* Configurations/BaseTarget.xcconfig:

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

19 months agoFix build error after r231194
gskachkov@gmail.com [Tue, 1 May 2018 21:27:06 +0000 (21:27 +0000)]
Fix build error after r231194
https://bugs.webkit.org/show_bug.cgi?id=185169

Reviewed by JF Bastien.

Prevent compile error in iOS Simulator debug build
by tagging function

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):

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

19 months agowebkitpy: SIGKILL right after SIGTERM causes orphaned processes with 'xcrun simctl...
jbedard@apple.com [Tue, 1 May 2018 20:53:34 +0000 (20:53 +0000)]
webkitpy: SIGKILL right after SIGTERM causes orphaned processes with 'xcrun simctl spawn'
https://bugs.webkit.org/show_bug.cgi?id=185164

Reviewed by David Kilzer.

* Scripts/webkitpy/common/system/executive.py:
(Executive.kill_process): First attempt will always send a SIGTERM, all subsequent attempts will
send a SIGKILL. A SIGKILL with not be sent if the process is not running to avoid orphaning childen.

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

19 months agoREGRESSION (r230919): API test WebKit.AutoLayoutIntegration is a flaky failure
cdumez@apple.com [Tue, 1 May 2018 20:40:22 +0000 (20:40 +0000)]
REGRESSION (r230919): API test WebKit.AutoLayoutIntegration is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=184918
<rdar://problem/39705516>

Reviewed by Wenson Hsieh.

Make sure provisional load has started before calling beginLayoutAtMinimumWidth
on the AutoLayoutWKWebView to restore pre-r230919 behavior. The load now starts
asynchronously because we ask the client if it is OK to do the load and the policy
delegates are asynchronous nowadays.

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]):
* TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[TestNavigationDelegate webView:didStartProvisionalNavigation:]):
(-[TestNavigationDelegate waitForDidStartProvisionalNavigation]):
(-[WKWebView _test_waitForDidStartProvisionalNavigation]):

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

19 months agoProtect against changes to CoreMedia function signatures
jer.noble@apple.com [Tue, 1 May 2018 20:37:31 +0000 (20:37 +0000)]
Protect against changes to CoreMedia function signatures
https://bugs.webkit.org/show_bug.cgi?id=185167

Reviewed by Eric Carlson.

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:

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

19 months ago[WinCairo] Align buildbot test stages with AppleWin.
ross.kirsling@sony.com [Tue, 1 May 2018 19:57:28 +0000 (19:57 +0000)]
[WinCairo] Align buildbot test stages with AppleWin.
https://bugs.webkit.org/show_bug.cgi?id=185094

Reviewed by Brent Fulgham.

* BuildSlaveSupport/build.webkit.org-config/factories.py:
(TestFactory.__init__):
Do run API tests, don't run dashboard tests.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunUnitTests):
Call run-api-tests with Python, not Perl (bugfix for r230998).

* Scripts/webkitpy/port/win.py:
(WinPort.environment_for_api_tests):
Retrieve necessary Windows environment variables.

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

19 months agoUse correct runloop type in the WebContent process.
pvollan@apple.com [Tue, 1 May 2018 19:57:17 +0000 (19:57 +0000)]
Use correct runloop type in the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=185140

Reviewed by Brent Fulgham.

Use WK_MACOS_* machinery to determine runloop type for the WebContent process.

* Configurations/WebContentService.xcconfig:

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

19 months agoB3::demoteValues should be able to handle patchpoint terminals
fpizlo@apple.com [Tue, 1 May 2018 19:55:59 +0000 (19:55 +0000)]
B3::demoteValues should be able to handle patchpoint terminals
https://bugs.webkit.org/show_bug.cgi?id=185151

Reviewed by Saam Barati.

If we try to demote a patchpoint terminal then prior to this change we would append a Set to
the basic block that the patchpoint terminated. That's wrong because then the terminal is no
longer the last thing in the block.

Air encounters this problem in spilling and solves it by doing a fixup afterwards. We can't
really do that because demotion happens as a prerequisite to other transformations.

One solution might have been to make demoteValues insert a basic block whenever it encounters
this problem. But that would break clients that do CFG analysis before demoteValues and use
the results of the CFG analysis after demoteValues. Taildup does this. Fortunately, taildup
also runs breakCriticalEdges. Probably anyone using demoteValues will use breakCriticalEdges,
so it's not bad to introduce that requirement.

So, this patch solves the problem by ensuring that breakCriticalEdges treats any patchpoint
terminal as if it had multiple successors. This means that a patchpoint terminal's successors
will only have it as their predecessor. Then, demoteValues just prepends the Set to the
successors of the patchpoint terminal.

This was probably asymptomatic. It's hard to write a JS test that triggers this, so I added
a unit test in testb3.

* b3/B3BreakCriticalEdges.cpp:
(JSC::B3::breakCriticalEdges):
* b3/B3BreakCriticalEdges.h:
* b3/B3FixSSA.cpp:
(JSC::B3::demoteValues):
(JSC::B3::fixSSA):
* b3/B3FixSSA.h:
* b3/B3Value.cpp:
(JSC::B3::Value::foldIdentity const):
(JSC::B3::Value::performSubstitution):
* b3/B3Value.h:
* b3/testb3.cpp:
(JSC::B3::testDemotePatchpointTerminal):
(JSC::B3::run):

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

19 months agoUnreviewed test gardening, correct a typo in the iOS TestExpectation file.
ryanhaddad@apple.com [Tue, 1 May 2018 19:45:34 +0000 (19:45 +0000)]
Unreviewed test gardening, correct a typo in the iOS TestExpectation file.

* platform/ios/TestExpectations:

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

19 months agoRebaseline tests after r231165.
ryanhaddad@apple.com [Tue, 1 May 2018 19:45:31 +0000 (19:45 +0000)]
Rebaseline tests after r231165.
https://bugs.webkit.org/show_bug.cgi?id=185166

Unreviewed test gardening.

* animations/font-variations/font-variation-settings-expected.txt:
* animations/font-variations/font-variation-settings-order-expected.txt:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings.html:
* legacy-animation-engine/animations/font-variations/font-variation-settings-expected.txt:
* legacy-animation-engine/animations/font-variations/font-variation-settings-order-expected.txt:
* legacy-animation-engine/animations/font-variations/font-variation-settings-order.html:
* legacy-animation-engine/animations/font-variations/font-variation-settings.html:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Added.

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

19 months ago[MediaStream] remove WK1 support
eric.carlson@apple.com [Tue, 1 May 2018 17:27:13 +0000 (17:27 +0000)]
[MediaStream] remove WK1 support
https://bugs.webkit.org/show_bug.cgi?id=185136

Reviewed by Youenn Fablet.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebUserMediaClient.h: Removed.
* WebCoreSupport/WebUserMediaClient.mm: Removed.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _preferencesChanged:]):
(-[WebView _setUserMediaClient:]): Deleted.
(-[WebView _userMediaClient]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewPrivate.h:

Tools:

* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:decidePolicyForUserMediaRequestFromOrigin:listener:]): Deleted.

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

19 months ago[WKTR] Move navigation policy for response decision from InjectedBundle to UIProcess
cdumez@apple.com [Tue, 1 May 2018 17:09:06 +0000 (17:09 +0000)]
[WKTR] Move navigation policy for response decision from InjectedBundle to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=185157

Reviewed by Geoffrey Garen.

Move navigation policy for response decision from InjectedBundle to UIProcess. This is a more
common configuration and should therefore be the configuration we test by default.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForResponse):

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

19 months agoUse CheckedArithmetic for length computation in JSArray::unshiftCountWithAnyIndexingType
rmorisset@apple.com [Tue, 1 May 2018 16:03:54 +0000 (16:03 +0000)]
Use CheckedArithmetic for length computation in JSArray::unshiftCountWithAnyIndexingType
https://bugs.webkit.org/show_bug.cgi?id=184772
<rdar://problem/39146327>

Reviewed by Filip Pizlo.

Related to https://bugs.webkit.org/show_bug.cgi?id=183657 (<rdar://problem/38464399), where a check was missing.
This patch now makes sure that the check correctly detects if there is an integer overflow.

* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountWithAnyIndexingType):

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

19 months agoCorrectly detect string overflow when using the 'Function' constructor
rmorisset@apple.com [Tue, 1 May 2018 16:01:25 +0000 (16:01 +0000)]
Correctly detect string overflow when using the 'Function' constructor
https://bugs.webkit.org/show_bug.cgi?id=184883
<rdar://problem/36320331>

Reviewed by Filip Pizlo.

JSTests:

I put this regression test in the 'slowMicrobenchmarks' directory because it takes nearly 30s to run, and I am not sure where else to put it.

* slowMicrobenchmarks/function-constructor-with-huge-strings.js: Added.
(catch):

Source/JavaScriptCore:

The 'Function' constructor creates a string containing the source code of the new function through repeated string concatenation.
Because there was no way for the string concatenation routines in WTF to return an error, they just crashed in that case.

I added new tryAppend methods alongside the old append methods, that return a boolean (true means success, false means an overflow happened).
In this way, it becomes possible for the Function constructor to just throw a proper JS exception when asked to create a string > 4GB.
I made new methods instead of just adapting the existing ones (and reverted such a change on appendQuotedJSONString) so that callers that rely on the old behaviour (a hard CRASH() on overflow) don't silently start failing.

* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):

Source/WTF:

I added new tryAppend methods alongside the old append methods in StringBuilder, that return a boolean (true means success, false means an overflow happened).
I made new methods instead of just adapting the existing ones (and reverted such a change on appendQuotedJSONString) so that callers that rely on the old behaviour (a hard CRASH() on overflow) don't silently start failing.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBufferUpConvert):
(WTF::StringBuilder::tryAllocateBufferUpConvert):
(WTF::StringBuilder::appendUninitialized):
(WTF::StringBuilder::append):
(WTF::StringBuilder::tryAppend):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::tryAppend):
(WTF::StringBuilder::append):
(WTF::StringBuilder::tryAppendLiteral):
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):
(WTF::StringBuilder::tryAppendQuotedJSONString):

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

19 months agoIntlObject.cpp::removeUnicodeLocaleExtension() should not touch locales that end...
rmorisset@apple.com [Tue, 1 May 2018 15:47:29 +0000 (15:47 +0000)]
IntlObject.cpp::removeUnicodeLocaleExtension() should not touch locales that end in '-u'
https://bugs.webkit.org/show_bug.cgi?id=185162

Reviewed by Filip Pizlo.

JSTests:

* stress/incomplete-unicode-locale.js: Added.
(catch):

Source/JavaScriptCore:

* runtime/IntlObject.cpp:
(JSC::removeUnicodeLocaleExtension):

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

19 months agoAdd SetCallee as DFG-Operation
commit-queue@webkit.org [Tue, 1 May 2018 15:42:11 +0000 (15:42 +0000)]
Add SetCallee as DFG-Operation
https://bugs.webkit.org/show_bug.cgi?id=184582

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-01
Reviewed by Filip Pizlo.

JSTests:

Added test that runs into infinite loop without updating the callee and
therefore emitting SetCallee in DFG for recursive tail calls.

* stress/closure-recursive-tail-call-infinite-loop.js: Added.
(Foo):
(second):
(first):
(return.closure):
(createClosure):

Source/JavaScriptCore:

For recursive tail calls not only the argument count can change but also the
callee. Add SetCallee to DFG that sets the callee slot in the current call frame.
Also update the callee when optimizing a recursive tail call.
Enable recursive tail call optimization also for closures.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::handleCallVariant):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSetCallee):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileSetCallee):

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

19 months agoWebAssembly: add support for stream APIs - JavaScript API
gskachkov@gmail.com [Tue, 1 May 2018 08:47:56 +0000 (08:47 +0000)]
WebAssembly: add support for stream APIs - JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=183442

Reviewed by Yusuke Suzuki and JF Bastien.

* Source/cmake/WebKitFeatures.cmake:

LayoutTests/imported/w3c:

* web-platform-tests/wasm/resources/incrementer.no_mime_type.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wasm.headers: Added.
* web-platform-tests/wasm/resources/incrementer.wrong_mime_type.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wrong_mime_type.wasm.headers: Added.
* web-platform-tests/wasm/wasm_stream_compile_test-expected.txt: Added.
* web-platform-tests/wasm/wasm_stream_compile_test.html: Added.
* web-platform-tests/wasm/wasm_stream_instantiate_test-expected.txt: Added.
* web-platform-tests/wasm/wasm_stream_instantiate_test.html: Added.

Source/JavaScriptCore:

Add WebAssembly stream API. Current patch only add functions
WebAssembly.compileStreaming and WebAssembly.instantiateStreaming but,
does not add streaming way of the implementation. So in current version it
only wait for load whole module, than start to parse.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
* builtins/WebAssemblyPrototype.js: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h.
(compileStreaming):
(instantiateStreaming):
* jsc.cpp:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
* runtime/Options.h:
* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::hasPendingPromise):
(JSC::PromiseDeferredTimer::hasDependancyInPendingPromise):
* runtime/PromiseDeferredTimer.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyModuleValidateAsyncInternal):
(JSC::webAssemblyCompileFunc):
(JSC::WebAssemblyPrototype::webAssemblyModuleValidateAsync):
(JSC::webAssemblyModuleInstantinateAsyncInternal):
(JSC::WebAssemblyPrototype::webAssemblyModuleInstantinateAsync):
(JSC::webAssemblyCompileStreamingInternal):
(JSC::webAssemblyInstantiateStreamingInternal):
(JSC::WebAssemblyPrototype::create):
(JSC::WebAssemblyPrototype::finishCreation):
* wasm/js/WebAssemblyPrototype.h:

Source/WebCore:

Add WebAssembly streaming API to WebCore.

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::tryAllocate):
(WebCore::isResponseCorrect):
(WebCore::handleResponseOnStreamingAction):
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSRemoteDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:

Source/WebCore/PAL:

Add WEBASSEMBLY_STREAMING_API feature flag

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Add WEBASSEMBLY_STREAMING_API feature flag

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

Add WEBASSEMBLY_STREAMINNG_API feature flag

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
Oleksandrs-MacBook-Pro:WebKit developer$ Tools/Scripts/commit-log-editor --print-log ChangeLog LayoutTests/ChangeLog  LayoutTests/imported/w3c/ChangeLog Source/JavaScriptCore/ChangeLog Source/WebCore/ChangeLog Source/WebCore/PAL/ChangeLog Source/WebKit/ChangeLog Source/WebKitLegacy/mac/ChangeLog Tools/ChangeLog
WebAssembly: add support for stream APIs - JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=183442

Reviewed by Yusuke Suzuki and JF Bastien.

* Source/cmake/WebKitFeatures.cmake:

LayoutTests/imported/w3c:

* web-platform-tests/wasm/resources/incrementer.no_mime_type.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wasm.headers: Added.
* web-platform-tests/wasm/resources/incrementer.wrong_mime_type.wasm: Added.
* web-platform-tests/wasm/resources/incrementer.wrong_mime_type.wasm.headers: Added.
* web-platform-tests/wasm/wasm_stream_compile_test-expected.txt: Added.
* web-platform-tests/wasm/wasm_stream_compile_test.html: Added.
* web-platform-tests/wasm/wasm_stream_instantiate_test-expected.txt: Added.
* web-platform-tests/wasm/wasm_stream_instantiate_test.html: Added.

Source/JavaScriptCore:

Add WebAssembly stream API. Current patch only add functions
WebAssembly.compileStreaming and WebAssembly.instantiateStreaming but,
does not add streaming way of the implementation. So in current version it
only wait for load whole module, than start to parse.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
* builtins/WebAssemblyPrototype.js: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h.
(compileStreaming):
(instantiateStreaming):
* jsc.cpp:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
* runtime/Options.h:
* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::hasPendingPromise):
(JSC::PromiseDeferredTimer::hasDependancyInPendingPromise):
* runtime/PromiseDeferredTimer.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyModuleValidateAsyncInternal):
(JSC::webAssemblyCompileFunc):
(JSC::WebAssemblyPrototype::webAssemblyModuleValidateAsync):
(JSC::webAssemblyModuleInstantinateAsyncInternal):
(JSC::WebAssemblyPrototype::webAssemblyModuleInstantinateAsync):
(JSC::webAssemblyCompileStreamingInternal):
(JSC::webAssemblyInstantiateStreamingInternal):
(JSC::WebAssemblyPrototype::create):
(JSC::WebAssemblyPrototype::finishCreation):
* wasm/js/WebAssemblyPrototype.h:

Source/WebCore:

Add WebAssembly streaming API to WebCore.

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::tryAllocate):
(WebCore::isResponseCorrect):
(WebCore::handleResponseOnStreamingAction):
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSRemoteDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:

Source/WebCore/PAL:

Add WEBASSEMBLY_STREAMING_API feature flag

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Add WEBASSEMBLY_STREAMING_API feature flag

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

Add WEBASSEMBLY_STREAMINNG_API feature flag

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

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

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

19 months agoToString constant folds without preserving checks, causing us to break assumptions...
sbarati@apple.com [Tue, 1 May 2018 06:04:33 +0000 (06:04 +0000)]
ToString constant folds without preserving checks, causing us to break assumptions that the code would OSR exit
https://bugs.webkit.org/show_bug.cgi?id=185149
<rdar://problem/39455917>

Reviewed by Filip Pizlo.

JSTests:

* stress/keep-checks-when-converting-to-lazy-js-constant-in-strength-reduction.js: Added.

Source/JavaScriptCore:

The bug was that we were deleting checks that we shouldn't have deleted.
This patch makes a helper inside strength reduction that converts to
a LazyJSConstant while maintaining checks, and switches users of the
node API inside strength reduction to instead call the helper function.

This patch also fixes a potential bug where StringReplace and
StringReplaceRegExp may not preserve all their checks.

* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
(JSC::DFG::StrengthReductionPhase::convertToLazyJSValue):

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

19 months agoUse correct runloop type in the WebContent process.
pvollan@apple.com [Tue, 1 May 2018 02:22:02 +0000 (02:22 +0000)]
Use correct runloop type in the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=185140
<rdar://problem/39585037>

Reviewed by Brent Fulgham.

The macOS target version should be used to determine the runloop type.

* Configurations/WebContentService.xcconfig:

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

19 months agoUnreviewed test gardening
jiewen_tan@apple.com [Tue, 1 May 2018 01:31:00 +0000 (01:31 +0000)]
Unreviewed test gardening

Update test expectations since the crash reported on Bug 177828 is no longer reproducible.

* platform/mac-wk2/TestExpectations:

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

19 months agoEliminate WebProcessShim.dylib
msaboff@apple.com [Tue, 1 May 2018 01:19:16 +0000 (01:19 +0000)]
Eliminate WebProcessShim.dylib
https://bugs.webkit.org/show_bug.cgi?id=185147

Reviewed by Ryosuke Niwa.

* Configurations/WebContentService.xcconfig:
* Configurations/WebProcessShim.xcconfig: Removed.
* WebKit.xcodeproj/project.pbxproj:

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