WebKit-https.git
4 years ago[Win] Pass close_fds = True in Python popen call.
pvollan@apple.com [Thu, 30 Mar 2017 21:10:54 +0000 (21:10 +0000)]
[Win] Pass close_fds = True in Python popen call.
https://bugs.webkit.org/show_bug.cgi?id=170172

Reviewed by Brent Fulgham.

This was previously not supported on Windows, but in Python 2.7.10 it is.

* Scripts/webkitpy/common/system/executive.py:
(Executive._should_close_fds):
* Scripts/webkitpy/port/server_process.py:
(ServerProcess._start):

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

4 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
graouts@webkit.org [Thu, 30 Mar 2017 21:05:58 +0000 (21:05 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>

Unreview. Print the backtrace when we suspend scripted animations.

* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):

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

4 years agoWe are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
cdumez@apple.com [Thu, 30 Mar 2017 20:46:03 +0000 (20:46 +0000)]
We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
https://bugs.webkit.org/show_bug.cgi?id=170288
<rdar://problem/31289132>

Reviewed by Eric Carlson.

We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
0-gain case as much as possible.

No new tests, only an optimization.

* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::processIfNecessary):
Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
API already takes care of clearing its 'silent' flag whenever its buffer changes so
there should be no need to explicitly clearing the 'silent' flag before calling
process(). This was causing us to zero out buffers that were already filled with
zeros because AudioChannel::zero() would no longer return early, not knowing the
channel is already silent. This reduces the number of bzero() calls by ~3.5x on
uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.

* Modules/webaudio/AudioNode.h:
* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::render):
Avoid clamping the values in the channel buffer if the channel is silent since this
will have no effect (given that the buffer only contains zeros).

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

4 years agowebrtc/video-stats.html and webrtc/video-replace-track.html are flaky
commit-queue@webkit.org [Thu, 30 Mar 2017 20:22:38 +0000 (20:22 +0000)]
webrtc/video-stats.html and webrtc/video-replace-track.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=170294

Unreviewed.

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

* TestExpectations: Marking these tests as flaky.

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

4 years ago[Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
eric.carlson@apple.com [Thu, 30 Mar 2017 20:17:08 +0000 (20:17 +0000)]
[Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
https://bugs.webkit.org/show_bug.cgi?id=169956

Reviewed by Youenn Fablet.

Source/WebCore:

Test: webaudio/audiobuffer-crash.html

* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel
array allocation fails.
(WebCore::AudioBuffer::AudioBuffer): Ditto.
(WebCore::AudioBuffer::invalidate): Invalidate the object.
* Modules/webaudio/AudioBuffer.h:

LayoutTests:

* webaudio/audiobuffer-crash-expected.txt: Added.
* webaudio/audiobuffer-crash.html: Added.

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

4 years agoWeb Inspector: Styles sidebar warning icon appears inside property value text
mattbaker@apple.com [Thu, 30 Mar 2017 20:17:08 +0000 (20:17 +0000)]
Web Inspector: Styles sidebar warning icon appears inside property value text
https://bugs.webkit.org/show_bug.cgi?id=170281

Reviewed by Timothy Hatcher.

Style rule warning icon should always come before the property name,
regardless of which property part (name/value) the error is for. This
information is conveyed by the red strikethrough, which is applied to
the property name, value, or both.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:

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

4 years agoNetworkConnectionToWebProcess should stop web sockets when being destroyed
commit-queue@webkit.org [Thu, 30 Mar 2017 20:09:06 +0000 (20:09 +0000)]
NetworkConnectionToWebProcess should stop web sockets when being destroyed
https://bugs.webkit.org/show_bug.cgi?id=170286

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-30
Reviewed by Brady Eidson.

* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
* NetworkProcess/NetworkSocketStream.h:

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

4 years agoChange my status to be a WebKit reviewer.
aakash_jain@apple.com [Thu, 30 Mar 2017 19:43:36 +0000 (19:43 +0000)]
Change my status to be a WebKit reviewer.

Unreviewed status update edit.

* Scripts/webkitpy/common/config/contributors.json:

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

4 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
graouts@webkit.org [Thu, 30 Mar 2017 19:18:07 +0000 (19:18 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>

Unreview. Pring the backtrace when we suspend ScriptedAnimationController.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):

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

4 years agoAdd some tests that dump the touch event regions with various content configurations
simon.fraser@apple.com [Thu, 30 Mar 2017 18:41:35 +0000 (18:41 +0000)]
Add some tests that dump the touch event regions with various content configurations
https://bugs.webkit.org/show_bug.cgi?id=170216

Followup: add missing results files, and tweak iframes.html to show that regions fail to
take iframe borders into account.

* fast/events/touch/ios/touch-event-regions/active-passive-nesting-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/columns-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/complex-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/document-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/iframes-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/iframes.html:
* fast/events/touch/ios/touch-event-regions/overflow-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/range-sliders-expected.txt: Added.

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

4 years ago[mac-wk1 debug] LayoutTest media/track/track-cue-rendering-with-padding.html is a...
pvollan@apple.com [Thu, 30 Mar 2017 17:06:59 +0000 (17:06 +0000)]
[mac-wk1 debug] LayoutTest media/track/track-cue-rendering-with-padding.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=170188

Reviewed by Eric Carlson.

The textTrackDisplayElement call will fail and throw an exception if the text track display element
has not yet been added to the text track container element. We wait until it has been added.

* media/track/track-cue-rendering-with-padding.html:

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

4 years ago[Modern Media Controls] Invalid placard icon is not visible for short video
commit-queue@webkit.org [Thu, 30 Mar 2017 17:06:21 +0000 (17:06 +0000)]
[Modern Media Controls] Invalid placard icon is not visible for short video
https://bugs.webkit.org/show_bug.cgi?id=170277
<rdar://problem/31327955>

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

Source/WebCore:

Make the minimum dimension needed to display a placard icon configurable and let the
invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
for media controls as having a "text-align: center" inherited value would mess up
positioning of the placard icon and make it flush to the right of the placard.

Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html

* Modules/modern-media-controls/controls/invalid-placard.js:
(InvalidPlacard):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
* Modules/modern-media-controls/controls/placard.js:
(Placard.prototype.layout):

LayoutTests:

Add a new test to check that we correctly hide the invalid icon only when
there is no space left to display it.

* media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics-expected.txt: Added.
* media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html: Added.

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

4 years ago[GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgo...
zandobersek@gmail.com [Thu, 30 Mar 2017 16:29:36 +0000 (16:29 +0000)]
[GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
https://bugs.webkit.org/show_bug.cgi?id=170273

Reviewed by Michael Catanzaro.

* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
PBKDF2 algorithms.

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

4 years ago[GCrypt] Add the Utilities.h header
zandobersek@gmail.com [Thu, 30 Mar 2017 16:28:47 +0000 (16:28 +0000)]
[GCrypt] Add the Utilities.h header
https://bugs.webkit.org/show_bug.cgi?id=170269

Reviewed by Michael Catanzaro.

Add a libgcrypt-specific Utilities.h header under PAL. It will contain
common functions that are shared throughout the code that leverages
libgcrypt.

* pal/crypto/gcrypt/Utilities.h: Added.
(PAL::GCrypt::logError): Use WTFLogAlways() to report the passed-in libgcrypt error.
(PAL::GCrypt::aesAlgorithmForKeySize): Return a GCRY_CIPHER_AES{128,192,256} value
that matches up with the passed-in key size.

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

4 years agoRemove unused MediaControlsApple implementation
bfulgham@apple.com [Thu, 30 Mar 2017 16:09:09 +0000 (16:09 +0000)]
Remove unused MediaControlsApple implementation
https://bugs.webkit.org/show_bug.cgi?id=170258
<rdar://problem/31331056>

Reviewed by Eric Carlson.

Remove dead code related to old media controls. We switched to HTML5-based media controls
several years ago.

No new tests. Removing this dead code should have no change in behavior.

* WebCore.xcodeproj/project.pbxproj: Remove unused files.
* dom/EventListener.h: Remove unused event type.
* html/shadow/MediaControlsApple.cpp: Removed.
* html/shadow/MediaControlsApple.h: Removed.

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

4 years ago[WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function...
commit-queue@webkit.org [Thu, 30 Mar 2017 15:54:10 +0000 (15:54 +0000)]
[WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
https://bugs.webkit.org/show_bug.cgi?id=170275

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-03-30
Reviewed by Said Abou-Hallawa.

Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.

* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
(WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.

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

4 years agoChange my status to be a WebKit reviewer.
clopez@igalia.com [Thu, 30 Mar 2017 15:14:56 +0000 (15:14 +0000)]
Change my status to be a WebKit reviewer.

Unreviewed status update edit.

* Scripts/webkitpy/common/config/contributors.json:

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

4 years ago[css-grid] Clamp the number of autorepeat tracks
svillar@igalia.com [Thu, 30 Mar 2017 14:40:46 +0000 (14:40 +0000)]
[css-grid] Clamp the number of autorepeat tracks
https://bugs.webkit.org/show_bug.cgi?id=170120

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

As suggested by the specs we do clamp the maximum number of tracks per grid in order to
minimize potential OOM situations. However we were not considering the case of the recently
added auto repeat syntax. Abnormally huge values for the width/height on the grid container
could lead to a number of auto repeat tracks higher than the maximum.

A new API was added to Internals in order to test limits without having to create huge
grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
addition of this new API forced us to add GridPosition.cpp to the project to define the
global variable we use for testing. We took the chance to move part of the implementation
from the header file to the source file.

Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
we do not surpass the grid track limits.

Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridTrackRepeatFunction):
* rendering/Grid.cpp:
(WebCore::Grid::ensureGridSize): Added ASSERT.
(WebCore::Grid::setSmallestTracksStart): Ditto.
(WebCore::Grid::setAutoRepeatTracks): Ditto.
(WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
(WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::clampAutoRepeatTracks): New method.
(WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
passing them to the Grid.
* rendering/RenderGrid.h:
* rendering/style/GridArea.h:
(WebCore::GridSpan::GridSpan):
* rendering/style/GridPosition.cpp: Added.
(WebCore::GridPosition::setExplicitPosition):
(WebCore::GridPosition::setAutoPosition):
(WebCore::GridPosition::setSpanPosition):
(WebCore::GridPosition::setNamedGridArea):
(WebCore::GridPosition::integerPosition):
(WebCore::GridPosition::namedGridLine):
(WebCore::GridPosition::spanPosition):
(WebCore::GridPosition::operator==):
* rendering/style/GridPosition.h:
(WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
(WebCore::GridPosition::max):
(WebCore::GridPosition::min):
(WebCore::GridPosition::setMaxPositionForTesting):
(WebCore::GridPosition::setExplicitPosition): Deleted.
(WebCore::GridPosition::setAutoPosition): Deleted.
(WebCore::GridPosition::setSpanPosition): Deleted.
(WebCore::GridPosition::setNamedGridArea): Deleted.
(WebCore::GridPosition::integerPosition): Deleted.
(WebCore::GridPosition::namedGridLine): Deleted.
(WebCore::GridPosition::spanPosition): Deleted.
(WebCore::GridPosition::operator==): Deleted.
* rendering/style/GridPositionsResolver.cpp:
(WebCore::GridPositionsResolver::explicitGridColumnCount):
(WebCore::GridPositionsResolver::explicitGridRowCount):
* testing/Internals.cpp:
(WebCore::Internals::setGridMaxTracksLimit):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Added a new test to check the clamping of grid tracks. It's mostly all JavaScript in order
to allow us to run several test cases over a small number of grids in a single file quite
fast. The other option was to statically (CSS) create several huge grids, something that
could potentially be very expensive in terms of memory and CPU leading to timeouts.

* fast/css-grid-layout/grid-auto-repeat-huge-grid-expected.txt: Added.
* fast/css-grid-layout/grid-auto-repeat-huge-grid.html: Added.

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

4 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Thu, 30 Mar 2017 13:11:25 +0000 (13:11 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>

Unreviewed. Add logging related to visibility since document.visibility = hidden would cause the
requestAnimationFrame() call to suspend the ScriptedAnimationController.

Patch by Antoine Quint <graouts@apple.com> on 2017-03-30

* media/modern-media-controls/airplay-button/airplay-button.html:

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

4 years agoWebAssembly: pass Wasm::Context* to vmEntryToWasm when not using fast TLS
sbarati@apple.com [Thu, 30 Mar 2017 07:29:02 +0000 (07:29 +0000)]
WebAssembly: pass Wasm::Context* to vmEntryToWasm when not using fast TLS
https://bugs.webkit.org/show_bug.cgi?id=170182

Reviewed by Mark Lam.

This is one more step in the direction of PIC-ified Wasm.
I'm removing assumptions that a wasm callee is a cell. We used to use
the callee to get the WasmContext off the callee's VM. Instead,
this patch makes it so that we pass in the context as a parameter
to the JS entrypoint.

* heap/MarkedBlock.h:
(JSC::MarkedBlock::offsetOfVM): Deleted.
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::loadWasmContext):
(JSC::AssemblyHelpers::storeWasmContext):
(JSC::AssemblyHelpers::loadWasmContextNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextNeedsMacroScratchRegister):
* jsc.cpp:
(functionTestWasmModuleFunctions):
* runtime/VM.h:
(JSC::VM::wasmContextOffset): Deleted.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::materializeWasmContext):
(JSC::Wasm::B3IRGenerator::restoreWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):
* wasm/WasmContext.cpp:
(JSC::Wasm::loadContext):
(JSC::Wasm::storeContext):
(JSC::loadWasmContext): Deleted.
(JSC::storeWasmContext): Deleted.
* wasm/WasmContext.h:
(JSC::Wasm::useFastTLS):
(JSC::Wasm::useFastTLSForContext):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::PinnedRegisterInfo::get):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::useFastTLS): Deleted.
(JSC::Wasm::useFastTLSForWasmContext): Deleted.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):

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

4 years agoWebAssembly: fix misc JS API implementation inconsistencies
jfbastien@apple.com [Thu, 30 Mar 2017 07:16:27 +0000 (07:16 +0000)]
WebAssembly: fix misc JS API implementation inconsistencies
https://bugs.webkit.org/show_bug.cgi?id=170187

Reviewed by Keith Miller.

JSTests:

Verify that WebAssembly function are on the object's __proto__.

* wasm/js-api/Module-compile.js:
* wasm/js-api/validate.js:
* wasm/js-api/web-assembly-instantiate.js:

Source/JavaScriptCore:

Auto-generate lookup tables.
Methods should be on prototype.
Exception returns should be idiomatic.

* wasm/JSWebAssembly.cpp: validate / compile / instantiate should
be on the prototype
(JSC::JSWebAssembly::create):
(JSC::JSWebAssembly::finishCreation):
(JSC::reject): Deleted.
(JSC::webAssemblyCompileFunc): Deleted.
(JSC::resolve): Deleted.
(JSC::instantiate): Deleted.
(JSC::compileAndInstantiate): Deleted.
(JSC::webAssemblyInstantiateFunc): Deleted.
(JSC::webAssemblyValidateFunc): Deleted.
* wasm/JSWebAssembly.h:
* wasm/js/WebAssemblyMemoryPrototype.cpp: move from JSWebAssembly.cpp
(JSC::webAssemblyMemoryProtoFuncBuffer):
(JSC::WebAssemblyMemoryPrototype::create):
(JSC::WebAssemblyMemoryPrototype::finishCreation):
* wasm/js/WebAssemblyMemoryPrototype.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::reject):
(JSC::webAssemblyCompileFunc):
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
(JSC::webAssemblyFunctionValidate): Deleted.
(JSC::webAssemblyFunctionCompile): Deleted.
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::webAssemblyTableProtoFuncGrow):
(JSC::webAssemblyTableProtoFuncGet):
(JSC::webAssemblyTableProtoFuncSet):
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::finishCreation):
* wasm/js/WebAssemblyTablePrototype.h:

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

4 years agoREGRESSION(~r212322): LayoutTest media/track/track-cue-container-rendering-position...
pvollan@apple.com [Thu, 30 Mar 2017 06:35:31 +0000 (06:35 +0000)]
REGRESSION(~r212322): LayoutTest media/track/track-cue-container-rendering-position.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168660

Reviewed Eric Carlson.

The textTrackDisplayElement call will fail and throw an exception if the text track display element
has not yet been added to the text track container element. We wait until it has been added.

* media/track/track-cue-container-rendering-position.html:

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

4 years agoDisconnecting a HTMLObjectElement does not always unload its content document
rniwa@webkit.org [Thu, 30 Mar 2017 05:38:59 +0000 (05:38 +0000)]
Disconnecting a HTMLObjectElement does not always unload its content document
https://bugs.webkit.org/show_bug.cgi?id=169606

Reviewed by Andy Estes.

Source/WebCore:

When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
can update the style tree synchronously inside Document::setFocusedElement, and reload the document.

Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.

Test: fast/dom/removing-focused-object-element.html

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

LayoutTests:

Add a regression test.

* fast/dom/removing-focused-object-element-expected.txt: Added.
* fast/dom/removing-focused-object-element.html: Added.

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

4 years agoUnreviewed, fix the build, again. Hopefully for the last time, again!
keith_miller@apple.com [Thu, 30 Mar 2017 05:02:30 +0000 (05:02 +0000)]
Unreviewed, fix the build, again. Hopefully for the last time, again!

* runtime/Options.cpp:

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

4 years agoUnreviewed, fix the build, again. Hopefully for the last time!
keith_miller@apple.com [Thu, 30 Mar 2017 04:10:17 +0000 (04:10 +0000)]
Unreviewed, fix the build, again. Hopefully for the last time!

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

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

4 years agoMigrate to kCTFontCSSWidthAttribute
mmaxfield@apple.com [Thu, 30 Mar 2017 02:58:37 +0000 (02:58 +0000)]
Migrate to kCTFontCSSWidthAttribute
https://bugs.webkit.org/show_bug.cgi?id=170265

Reviewed by Darin Adler.

Previously, we were mapping from Core Text widths to CSS widths in WebKit.
However, on some OSes, Core Text can directly tell us what the CSS width
value is.

No new tests because there is no behavior change.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::getCSSAttribute):
(WebCore::capabilitiesForFontDescriptor):
* platform/spi/cocoa/CoreTextSPI.h:

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

4 years agoUnreviewed, windows build fix.
keith_miller@apple.com [Thu, 30 Mar 2017 02:58:15 +0000 (02:58 +0000)]
Unreviewed, windows build fix.

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

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

4 years agoWebAssembly: B3IRGenerator should pool constants
keith_miller@apple.com [Thu, 30 Mar 2017 02:39:51 +0000 (02:39 +0000)]
WebAssembly: B3IRGenerator should pool constants
https://bugs.webkit.org/show_bug.cgi?id=170266

Reviewed by Filip Pizlo.

This patch adds a HashMap to B3IRGenerator that contains all the constants used in a function.
B3IRGenerator then uses an InsertionSet to add all those constants to the root BB. This doesn't
appear to be a compile time improvement but it could be valuable in the future.

* b3/B3Opcode.h:
(JSC::B3::opcodeForConstant):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::addConstant):
* b3/B3Procedure.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::constant):
(JSC::Wasm::B3IRGenerator::insertConstants):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::B3IRGenerator::dump):
(JSC::Wasm::parseAndCompile):
(JSC::Wasm::B3IRGenerator::emitChecksForModOrDiv):
(JSC::Wasm::B3IRGenerator::zeroForType): Deleted.
* wasm/generateWasmB3IRGeneratorInlinesHeader.py:
(generateConstCode):

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

4 years agoVersioning.
jmarcell@apple.com [Thu, 30 Mar 2017 01:41:11 +0000 (01:41 +0000)]
Versioning.

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

4 years agoAdd some tests that dump the touch event regions with various content configurations
simon.fraser@apple.com [Thu, 30 Mar 2017 01:31:59 +0000 (01:31 +0000)]
Add some tests that dump the touch event regions with various content configurations
https://bugs.webkit.org/show_bug.cgi?id=170216

Reviewed by Dean Jackson.

Tests for touch event regions. Some of these are modeled after tests in tiled-drawing/scrolling/non-fast-region/.

* fast/events/touch/ios/touch-event-regions/resources/touch-regions-helper.js: Added.
* fast/events/touch/ios/touch-event-regions/active-passive-nesting-expected.html: Added.
* fast/events/touch/ios/touch-event-regions/active-passive-nesting.html: Added.
* fast/events/touch/ios/touch-event-regions/columns-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/columns.html: Added.
* fast/events/touch/ios/touch-event-regions/complex-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/complex.html: Added.
* fast/events/touch/ios/touch-event-regions/document-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/document.html: Added.
* fast/events/touch/ios/touch-event-regions/iframes-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/iframes.html: Added.
* fast/events/touch/ios/touch-event-regions/overflow-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/overflow.html: Added.
* fast/events/touch/ios/touch-event-regions/range-sliders-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/range-sliders.html: Added.

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

4 years agoMake it possible to dump touch event regions for testing
simon.fraser@apple.com [Thu, 30 Mar 2017 01:31:53 +0000 (01:31 +0000)]
Make it possible to dump touch event regions for testing
https://bugs.webkit.org/show_bug.cgi?id=170209
<rdar://problem/31309258>

Reviewed by Tim Horton.

Source/WebCore:

Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
fetch data via Page.

Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().

Test: fast/events/touch/ios/touch-event-regions.html

* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects):
(WebCore::Page::touchEventRectsForEvent):
(WebCore::Page::passiveTouchEventListenerRects):
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::touchEventRectsForEvent):
(WebCore::Internals::passiveTouchEventListenerRects):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Simple test that dumps the regions.

* fast/events/touch/ios/touch-event-regions-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions.html: Added.

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

4 years agoRenderBlockFlow::addFloatsToNewParent should check if float is already added to the...
zalan@apple.com [Thu, 30 Mar 2017 01:25:00 +0000 (01:25 +0000)]
RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
https://bugs.webkit.org/show_bug.cgi?id=170259
<rdar://problem/31300584>

Reviewed by Simon Fraser.

Source/WebCore:

r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.

Test: fast/block/float/placing-multiple-floats-crash.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addFloatsToNewParent):

LayoutTests:

* fast/block/float/placing-multiple-floats-crash-expected.txt: Added.
* fast/block/float/placing-multiple-floats-crash.html: Added.

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

4 years agoWeb Inspector: WebSockets: Messages log should remain being scrolled to the bottom...
nvasilyev@apple.com [Thu, 30 Mar 2017 01:06:31 +0000 (01:06 +0000)]
Web Inspector: WebSockets: Messages log should remain being scrolled to the bottom when a new message is added
https://bugs.webkit.org/show_bug.cgi?id=170090

Reviewed by Matt Baker.

Adding many Web Socket messages quickly can create a performance bottleneck. Batch addition of DataGrid nodes
using requestAnimationFrame, and scroll to the bottom of the DataGrid at most once per a batch update.

* UserInterface/Views/WebSocketContentView.js:
(WebInspector.WebSocketContentView):
(WebInspector.WebSocketContentView.prototype.shown):
(WebInspector.WebSocketContentView.prototype.hidden):
(WebInspector.WebSocketContentView.prototype._updateFramesSoon):
Batch WebSocketContentView DOM modifications using requestAnimationFrame.

(WebInspector.WebSocketContentView.prototype._updateFrames):
(WebInspector.WebSocketContentView.prototype._addFrame):
(WebInspector.WebSocketContentView.prototype.addFrame): Deleted.
Make addFrame method private since it isn't used anywhere outside of this class.

(WebInspector.WebSocketContentView.prototype._updateState): Deleted.
Make _updateState a part of _updateFramesSoon.

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

4 years agoSwipe gesture tests don't work on macOS Sierra
timothy_horton@apple.com [Thu, 30 Mar 2017 01:05:58 +0000 (01:05 +0000)]
Swipe gesture tests don't work on macOS Sierra
https://bugs.webkit.org/show_bug.cgi?id=161675
<rdar://problem/23379930>

Reviewed by Darin Adler.

Tools:

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::platformPlayBackEventStream):
(WTR::UIScriptController::beginBackSwipe):
(WTR::UIScriptController::completeBackSwipe):
* TestRunnerShared/EventSerialization/mac/EventSerializerMac.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
* TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm: Added.
(eventIsOfType):
(eventIsOfTypes):
(eventIsOfGestureType):
(eventIsOfGestureTypes):
(+[EventSerializer dictionaryForEvent:relativeToTime:]):
(+[EventSerializer createEventForDictionary:inWindow:relativeToTime:]):
(+[EventSerializer playEventStream:inWindow:completionHandler:]):
* TestRunnerShared/EventSerialization/mac/SharedEventStreamsMac.h: Copied from Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm.
* TestRunnerShared/EventSerialization/mac/SharedEventStreamsMac.mm: Added.
(beginSwipeBackEventStream):
(completeSwipeBackEventStream):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::playBackEventStream):
(WTR::UIScriptController::beginBackSwipe):
(WTR::UIScriptController::completeBackSwipe):
(WTR::UIScriptController::platformPlayBackEventStream):
(WTR::UIScriptController::platformClearAllCallbacks): Deleted.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* TestRunnerShared/spi/CoreGraphicsSPI.h: Added.
* TestRunnerShared/spi/IOKitSPI.h: Renamed from Tools/WebKitTestRunner/ios/IOKitSPI.h.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::playBackEvents):
(WTR::UIScriptController::beginBackSwipe):
(WTR::UIScriptController::completeBackSwipe):
(WTR::UIScriptController::platformPlayBackEventStream):

LayoutTests:

* platform/mac-wk2/TestExpectations:
* swipe/basic-cached-back-swipe-expected.txt:
* swipe/basic-cached-back-swipe.html:
* swipe/main-frame-pinning-requirement-expected.txt:
* swipe/main-frame-pinning-requirement.html:
* swipe/pushState-cached-back-swipe-expected.txt:
* swipe/pushState-cached-back-swipe.html:
* swipe/pushState-programmatic-back-while-swiping-crash-expected.txt:
* swipe/pushState-programmatic-back-while-swiping-crash.html:
* swipe/resources/swipe-test.js:
(measuredDurationShouldBeLessThan):
(startSwipeGesture):
(completeSwipeGesture):
(playEventStream):
(eventQueue.enqueueScrollEvent): Deleted.
(eventQueue.enqueueSwipeEvent): Deleted.
(eventQueue.hasPendingEvents): Deleted.
(eventQueue.callAfterEventDispatch): Deleted.
(eventQueue._processEventQueue): Deleted.
(eventQueue._processEventQueueSoon): Deleted.
* swipe/swipe-start-hysteresis-failures-expected.txt: Removed.
* swipe/swipe-start-hysteresis-failures.html: Removed.

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

4 years agoTry to normalize variation ranges
mmaxfield@apple.com [Thu, 30 Mar 2017 00:37:36 +0000 (00:37 +0000)]
Try to normalize variation ranges
https://bugs.webkit.org/show_bug.cgi?id=170119

Unreviewed.

Addressing post-review comment.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isGXVariableFont):

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

4 years agoTry to normalize variation ranges
mmaxfield@apple.com [Wed, 29 Mar 2017 23:12:08 +0000 (23:12 +0000)]
Try to normalize variation ranges
https://bugs.webkit.org/show_bug.cgi?id=170119

Reviewed by Simon Fraser.

Source/WebCore:

TrueType GX-style variation fonts use one particular scale for values on their
weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
For the purposes of font selection, these values need to lie on the same scale.
However, when font selection is completed and the variation values are actually
being applied to the fonts, values which lie on the font's actual scale need to
be applied. This patch adds normalize*() and denormalize*() functions to perform
both of these operations.

The conversion itself between the two scales isn't an exact mapping. Mapping
slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
linear relationship which includes the values given in the Microsoft OpenType
spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
plotted the CSS weights and the GX-style weights for every style of San
Francisco, saw that the relationship appears to be linear, and ran a linear
regression to compute the line equation.

As for the actual discrimination of determining whether a font is a GX-style
font or not, we can use the presence of the 'STAT' table. This table didn't
exist when GX fonts were being created, and OpenType 1.8 variable fonts are
required to have this table.

Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
a variation font, but uses the GX-style values. Facebook asks us to create
this font with a weight of 700, and because the values in the font are around
1.0, we were erroneously thinking that the font wasn't bold, so we were then
applying synthetic bold. This was causing text on facebook to look fuzzy and
ugly.

Test: fast/text/variations/font-selection-properties-expected.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isGXVariableFont):
(WebCore::normalizeWeight):
(WebCore::normalizeSlope):
(WebCore::denormalizeWeight):
(WebCore::denormalizeWidth):
(WebCore::denormalizeSlope):
(WebCore::normalizeWidth):
(WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
intermediate values, we should use floats instead. This is because
FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
When using this data type to represent values on the GX scale, which are usually
between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
calculations should be done with floats, and converted to FontSelectionValues at
the end when they are representative of values on the CSS scale.
(WebCore::stretchFromCoreTextTraits):
(WebCore::fontWeightFromCoreText):
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::capabilitiesForFontDescriptor):

LayoutTests:

* fast/text/variations/font-selection-properties-expected.html:

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

4 years agoLinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
sbarati@apple.com [Wed, 29 Mar 2017 22:55:53 +0000 (22:55 +0000)]
LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
https://bugs.webkit.org/show_bug.cgi?id=170210

Reviewed by Mark Lam.

Source/JavaScriptCore:

This is one more step in the direction of PIC-ified Wasm.
LinkBuffer and ExecutableAllocator have no business knowing about VM.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::allocate):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::LinkBuffer):
(JSC::LinkBuffer::vm): Deleted.
* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/B3Compile.h:
* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::compileProc):
(JSC::B3::compileAndRun):
(JSC::B3::testLoadAcq42):
(JSC::B3::testAddArgZeroImmZDef):
(JSC::B3::testAddLoadTwice):
(JSC::B3::testMulLoadTwice):
(JSC::B3::testMulAddArgsLeft):
(JSC::B3::testMulAddArgsRight):
(JSC::B3::testMulAddArgsLeft32):
(JSC::B3::testMulAddArgsRight32):
(JSC::B3::testMulSubArgsLeft):
(JSC::B3::testMulSubArgsRight):
(JSC::B3::testMulSubArgsLeft32):
(JSC::B3::testMulSubArgsRight32):
(JSC::B3::testMulNegArgs):
(JSC::B3::testMulNegArgs32):
(JSC::B3::testCompareFloatToDoubleThroughPhi):
(JSC::B3::testDoubleToFloatThroughPhi):
(JSC::B3::testReduceFloatToDoubleValidates):
(JSC::B3::testDoubleProducerPhiToFloatConversion):
(JSC::B3::testDoubleProducerPhiToFloatConversionWithDoubleConsumer):
(JSC::B3::testDoubleProducerPhiWithNonFloatConst):
(JSC::B3::testIToD64Arg):
(JSC::B3::testIToF64Arg):
(JSC::B3::testIToD32Arg):
(JSC::B3::testIToF32Arg):
(JSC::B3::testIToD64Mem):
(JSC::B3::testIToF64Mem):
(JSC::B3::testIToD32Mem):
(JSC::B3::testIToF32Mem):
(JSC::B3::testIToDReducedToIToF64Arg):
(JSC::B3::testIToDReducedToIToF32Arg):
(JSC::B3::testStoreRelAddLoadAcq32):
(JSC::B3::testStoreRelAddLoadAcq8):
(JSC::B3::testStoreRelAddFenceLoadAcq8):
(JSC::B3::testStoreRelAddLoadAcq16):
(JSC::B3::testStoreRelAddLoadAcq64):
(JSC::B3::testBranch):
(JSC::B3::testBranchPtr):
(JSC::B3::testDiamond):
(JSC::B3::testBranchNotEqual):
(JSC::B3::testBranchNotEqualCommute):
(JSC::B3::testBranchNotEqualNotEqual):
(JSC::B3::testBranchEqual):
(JSC::B3::testBranchEqualEqual):
(JSC::B3::testBranchEqualCommute):
(JSC::B3::testBranchEqualEqual1):
(JSC::B3::testBranchLoadPtr):
(JSC::B3::testBranchLoad32):
(JSC::B3::testBranchLoad8S):
(JSC::B3::testBranchLoad8Z):
(JSC::B3::testBranchLoad16S):
(JSC::B3::testBranchLoad16Z):
(JSC::B3::testBranch8WithLoad8ZIndex):
(JSC::B3::testComplex):
(JSC::B3::testSimpleCheck):
(JSC::B3::testCheckFalse):
(JSC::B3::testCheckTrue):
(JSC::B3::testCheckLessThan):
(JSC::B3::testCheckMegaCombo):
(JSC::B3::testCheckTrickyMegaCombo):
(JSC::B3::testCheckTwoMegaCombos):
(JSC::B3::testCheckTwoNonRedundantMegaCombos):
(JSC::B3::testCheckAddImm):
(JSC::B3::testCheckAddImmCommute):
(JSC::B3::testCheckAddImmSomeRegister):
(JSC::B3::testCheckAdd):
(JSC::B3::testCheckAdd64):
(JSC::B3::testCheckAddFold):
(JSC::B3::testCheckAddFoldFail):
(JSC::B3::testCheckAddSelfOverflow64):
(JSC::B3::testCheckAddSelfOverflow32):
(JSC::B3::testCheckSubImm):
(JSC::B3::testCheckSubBadImm):
(JSC::B3::testCheckSub):
(JSC::B3::testCheckSub64):
(JSC::B3::testCheckSubFold):
(JSC::B3::testCheckSubFoldFail):
(JSC::B3::testCheckNeg):
(JSC::B3::testCheckNeg64):
(JSC::B3::testCheckMul):
(JSC::B3::testCheckMulMemory):
(JSC::B3::testCheckMul2):
(JSC::B3::testCheckMul64):
(JSC::B3::testCheckMulFold):
(JSC::B3::testCheckMulFoldFail):
(JSC::B3::testCheckMul64SShr):
(JSC::B3::testSwitch):
(JSC::B3::testSwitchChillDiv):
(JSC::B3::testSwitchTargettingSameBlock):
(JSC::B3::testSwitchTargettingSameBlockFoldPathConstant):
(JSC::B3::testBasicSelect):
(JSC::B3::testSelectTest):
(JSC::B3::testSelectCompareDouble):
(JSC::B3::testSelectDouble):
(JSC::B3::testSelectDoubleTest):
(JSC::B3::testSelectDoubleCompareDouble):
(JSC::B3::testSelectFloatCompareFloat):
(JSC::B3::testSelectFold):
(JSC::B3::testSelectInvert):
(JSC::B3::testCheckSelect):
(JSC::B3::testCheckSelectCheckSelect):
(JSC::B3::testCheckSelectAndCSE):
(JSC::B3::testTrivialInfiniteLoop):
(JSC::B3::testFoldPathEqual):
(JSC::B3::testLShiftSelf32):
(JSC::B3::testRShiftSelf32):
(JSC::B3::testURShiftSelf32):
(JSC::B3::testLShiftSelf64):
(JSC::B3::testRShiftSelf64):
(JSC::B3::testURShiftSelf64):
(JSC::B3::testPatchpointDoubleRegs):
(JSC::B3::testSpillDefSmallerThanUse):
(JSC::B3::testSpillUseLargerThanDef):
(JSC::B3::testLateRegister):
(JSC::B3::testInterpreter):
(JSC::B3::testEntrySwitchSimple):
(JSC::B3::testEntrySwitchNoEntrySwitch):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
(JSC::B3::testEntrySwitchLoop):
(JSC::B3::testSomeEarlyRegister):
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled):
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled2):
(JSC::B3::testPatchpointTerminalReturnValue):
(JSC::B3::testMemoryFence):
(JSC::B3::testStoreFence):
(JSC::B3::testLoadFence):
(JSC::B3::testPCOriginMapDoesntInsertNops):
(JSC::B3::testPinRegisters):
(JSC::B3::testX86LeaAddAddShlLeft):
(JSC::B3::testX86LeaAddAddShlRight):
(JSC::B3::testX86LeaAddAdd):
(JSC::B3::testX86LeaAddShlRight):
(JSC::B3::testX86LeaAddShlLeftScale1):
(JSC::B3::testX86LeaAddShlLeftScale2):
(JSC::B3::testX86LeaAddShlLeftScale4):
(JSC::B3::testX86LeaAddShlLeftScale8):
(JSC::B3::testAddShl32):
(JSC::B3::testAddShl64):
(JSC::B3::testAddShl65):
(JSC::B3::testLoadBaseIndexShift2):
(JSC::B3::testLoadBaseIndexShift32):
(JSC::B3::testOptimizeMaterialization):
(JSC::B3::testAtomicWeakCAS):
(JSC::B3::testAtomicStrongCAS):
(JSC::B3::testAtomicXchg):
(JSC::B3::testDepend32):
(JSC::B3::testDepend64):
(JSC::B3::testWasmBoundsCheck):
(JSC::B3::testWasmAddress):
(JSC::B3::run):
(JSC::B3::compile): Deleted.
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::emit):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* ftl/FTLOSRExitHandle.cpp:
(JSC::FTL::OSRExitHandle::emitExitThunk):
* ftl/FTLSlowPathCall.cpp:
(JSC::FTL::SlowPathCallContext::makeCall):
* ftl/FTLSlowPathCall.h:
(JSC::FTL::callOperation):
* ftl/FTLState.h:
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* ftl/FTLThunks.h:
(JSC::FTL::generateIfNecessary):
(JSC::FTL::Thunks::getSlowPathCallThunk):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitDumbVirtualCall):
* jit/AssemblyHelpers.h:
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::initializeAllocator):
(JSC::ExecutableAllocator::singleton):
(JSC::ExecutableAllocator::ExecutableAllocator):
(JSC::ExecutableAllocator::allocate):
* jit/ExecutableAllocator.h:
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/JITCall.cpp:
(JSC::JIT::compileCallEvalSlowCase):
* jit/JITMathIC.h:
(JSC::JITMathIC::generateOutOfLine):
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/JITStubRoutine.h:
* jit/Repatch.cpp:
(JSC::ftlThunkAwareRepatchCall):
(JSC::linkPolymorphicCall):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
(JSC::throwExceptionFromWasmThunkGenerator):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::takeSample):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* runtime/VMTraps.cpp:
(JSC::VMTraps::tryInstallTrapBreakpoints):
* tools/VMInspector.cpp:
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
(JSC::Wasm::wasmToWasm):
(JSC::Wasm::exitStubGenerator):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::complete):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::compile):
(JSC::Yarr::jitCompile):

Source/WebCore:

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::compileSelector):
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

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

4 years agoMark http/tests/media/modern-media-controls/time-labels-support/long-time.html as...
ryanhaddad@apple.com [Wed, 29 Mar 2017 22:46:34 +0000 (22:46 +0000)]
Mark http/tests/media/modern-media-controls/time-labels-support/long-time.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=169677

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

4 years agowebkitpy: Robust test clean-up
jbedard@apple.com [Wed, 29 Mar 2017 22:44:42 +0000 (22:44 +0000)]
webkitpy: Robust test clean-up
https://bugs.webkit.org/show_bug.cgi?id=170255

Reviewed by Alexey Proskuryakov.

On-device testing is the motivation for this change.  Failure to run clean-up functions can
result in zombie processes, residual NFS mounts and other undesirable remnants from a failed
test run.  Make an effort to clean-up even if exceptions are thrown during set-up or clean-up.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run): Clean up test run if set-up fails.
* Scripts/webkitpy/port/ios.py:
(IOSPort.clean_up_test_run): Continue cleaning up devices even after an exception is thrown.

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

4 years agoRemove unused PageClient::removeNavigationGestureSnapshot
timothy_horton@apple.com [Wed, 29 Mar 2017 22:44:13 +0000 (22:44 +0000)]
Remove unused PageClient::removeNavigationGestureSnapshot
https://bugs.webkit.org/show_bug.cgi?id=170249

Reviewed by Beth Dakin.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.

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

4 years agoWebAssembly: Worklist should periodically check in to see if there are higher priorit...
keith_miller@apple.com [Wed, 29 Mar 2017 22:12:25 +0000 (22:12 +0000)]
WebAssembly: Worklist should periodically check in to see if there are higher priority jobs to do.
https://bugs.webkit.org/show_bug.cgi?id=170204

Reviewed by Saam Barati.

This patch makes it so that Wasm::Plan's compileFunctions method can return periodically
to its caller. The main use for this is if a user asynchronously compiles a wasm module
then later synchronously compiles another module. In this case we want to be able to pause
compilation of other worklists.

This patch also adds support for size_t Options.

* runtime/Options.cpp:
(JSC::parse):
(JSC::Option::dump):
(JSC::Option::operator==):
* runtime/Options.h:
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::moveToState):
(JSC::Wasm::Plan::ThreadCountHolder::~ThreadCountHolder):
(JSC::Wasm::Plan::compileFunctions):
* wasm/WasmPlan.h:
* wasm/WasmWorklist.cpp:

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

4 years agoSimulator testing stops after the first crash
jbedard@apple.com [Wed, 29 Mar 2017 22:10:25 +0000 (22:10 +0000)]
Simulator testing stops after the first crash
<rdar://problem/31325362>

Unreviewed infrastructure fix.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice):
(SimulatedDevice.launch_app): Increase timeout when attempting to launch app.

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

4 years ago[css-align] Adapt self-alignment properties to the new baseline syntax
jfernandez@igalia.com [Wed, 29 Mar 2017 22:01:11 +0000 (22:01 +0000)]
[css-align] Adapt self-alignment properties to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170235

Reviewed by David Hyatt.

Source/WebCore:

The baseline-position syntax has changed recently, so we need to update
the CSS properties using the old syntax. This patch address only the
self-alignment (align-self and justify-self) and default-alignment
(align-items and justify-items).

The content-distribution properties (align-content and justify-content)
will be updated in a follow up patch.

The new baseline syntax is "[first | last ]? baseline" which implies
modifying the parsing and computed value logic.

There are several layout tests affected by this change, so I'll update
them accordingly.

No new tests, just added/modified some cases to the tests we already have using the new baseline values.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBaselineKeyword):
(WebCore::consumeSelfPositionOverflowPosition):

LayoutTests:

Added new cases to the alignment properties parsing tests so that we can verify the new
baseline-alignment syntax is parsed as expected.
Additionally, I modified the tests so that they use the testharness format.

* css3/parse-align-items-expected.txt:
* css3/parse-align-items.html:
* css3/parse-align-self-expected.txt:
* css3/parse-align-self.html:
* css3/resources/alignment-parsing-utils-th.js:
(checkValues):
* fast/css/parse-justify-items-expected.txt:
* fast/css/parse-justify-items.html:
* fast/css/parse-justify-self-expected.txt:
* fast/css/parse-justify-self.html:
* fast/css/resources/alignment-parsing-utils-th.js: Copied from LayoutTests/css3/resources/alignment-parsing-utils-th.js.
(checkValues):
(checkBadValues):
(checkInitialValues):
(checkInheritValues):
(checkLegacyValues):
(checkSupportedValues):

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

4 years agoAnother build fix after r214502.
rniwa@webkit.org [Wed, 29 Mar 2017 21:58:40 +0000 (21:58 +0000)]
Another build fix after r214502.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer.prototype.render): this._groupToCellMap.get may not contain the cell when startPoint
or metric had not been fetched yet even if currentTestGroup is set.

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

4 years agoBuild fix after r214502. Analysis tasks without any test groups are throwing exceptions.
rniwa@webkit.org [Wed, 29 Mar 2017 21:26:20 +0000 (21:26 +0000)]
Build fix after r214502. Analysis tasks without any test groups are throwing exceptions.

* public/v3/components/results-table.js:
(ResultsTable.prototype.renderTable): Don't show the header row when there are no content to show.
(ResultsTable.prototype._computeRepositoryList): Return a pair of arrays. The caller expects the repository
list to be an array, not undefined.

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

4 years agoAnimated SVG images are not paused in pages loaded in the background
cdumez@apple.com [Wed, 29 Mar 2017 20:54:21 +0000 (20:54 +0000)]
Animated SVG images are not paused in pages loaded in the background
https://bugs.webkit.org/show_bug.cgi?id=170043
<rdar://problem/31234412>

Reviewed by Simon Fraser.

Source/WebCore:

Animated SVG images are not paused in pages loaded in the background. We rely
on FrameView::isOffscreen() to stop images animations in background tab (See
logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
if a tab is visble and then becomes hidden (i.e. by switching to another
tab). However, in the case where the tab gets loaded while in the background
(e.g. opening link in new background tab, or session restore), then the
animations would not be paused, due to FrameView::isOffscreen() erroneously
returning false in this case.

Normally, the following chain of events happens:
- Page is visible, we construct a main frame and its FrameView for loading
  the page. When a FrameView is constructed, we call FrameView::show() to
  make it visible. Then, if the page becomes non-visible, we call
  Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
  that, FrameView::isOffscreen() correctly returns true because we properly
  called FrameView::hide().

However, when doing a load while the Page is hidden, the following was
happening:
- Page is not visible, we call Page::setIsVisibleInternal(false) which tries
  to call FrameView::hide() for the main frame but it does not have a FrameView
  yet (because the load has not started). We start the load and end up creating
  a FrameView. The FrameView constructor was calling FrameView::show()
  unconditionally, thus making the FrameView think is visible, even though its
  page isn't. At this point, FrameView::isOffscreen() was returning false
  and animations would keep running, even though the page is not visible.

To address the issue, we now call FrameView::show() in FrameView::create() only
if the Page is actually visible, instead of calling it unconditionally. If the
page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
it will take care of calling FrameView::show() then.

Tests: svg/animations/animations-paused-in-background-page-iframe.html
       svg/animations/animations-paused-in-background-page.html

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

LayoutTests:

Extend layout test coverage.

* svg/animations/animations-paused-in-background-page-expected.txt: Added.
* svg/animations/animations-paused-in-background-page-iframe-expected.txt: Added.
* svg/animations/animations-paused-in-background-page-iframe.html: Added.
* svg/animations/animations-paused-in-background-page.html: Added.
* svg/animations/resources/iframe-with-animated-svg-image.html: Added.

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

4 years agoRemove obsolete references to HeapTimer in JavaScriptCore.order.
mark.lam@apple.com [Wed, 29 Mar 2017 20:38:54 +0000 (20:38 +0000)]
Remove obsolete references to HeapTimer in JavaScriptCore.order.
https://bugs.webkit.org/show_bug.cgi?id=170252

Reviewed by Saam Barati.

The HeapTimer was renamed to JSRunLoopTimer back in r214504.  These HeapTimer
entries are now no longer meaningful.

* JavaScriptCore.order:

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

4 years agoIncrement the last stable network cache version on Mac
antti@apple.com [Wed, 29 Mar 2017 20:11:26 +0000 (20:11 +0000)]
Increment the last stable network cache version on Mac
https://bugs.webkit.org/show_bug.cgi?id=170248
<rdar://problem/31326040>

Reviewed by Chris Dumez.

Bump to the latest release.

* NetworkProcess/cache/NetworkCacheStorage.h:

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

4 years agowebkitpy: Standardize web-server port definitions
jbedard@apple.com [Wed, 29 Mar 2017 20:07:42 +0000 (20:07 +0000)]
webkitpy: Standardize web-server port definitions
https://bugs.webkit.org/show_bug.cgi?id=170144
<rdar://problem/31284026>

Reviewed by Daniel Bates.

Default web-server ports should be declared in global variables.
Add functions to web-servers which return the ports these servers
are using so that other tools can forward them.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__): Use shared constants in http_server_base.py.
* Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py:
(TestLayoutTestApacheHttpd.test_start_cmd): Check port_to_forward for expected values.
* Scripts/webkitpy/layout_tests/servers/http_server.py:
(Lighttpd.__init__): Use shared constants in http_server_base.py.
(Lighttpd._prepare_config): Ditto.
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
(HttpServerBase): Add default port constants.
(HttpServerBase.ports_to_forward): Add function to return ports used for http server.
* Scripts/webkitpy/layout_tests/servers/http_server_unittest.py:
(TestHttpServer.test_start_cmd): Check port_to_forward for expected values.
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
 (WebPlatformTestServer.ports_to_forward): Add function to return ports used for web-platform tests.
* Scripts/webkitpy/layout_tests/servers/websocket_server.py:
(PyWebSocket): Make default port values public.
(PyWebSocket.__init__): Use public default port.
(PyWebSocket.ports_to_forward): Return port used in an array.
* Scripts/webkitpy/port/base.py:
(Port.to.ports_to_forward): Return all ports used the various web-servers managed by the port object.
(Port.to.start_websocket_server): Use PyWebSocket port constants.

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

4 years ago[Arabic text] Add whitespace preserve/word wrap performance test.
zalan@apple.com [Wed, 29 Mar 2017 19:31:35 +0000 (19:31 +0000)]
[Arabic text] Add whitespace preserve/word wrap performance test.
https://bugs.webkit.org/show_bug.cgi?id=170243

Reviewed by Simon Fraser.

* Layout/ArabicLineLayout-pre-and-wrap.html: Added.

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

4 years agoLinks with empty hrefs should not be drag sources
wenson_hsieh@apple.com [Wed, 29 Mar 2017 19:29:25 +0000 (19:29 +0000)]
Links with empty hrefs should not be drag sources
https://bugs.webkit.org/show_bug.cgi?id=170241
<rdar://problem/31305505>

Reviewed by Tim Horton.

Source/WebCore:

The m_dragSouceAction member of DragController represents the drag source actions that are available to the
document, rather than the available actions given the dragging element. Thus, it is not correct to only check
that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
element.

New API test (see Tools/ChangeLog).

* page/DragController.cpp:
(WebCore::DragController::startDrag):

Tools:

Adds a new API test: DataInteractionTests.LinkWithEmptyHREF.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:

Expose the current phase of the data interaction simulator for verifying behaviors in unit tests.

* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator phase]):

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

4 years agoPost-commit test gardening after r214546
mmaxfield@apple.com [Wed, 29 Mar 2017 19:25:39 +0000 (19:25 +0000)]
Post-commit test gardening after r214546
https://bugs.webkit.org/show_bug.cgi?id=169518

Unreviewed.

* platform/mac-elcapitan/fast/text/font-selection-font-loading-api-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:

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

4 years agoWebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the...
commit-queue@webkit.org [Wed, 29 Mar 2017 19:25:22 +0000 (19:25 +0000)]
WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
https://bugs.webkit.org/show_bug.cgi?id=170129

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-03-29
Reviewed by David Kilzer.

No new tests becuase no new behavior.

Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):

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

4 years agoUse TCP instead of FIFOs for Simulator/Device communication
jbedard@apple.com [Wed, 29 Mar 2017 19:23:32 +0000 (19:23 +0000)]
Use TCP instead of FIFOs for Simulator/Device communication
https://bugs.webkit.org/show_bug.cgi?id=169419
<rdar://problem/30949615>

Reviewed by Alexey Proskuryakov.

Using TCP instead of FIFOs when communicating with devices allows the device being tested
to be on a different machine then the one handling the management of the test run.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree): Call setUp/tearDownIOSLayoutTestCommunication() instead of using FIFOs.
* Scripts/webkitpy/port/device.py:
(Device.__init__): Initialize the listening_socket.
(Device.listening_port): Return port of listening socket.
(Device.prepare_for_testing): Open listening socket on an open port, prepare platform device
fro testing.
(Device.finished_testing): Close listening socket associated with this device, call the
platform device's finished_testing function if it exists.
* Scripts/webkitpy/port/ios.py:
(IOSPort.setup_test_run): Prepare each device for testing.
(IOSPort.clean_up_test_run): Notify each device that testing has completed.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort): Work around device persistence bug.
(IOSSimulatorPort.__init__): Ditto.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess):
(SimulatorProcess.NonBlockingFileFromSocket): Add to work around shortcomings in
Python 2’s makefile.
(SimulatorProcess.NonBlockingFileFromSocket.__init__): Initialize file with socket.
(SimulatorProcess.ReadFileSocket.close): Close file and then socket;
(SimulatorProcess.__init__): Pass TCP port over environment, remove FIFO names.
(SimulatorProcess.__getattr__): Expose all file attributes.
(SimulatorProcess._accept_connection_create_file): Wait for connection from server and
create and return a file-like object from the incoming connection.
(SimulatorProcess._start): Use TCP connections instead of FIFOs.
(SimulatorProcess._start.handler): Output server port in timeout exception.
(SimulatorProcess._reset): Deleted.
* TestRunnerShared/IOSLayoutTestCommunication.cpp: Added.
(connectToServer): Return socket connected to the provided server address.
(setupiOSLayoutTestCommunication): Connect stdin, stdout and stderr as socket to a
TCP server running on localhost.
(tearDownIOSLayoutTestCommunication): Close stdin, stdout and stderr TCP sockets.
* TestRunnerShared/IOSLayoutTestCommunication.h: Added.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformInitialize): Call setUpIOSLayoutTestCommunication()
instead of using FIFOs.
(WTR::TestController::platformDestroy): Call tearDownIOSLayoutTestCommunication().

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

4 years agoPost-commit test gardening after r214546
mmaxfield@apple.com [Wed, 29 Mar 2017 19:23:21 +0000 (19:23 +0000)]
Post-commit test gardening after r214546
https://bugs.webkit.org/show_bug.cgi?id=169518

Unreviewed.

* platform/mac-elcapitan/fast/text/font-selection-font-loading-api-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:

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

4 years agoWeb Inspector: Network tab content view is blank after reload
commit-queue@webkit.org [Wed, 29 Mar 2017 18:57:52 +0000 (18:57 +0000)]
Web Inspector: Network tab content view is blank after reload
https://bugs.webkit.org/show_bug.cgi?id=168029

Patch by Sam Brodkin <isam@apple.com> on 2017-03-29
Reviewed by Brian Burg.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset):
showDefaultContentView() which shows networkGridView in the contentView was not being called
when the NetworkSidebarPanel was not visible. Removing the if statement always shows the
networkGridView which fixes the bug. This wouldn't be easy to regression test.

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

4 years ago[GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
zandobersek@gmail.com [Wed, 29 Mar 2017 18:44:57 +0000 (18:44 +0000)]
[GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
https://bugs.webkit.org/show_bug.cgi?id=170238

Reviewed by Michael Catanzaro.

Source/WebCore:

The platform-specific CryptoAlgorithmHMAC implementation is modified
to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
is added accordingly.

* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):

Source/WebCore/PAL:

Add a GCrypt-specific Handle<> template class, inside the GCrypt namespace.
Objects of this class should be used as 'smart handles', cleaning up upon
destruction the GCrypt object that's represented by the handle they manage.

This mimics the std::unique_ptr<> idea, but is narrowly focused towards
how such handles are used in the libgcrypt API. A GCrypt::Handle<> object
can be consturcted from an existing handle or with the default null value.
It can be cleared upon request via clear(), and the managed handle can be
released via release().

The address of the managed handle can be retrieved through the address-of
operator. An implicit conversion operator is also added. This allows
frictionless use of GCrypt::Handle<> objects with existing libgcrypt APIs.

The negation operator is implemented to support testing the nullness of
the managed handle. The raw handle value is also retrieveable through
the handle() method.

The copy and move constructors and assignment operators are deleted.
They are not at the moment required anywhere in the work-in-progress
implementation of subtle crypto functionality.

As with other resource management classes, upon destruction, the
GCrypt::Handle<> object destroys the resource it manages. This is done
through objects of the HandleDeleter<> template class. Specializations
of this class have to implement the call operator that properly
releases the resource. Because the operator is deleted by default,
a compilation error will be thrown when deleting a resource of some
type for which the proper HandleDeleter specialization isn't provided.

std::unique_ptr<> could be used, but it could also be mis-used. I find
a mini-class with an interface that's specific to libgcrypt API
interactions to be preferrable to a std::unique_ptr<> with a custom
deleter.

* pal/crypto/gcrypt/Handle.h: Added.
(PAL::GCrypt::Handle::Handle):
(PAL::GCrypt::Handle::~Handle):
(PAL::GCrypt::Handle::clear):
(PAL::GCrypt::Handle::release):
(PAL::GCrypt::Handle::operator&):
(PAL::GCrypt::Handle::handle):
(PAL::GCrypt::Handle::operator T):
(PAL::GCrypt::Handle::operator!):
(PAL::GCrypt::HandleDeleter<gcry_mac_hd_t>::operator()):

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

4 years agoMark fast/events/before-unload-adopt-subframe-to-outside.html as flaky.
ryanhaddad@apple.com [Wed, 29 Mar 2017 18:38:10 +0000 (18:38 +0000)]
Mark fast/events/before-unload-adopt-subframe-to-outside.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170130

Unreviewed test gardening.

* TestExpectations:

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

4 years agoWebAssembly: add shell-only Memory mode helper
jfbastien@apple.com [Wed, 29 Mar 2017 17:44:59 +0000 (17:44 +0000)]
WebAssembly: add shell-only Memory mode helper
https://bugs.webkit.org/show_bug.cgi?id=170227

Reviewed by Mark Lam.

JSTests:

* wasm/assert.js: fix a prior debug thing I forgot to remove
* wasm/function-tests/memory-section-and-import.js: the assert
issue was hiding a failure in error message here
* wasm/js-api/element.js: the assert issue was hiding a failure in
error message here
(badInstantiation.test):
(badInstantiation):
* wasm/js-api/extension-MemoryMode.js: Added.
(const.validateMode.what.switch):
(testMemoryNoMax):
(testMemory):
(testInstanceNoMemory):
(testInstanceNoMax):
(testInstance):
* wasm/js-api/test_memory.js: the assert issue was hiding a
failure in error message here
(test):

Source/JavaScriptCore:

* jsc.cpp:
(GlobalObject::finishCreation):
(functionWebAssemblyMemoryMode):
* wasm/WasmMemory.h:
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyMemory.h:

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

4 years agoVariation fonts: Make sure that feature detection and preprocessor macros are right
mmaxfield@apple.com [Wed, 29 Mar 2017 17:40:21 +0000 (17:40 +0000)]
Variation fonts: Make sure that feature detection and preprocessor macros are right
https://bugs.webkit.org/show_bug.cgi?id=169518

Reviewed by Simon Fraser.

Source/WebCore:

When I added variable fonts support, I made all OSes parse the newly accepted values,
instead of just the OSes which support variable fonts.

Test: fast/text/font-variations-feature-detection.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontStretch):
(WebCore::consumeFontStyle):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::divisibleBy100):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):

LayoutTests:

Create platform-specific results for mac-elcapitan which doesn't support variation fonts.

* fast/text/font-variations-feature-detection-expected.html: Added.
* fast/text/font-variations-feature-detection.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-selection-font-loading-api-parse-expected.txt: Added.
* platform/mac-elcapitan/fast/text/font-stretch-parse-expected.txt: Added.
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt: Added.
* platform/mac-elcapitan/fast/text/font-weight-parse-expected.txt: Added.
* platform/mac/TestExpectations:

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

4 years ago[Modern Media Controls] Controls bar may disappear while captions menu is visible...
commit-queue@webkit.org [Wed, 29 Mar 2017 17:28:48 +0000 (17:28 +0000)]
[Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
https://bugs.webkit.org/show_bug.cgi?id=170239
<rdar://problem/31320685>

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

Source/WebCore:

We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
captions menu is visible. But there were two cases where the behavior was not as intended:

    1. the controls bar would hide upon exiting the video.
    2. clicking on the controls bar while the caption panel is up would hide the controls bar
       as well as the captions panel.

Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
controls bar from fading when exiting the media.

Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
bar and only dismiss the tracks panel.

Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype._autoHideTimerFired):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
(MacOSMediaControls.prototype.hideTracksPanel):

LayoutTests:

We extend an existing test to cover the case where we would hide the controls bar while the tracks panel
is up by mousing out of the media. We also add a new test where we check that clicking over the controls
bar to dismiss the tracks panel does not hide the controls bar. Finally, we make a small change to an
existing test to listen to "transitionend" event on the tracks panel specifically since with this patch
the controls bar would disappear and trigger a similar event when disappearing as the tracks panel is dismissed.

* media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it-expected.txt: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading-expected.txt:
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html:
* media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html:

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

4 years agoWebAssembly: pack OpcodeOrigin to fit in a pointer
keith_miller@apple.com [Wed, 29 Mar 2017 17:27:23 +0000 (17:27 +0000)]
WebAssembly: pack OpcodeOrigin to fit in a pointer
https://bugs.webkit.org/show_bug.cgi?id=170244

Reviewed by Michael Saboff.

This patch makes it so we don't have to have allocate the OpcodeOrigin and can just
pack all the data into the pointer B3::Origin already has.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):
* wasm/WasmOpcodeOrigin.cpp:
(JSC::Wasm::OpcodeOrigin::dump):
* wasm/WasmOpcodeOrigin.h:
(JSC::Wasm::OpcodeOrigin::OpcodeOrigin):
(JSC::Wasm::OpcodeOrigin::opcode):
(JSC::Wasm::OpcodeOrigin::location):

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

4 years agowebkitpy: Add IOSDevicePort and IOSPort tests
jbedard@apple.com [Wed, 29 Mar 2017 17:22:02 +0000 (17:22 +0000)]
webkitpy: Add IOSDevicePort and IOSPort tests
https://bugs.webkit.org/show_bug.cgi?id=170206
<rdar://problem/31308364>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/darwin_testcase.py: Removed unused import.
* Scripts/webkitpy/port/ios_device_unittest.py: Added.
(iosDeviceTest): Contains tests for the IOSDevicePort.
(iosDeviceTest.make_port): Creates an IOSDevicePort with arguments.
(iosDeviceTest.test_operating_system): Check for the correct operating system.
* Scripts/webkitpy/port/ios_simulator_unittest.py: Moved from Tools/Scripts/webkitpy/port/ios_unittest.py.
(iosSimulatorTest): Inherit from ios_testcase.
(iosSimulatorTest.make_port): Ditto.
(iosSimulatorTest.test_get_crash_log): Ditto.
* Scripts/webkitpy/port/ios_testcase.py: Added.
(iOSTest): Contains shared tests for the IOSDevicePort and IOSSimulatorPort.
(iOSTest.test_driver_name): Tests for iOS app driver.
(iOSTest.test_baseline_searchpath): Check that ios and ios-wk1 are in the baseline search path.
* Scripts/webkitpy/port/ios_unittest.py: Moved to ios_simulator_unittest.py.
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase): Rename is_simulator to disable_setup to more accurately describe it's meaning.
(PortTestCase.test_diff_image): Use disable_setup instead of is_simulator.
(PortTestCase.test_diff_image_crashed): Ditto.

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

4 years agoWebAssembly: NFC s/goto/lambda/g
jfbastien@apple.com [Wed, 29 Mar 2017 17:17:49 +0000 (17:17 +0000)]
WebAssembly: NFC s/goto/lambda/g
https://bugs.webkit.org/show_bug.cgi?id=170242

Reviewed by Mark Lam.

Lambdas are more in-style than the goto I just used.

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

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

4 years ago[Modern Media Controls] Volume slider is initially empty
commit-queue@webkit.org [Wed, 29 Mar 2017 17:08:23 +0000 (17:08 +0000)]
[Modern Media Controls] Volume slider is initially empty
https://bugs.webkit.org/show_bug.cgi?id=170237
<rdar://problem/31319077>

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

Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.

* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.commit):
(Slider.prototype.layout): Deleted.

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

4 years agoMark fast/workers/worker-close-more.html as a flaky timeout.
ryanhaddad@apple.com [Wed, 29 Mar 2017 17:08:08 +0000 (17:08 +0000)]
Mark fast/workers/worker-close-more.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=169838

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years ago[GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
zandobersek@gmail.com [Wed, 29 Mar 2017 17:03:08 +0000 (17:03 +0000)]
[GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
https://bugs.webkit.org/show_bug.cgi?id=170232

Reviewed by Michael Catanzaro.

Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
directory. The implementation files themselves are no-op, so this is
a simple move-and-rename operation that will enable proceeding with
the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.

No change in behavior. The SUBTLE_CRYPTO feature should build as it
did before, and the implementations are empty anyway.

* PlatformGTK.cmake:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
* crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.

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

4 years ago[GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation...
zandobersek@gmail.com [Wed, 29 Mar 2017 17:00:39 +0000 (17:00 +0000)]
[GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
https://bugs.webkit.org/show_bug.cgi?id=170231

Reviewed by Michael Catanzaro.

Source/WebCore:

* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
is already in use, and this file wasn't even being built.

Source/WebCore/PAL:

* pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Removed. The GCrypt counterpart
is already in use, and this file wasn't even being built.

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

4 years agoMove DTMF WebRTC extension behind its own compile flag
commit-queue@webkit.org [Wed, 29 Mar 2017 15:58:29 +0000 (15:58 +0000)]
Move DTMF WebRTC extension behind its own compile flag
https://bugs.webkit.org/show_bug.cgi?id=170226

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-29
Reviewed by Eric Carlson.

Source/WebCore:

Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
This compile flag is not set on any supported platform yet.
Disabling related test and updated test expectations.

* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* platform/mediastream/RTCDTMFSenderHandler.h:
* platform/mediastream/RTCDTMFSenderHandlerClient.h:

LayoutTests:

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

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

4 years ago[GTK][OWR] Rebaseline fast/mediastream/RTCPeerConnection-addIceCandidate.html after...
clopez@igalia.com [Wed, 29 Mar 2017 15:33:15 +0000 (15:33 +0000)]
[GTK][OWR] Rebaseline fast/mediastream/RTCPeerConnection-addIceCandidate.html after r214527
https://bugs.webkit.org/show_bug.cgi?id=170192

Unreviewed test gardening.

* platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:

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

4 years agoAdd test for differentiating camera versus canvas stream
commit-queue@webkit.org [Wed, 29 Mar 2017 15:18:38 +0000 (15:18 +0000)]
Add test for differentiating camera versus canvas stream
https://bugs.webkit.org/show_bug.cgi?id=169698
<rdar://problem/31076026>

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-29
Reviewed by Eric Carlson.

* fast/mediastream/captureStream/canvas2d.html:

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

4 years ago[WebRTC] Update test RTCPeerConnection-overloaded-operations-params.html after r214441
clopez@igalia.com [Wed, 29 Mar 2017 13:34:21 +0000 (13:34 +0000)]
[WebRTC] Update test RTCPeerConnection-overloaded-operations-params.html after r214441
https://bugs.webkit.org/show_bug.cgi?id=170223

Reviewed by Youenn Fablet.

After r214441 the arguments of addIceCandidate() are nullable.

* fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params.html:
* platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Removed. The expected result was the same than the general one.

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

4 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Wed, 29 Mar 2017 09:39:41 +0000 (09:39 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>

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

Source/WebCore:

Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
through the document. This should allow this flaky test to get information as to why the frame isn't
firing when it times out.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):
(WebCore::ScriptedAnimationController::resume):
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
* dom/ScriptedAnimationController.h:
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
(WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

Opt into ScriptedAnimationController logging.

* media/modern-media-controls/airplay-button/airplay-button-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button.html:

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

4 years agoAssemblyHelpers should not have a VM field
sbarati@apple.com [Wed, 29 Mar 2017 06:15:23 +0000 (06:15 +0000)]
AssemblyHelpers should not have a VM field
https://bugs.webkit.org/show_bug.cgi?id=170207

Reviewed by Yusuke Suzuki.

APIs that need VM should take one as a parameter. When doing position
independent code for Wasm, we can't tie code generation to a VM.

* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::testEntrySwitchSimple):
(JSC::B3::testEntrySwitchNoEntrySwitch):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
(JSC::B3::testEntrySwitchLoop):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/DOMJITAccessCasePatchpointParams.cpp:
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::dumpCacheSizesAndCrash):
(JSC::InlineAccess::generateSelfPropertyAccess):
(JSC::InlineAccess::generateSelfPropertyReplace):
(JSC::InlineAccess::generateArrayLength):
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/InlineAccess.h:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::AccessGenerationState):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::JITCompiler):
(JSC::DFG::JITCompiler::compileExceptionHandlers):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::exceptionCheck):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::exceptionCheckWithCallFrameRollback):
(JSC::DFG::JITCompiler::fastExceptionCheck):
(JSC::DFG::JITCompiler::vm):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler.h:
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGOSRExitCompilerCommon.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::checkArray):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileGetGlobalObject):
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileCreateActivation):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):
(JSC::DFG::SpeculativeJIT::compileSpread):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileNukeStructureAndSetButterfly):
(JSC::DFG::SpeculativeJIT::compileNewStringObject):
(JSC::DFG::SpeculativeJIT::compileNewTypedArray):
(JSC::DFG::SpeculativeJIT::compileStoreBarrier):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::emitAllocateJSObjectWithKnownSize):
(JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
(JSC::DFG::SpeculativeJIT::emitAllocateVariableSizedJSObject):
(JSC::DFG::SpeculativeJIT::emitAllocateDestructibleObject):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLJITFinalizer.h:
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLazySlowPathCall.h:
(JSC::FTL::createLazyCallGenerator):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateActivation):
(JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateDirectArguments):
(JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToB3::compileNotifyWrite):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckTraps):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorageWithSizeImpl):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* ftl/FTLSlowPathCall.h:
(JSC::FTL::callOperation):
* ftl/FTLState.h:
(JSC::FTL::State::vm):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitReleaseAssertNoException):
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::emitJumpIfException):
(JSC::AssemblyHelpers::emitExceptionCheck):
(JSC::AssemblyHelpers::emitNonPatchableExceptionCheck):
(JSC::AssemblyHelpers::emitLoadStructure):
(JSC::AssemblyHelpers::emitRandomThunk):
(JSC::AssemblyHelpers::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
(JSC::AssemblyHelpers::debugCall):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::AssemblyHelpers):
(JSC::AssemblyHelpers::codeBlock):
(JSC::AssemblyHelpers::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesFromFrameOrRegisterToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::barrierBranch):
(JSC::AssemblyHelpers::barrierStoreLoadFence):
(JSC::AssemblyHelpers::mutatorFence):
(JSC::AssemblyHelpers::storeButterfly):
(JSC::AssemblyHelpers::nukeStructureAndStoreButterfly):
(JSC::AssemblyHelpers::jumpIfMutatorFenceNotNeeded):
(JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize):
(JSC::AssemblyHelpers::emitAllocateJSObject):
(JSC::AssemblyHelpers::emitAllocateVariableSizedCell):
(JSC::AssemblyHelpers::emitAllocateVariableSizedJSObject):
(JSC::AssemblyHelpers::emitAllocateDestructibleObject):
(JSC::AssemblyHelpers::vm): Deleted.
(JSC::AssemblyHelpers::debugCall): Deleted.
* jit/CCallHelpers.cpp:
(JSC::CCallHelpers::ensureShadowChickenPacket):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::CCallHelpers):
(JSC::CCallHelpers::jumpToExceptionHandler):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JIT.h:
(JSC::JIT::exceptionCheck):
(JSC::JIT::exceptionCheckWithCallFrameRollback):
* jit/JITMathIC.h:
(JSC::JITMathIC::generateOutOfLine):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitWriteBarrier):
* jit/JSInterfaceJIT.h:
(JSC::JSInterfaceJIT::JSInterfaceJIT):
(JSC::JSInterfaceJIT::vm):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::linkPolymorphicCall):
(JSC::resetGetByID):
(JSC::resetPutByID):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* jit/SetupVarargsFrame.h:
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::loadArgumentWithSpecificClass):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::randomThunkGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
(JSC::throwExceptionFromWasmThunkGenerator):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
(JSC::Wasm::wasmToWasm):

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

4 years agoFix `index-expected.txt` for dashboard test results.
jmarcell@apple.com [Wed, 29 Mar 2017 06:07:26 +0000 (06:07 +0000)]
Fix `index-expected.txt` for dashboard test results.
https://bugs.webkit.org/show_bug.cgi?id=170214

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt:

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

4 years agoWebAssembly: We should have Origins
keith_miller@apple.com [Wed, 29 Mar 2017 05:32:45 +0000 (05:32 +0000)]
WebAssembly: We should have Origins
https://bugs.webkit.org/show_bug.cgi?id=170217

Reviewed by Mark Lam.

This patch adds wasm origins for B3::Values, called OpcodeOrigin. Currently,
OpcodeOrigin just tracks the original opcode and the location of that opcode.

Here's a sample:

BB#0: ; frequency = 1.000000
    Int64 @4 = Patchpoint(generator = 0x10f487fa8, earlyClobbered = [], lateClobbered = [], usedRegisters = [], resultConstraint = SomeRegister)
    Int64 @5 = FramePointer()
    Void @8 = Store(@4, @5, offset = 24, ControlDependent|Writes:Top)
    Int64 @10 = Const64(0)
    Void @12 = Store($0(@10), @5, offset = 16, ControlDependent|Writes:Top)
    Int64 @13 = Patchpoint(generator = 0x10f4be7f0, earlyClobbered = [], lateClobbered = [], usedRegisters = [], resultConstraint = SomeRegister, ExitsSideways|ControlDependent|WritesPinned|ReadsPinned|Fence|Writes:Top|Reads:Top)
    Int64 @16 = ArgumentReg(%rdi)
    Int64 @18 = ArgumentReg(%rsi)
    Int32 @22 = Trunc(@18, Wasm: {opcode: I64Rotl, location: 5})
    Int64 @23 = RotL(@16, @22, Wasm: {opcode: I64Rotl, location: 5})
    Void @27 = Return(@23, Terminal, Wasm: {opcode: End, location: 6})

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Value.cpp:
(JSC::B3::Value::deepDump):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::setParser):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):
(JSC::Wasm::B3IRGenerator::emitLoadOp):
(JSC::Wasm::B3IRGenerator::emitStoreOp):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::B3IRGenerator::addLoop):
(JSC::Wasm::B3IRGenerator::unify):
(JSC::Wasm::parseAndCompile):
(JSC::Wasm::B3IRGenerator::emitChecksForModOrDiv):
(JSC::Wasm::getMemoryBaseAndSize): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser::currentOpcode):
(JSC::Wasm::FunctionParser::currentOpcodeStartingOffset):
(JSC::Wasm::FunctionParser<Context>::FunctionParser):
* wasm/WasmOpcodeOrigin.cpp: Added.
(JSC::Wasm::OpcodeOrigin::dump):
* wasm/WasmOpcodeOrigin.h: Added.
(JSC::Wasm::OpcodeOrigin::OpcodeOrigin):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::setParser):
* wasm/generateWasmB3IRGeneratorInlinesHeader.py:
(CodeGenerator.generate):
(generateB3OpCode):
(generateConstCode):

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

4 years ago[WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dicti...
commit-queue@webkit.org [Wed, 29 Mar 2017 04:09:14 +0000 (04:09 +0000)]
[WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
https://bugs.webkit.org/show_bug.cgi?id=170192

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-28
Reviewed by Jon Lee.

Source/WebCore:

Covered by updated tests.

* Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
* Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.

LayoutTests:

* fast/mediastream/RTCIceCandidate-expected.txt:
* fast/mediastream/RTCIceCandidate.html: Removing no longer valid tests.
* fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
* fast/mediastream/RTCPeerConnection-addIceCandidate.html: Adding more tests to cover null/undefined cases.
Ensuring sdpMid has a valid value.
* fast/mediastream/resources/promise-utils.js: Improving error logging.

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

4 years agoWebAssembly: option to crash if no fast memory is available
jfbastien@apple.com [Wed, 29 Mar 2017 04:02:17 +0000 (04:02 +0000)]
WebAssembly: option to crash if no fast memory is available
https://bugs.webkit.org/show_bug.cgi?id=170219

Reviewed by Mark Lam.

* runtime/Options.h:
* wasm/WasmMemory.cpp:
(JSC::Wasm::webAssemblyCouldntGetFastMemory):
(JSC::Wasm::tryGetFastMemory):

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

4 years agoLibWebRTCProvider should allow setting encoder and decoder factories
commit-queue@webkit.org [Wed, 29 Mar 2017 03:51:20 +0000 (03:51 +0000)]
LibWebRTCProvider should allow setting encoder and decoder factories
https://bugs.webkit.org/show_bug.cgi?id=170212

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-28
Reviewed by Eric Carlson.

No change of behavior.
Adding the ability to set encoder/decoder libwebrtc factory getters.
Setting default cocoa factory getters.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::staticFactoryAndThreads):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
(WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
(WebCore::LibWebRTCProvider::setPeerConnectionFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

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

4 years agoWeb Inspector: RTL: keyboard shortcuts with directionality need to be flipped (forwar...
bburg@apple.com [Wed, 29 Mar 2017 01:56:16 +0000 (01:56 +0000)]
Web Inspector: RTL: keyboard shortcuts with directionality need to be flipped (forward/back, etc)
https://bugs.webkit.org/show_bug.cgi?id=165761

Reviewed by Matt Baker.

Original patch by Devin Rousso.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser):
* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser):
Flip the functionality of keyboard shortcuts when in RTL so that the action of
pressing the left or right arrows/curly braces matches what happens when the
corresponding left or right buttons are clicked.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype._keyDown):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._keyDown):
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype._treeKeyDown):
Flip the Left and Right keyboard shortcuts to expand/collapse the selected item when in RTL.

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

4 years agoBot watcher's dashboard has separate settings for "mac" and "macos"
ap@apple.com [Wed, 29 Mar 2017 01:32:01 +0000 (01:32 +0000)]
Bot watcher's dashboard has separate settings for "mac" and "macos"
https://bugs.webkit.org/show_bug.cgi?id=170164

Reviewed by Tim Horton.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Settings.js:
(Settings.prototype.parsePlatformFamily): Aded a special case for "macos".

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

4 years agoFix dashboard test results on the dashboard
ap@apple.com [Wed, 29 Mar 2017 01:31:29 +0000 (01:31 +0000)]
Fix dashboard test results on the dashboard
https://bugs.webkit.org/show_bug.cgi?id=170158

Reviewed by Tim Horton.

Link to result diff instead of stdio. Looking at the diff, I wonder if it can be
further improved, as it's not super readable, but stdio is entirely useless in this context.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Buildbot.js:
(Buildbot.prototype.dashboardTestResultsURLForIteration): Generate formatted diff link.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
Fixed a typo in step name, so that it's actually treated as productive.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
(BuildbotTesterQueueView.prototype.appendBuilderQueueStatus):
(BuildbotTesterQueueView.prototype.update):
(BuildbotTesterQueueView.prototype._presentPopoverForGenericTestFailures):
Added special handling for dashboard test results.

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

4 years agoStop overriding scroll view inset defaults
timothy_horton@apple.com [Wed, 29 Mar 2017 01:14:49 +0000 (01:14 +0000)]
Stop overriding scroll view inset defaults
https://bugs.webkit.org/show_bug.cgi?id=170221
<rdar://problem/31260325>

Reviewed by Simon Fraser.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
The default behavior is sufficient for us.

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

4 years agoOnly attach Attributes to a given element one time
bfulgham@apple.com [Wed, 29 Mar 2017 01:00:09 +0000 (01:00 +0000)]
Only attach Attributes to a given element one time
https://bugs.webkit.org/show_bug.cgi?id=170125
<rdar://problem/31279676>

Reviewed by Chris Dumez.

Source/WebCore:

Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
arbitrary JavaScript events to fire.

Test: fast/dom/Attr/only-attach-attr-once.html

* dom/Element.cpp:
(WebCore::Element::attachAttributeNodeIfNeeded): Added.
(WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'.
(WebCore::Element::setAttributeNodeNS): Ditto.
* dom/Element.h:

LayoutTests:

* fast/dom/Attr/make-unique-element-data-while-replacing-attr-expected.txt: Rebaselined.
* fast/dom/Attr/make-unique-element-data-while-replacing-attr.html: Add check before setting new value.
* fast/dom/Attr/only-attach-attr-once-expected.txt: Added.
* fast/dom/Attr/only-attach-attr-once.html: Added.

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

4 years agoThe Mutator should not be able to steal the conn if the Collector hasn't reached...
mark.lam@apple.com [Wed, 29 Mar 2017 00:43:09 +0000 (00:43 +0000)]
The Mutator should not be able to steal the conn if the Collector hasn't reached the NotRunning phase yet.
https://bugs.webkit.org/show_bug.cgi?id=170213
<rdar://problem/30755345>

Reviewed by Filip Pizlo.

The current condition for stealing the conn isn't tight enough.  Restricting the
stealing to when m_currentPhase == NotRunning ensures that the Collector is
really done running.

No test because this issue only manifests with a race condition that is difficult
to reproduce on demand.

* heap/Heap.cpp:
(JSC::Heap::requestCollection):

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

4 years agoStop RTCDataChannel when closing page
commit-queue@webkit.org [Wed, 29 Mar 2017 00:06:11 +0000 (00:06 +0000)]
Stop RTCDataChannel when closing page
https://bugs.webkit.org/show_bug.cgi?id=170166

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-28
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/datachannel/datachannel-gc.html

Making RTCDataChannel an ActiveDOMObject.
Closing the data channel backend and freeing upon close and stop.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::close):
(WebCore::RTCDataChannel::stop):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.h:

LayoutTests:

* webrtc/datachannel/datachannel-gc-expected.txt: Added.
* webrtc/datachannel/datachannel-gc.html: Added.

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

4 years agoRanges for variation font properties are not enforced
mmaxfield@apple.com [Tue, 28 Mar 2017 23:53:28 +0000 (23:53 +0000)]
Ranges for variation font properties are not enforced
https://bugs.webkit.org/show_bug.cgi?id=169979

Reviewed by David Hyatt.

Source/WebCore:

The spec specifies that:
- Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
- Font stretch values less than or equal to 0% are parse errors
- Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors

Test: fast/text/variations/out-of-bounds-selection-properties.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::fontStretchIsWithinRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::fontStyleIsWithinRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):

LayoutTests:

* fast/text/font-selection-font-face-parse-expected.txt:
* fast/text/font-selection-font-face-parse.html:
* fast/text/font-selection-font-loading-api-parse-expected.txt:
* fast/text/font-selection-font-loading-api-parse.html:
* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* fast/text/variations/font-loading-api-parse-ranges-expected.txt:
* fast/text/variations/font-loading-api-parse-ranges.html:
* fast/text/variations/out-of-bounds-selection-properties-expected.txt: Added.
* fast/text/variations/out-of-bounds-selection-properties.html: Added.
* platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:

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

4 years ago[iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy...
aestes@apple.com [Tue, 28 Mar 2017 23:50:55 +0000 (23:50 +0000)]
[iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
https://bugs.webkit.org/show_bug.cgi?id=170197
<rdar://problem/30314067>

Reviewed by Brady Eidson.

Source/WebCore:

If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
failures in PreviewLoader, not conversion failures, so check if
m_finishedLoadingDataIntoConverter is set before continuing (like we do in
PreviewLoader::didFinishLoading()).

Fixes crash in http/tests/multipart/policy-ignore-crash.php.

* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::didFail):

LayoutTests:

* platform/ios/TestExpectations: Unskipped http/tests/multipart/policy-ignore-crash.php.
* platform/ios/http/tests/multipart/policy-ignore-crash-expected.txt: Added an iOS-specific result.

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

4 years agoAudio indicator is visible on uni-watch.com but there is no audible audio
cdumez@apple.com [Tue, 28 Mar 2017 23:12:45 +0000 (23:12 +0000)]
Audio indicator is visible on uni-watch.com but there is no audible audio
https://bugs.webkit.org/show_bug.cgi?id=170200
<rdar://problem/31289132>

Reviewed by Eric Carlson.

Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
- https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4

When the gain of a GainNode is 0 or 1, the operation of the node can
be optimized.  When gain = 1, just copy the input to the output.  When
gain = 0; just zero out the output.  Currently, the input is
multiplied by the gain to produce the output.  This just optimizes the
multiplication away for the two special cases.

Also, have the GainNode set the silence hint if the gain is 0.

And fix a bug in processIfNecessary when unsilenceOutputs was causing the
silence hint to be cleared after the node's process method was finished
and may have set the silence hint.  The processing should come after
unsilenceOutputs to preserve any hints from processing the node.

* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::processIfNecessary):
* Modules/webaudio/GainNode.cpp:
(WebCore::GainNode::process):
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::copyWithGainFrom):

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

4 years agoWebAssembly: Make WebAssembly.instantiate/compile truly asynchronous
keith_miller@apple.com [Tue, 28 Mar 2017 23:12:11 +0000 (23:12 +0000)]
WebAssembly: Make WebAssembly.instantiate/compile truly asynchronous
https://bugs.webkit.org/show_bug.cgi?id=169187

Reviewed by Saam Barati.

JSTests:

* wasm/assert.js:
* wasm/js-api/Module-compile.js:
(async.testPromiseAPI):
* wasm/js-api/web-assembly-compile-parallel.js: Added.
(async.throwExn):
(async.test):
* wasm/js-api/web-assembly-instantiate-parallel.js: Added.
(async.test):
* wasm/js-api/web-assembly-instantiate.js:
(assert.eq.async.test):
(assert.eq):
(assert.asyncTest.async.test):
(assert.asyncTest):
(assert.truthy.async.test): Deleted.
(assert.truthy): Deleted.

Source/JavaScriptCore:

This patch allows WebAssembly compilations to happen asynchronously.
To do so, it refactors how much of the compilation happens and adds
new infrastructure for async promises.

First, there is a new class, PromiseDeferredTimer that lives on
the VM.  PromiseDeferredTimer will manage the life-cycle of async
pending promises and any dependencies that promise
needs. PromiseDeferredTimer automagically releases the pending
promise and dependencies once the JSPromiseDeferred is resolved or
rejected. Additionally, PromiseDeferredTimer provides a mechanism
to poll the run-loop whenever the async task needs to synchronize
with the JS thread. Normally, that will be whenever the async task
finishes. In the case of Web Assembly we also use this feature for
the compile + instantiate case, where we might have more work
after the first async task completes (more on that later).

The next class is Wasm::Worklist, which is used to manage Wasm
compilation tasks. The worklist class works similarly to the
DFG/FTL Worklists. It has a pool of threads that it manages. One
interesting aspect of Wasm Worklist is that it can synchronously
compile a plan that is already potentially running
asynchronously. This can occur if a user calls
WebAssembly.instantiate() then new WebAssembly.instantiate() on
the same module. In that case the Wasm Worklist will bump the
priority of the running pending Plan and block the JS thread.

This patch also makes some of the Wasm Plan code cleaner. Since we
now defer all compilation to instantiation time, we no longer need
to guess at which memory we are going to get. Also, Wasm Plans now
track the work they have done with a state enum.

Finally, this patch makes renamed HeapTimer to JSRunLoopTimer. It
also adds changes test262AsyncTest to a more generic testing
infrastructure. Now, in addition to the old functionality, you can
call asyncTest() with the number of tests you expect. When the jsc
CLI exits, it will guarantee that asyncTestPassed() is called that
many times.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/GCActivityCallback.h:
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::scheduleTimer):
(JSC::IncrementalSweeper::IncrementalSweeper):
* heap/IncrementalSweeper.h:
* heap/StopIfNecessaryTimer.cpp:
(JSC::StopIfNecessaryTimer::StopIfNecessaryTimer):
* heap/StopIfNecessaryTimer.h:
* heap/StrongInlines.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(printInternal):
(functionAsyncTestStart):
(functionAsyncTestPassed):
(functionTestWasmModuleFunctions):
(CommandLine::parseArguments):
(runJSC):
* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::resolve):
(JSC::JSPromiseDeferred::reject):
* runtime/JSPromiseDeferred.h:
(JSC::JSPromiseDeferred::promiseAsyncPending):
* runtime/JSRunLoopTimer.cpp: Renamed from Source/JavaScriptCore/heap/HeapTimer.cpp.
(JSC::JSRunLoopTimer::JSRunLoopTimer):
(JSC::JSRunLoopTimer::setRunLoop):
(JSC::JSRunLoopTimer::~JSRunLoopTimer):
(JSC::JSRunLoopTimer::timerDidFire):
(JSC::JSRunLoopTimer::scheduleTimer):
(JSC::JSRunLoopTimer::cancelTimer):
(JSC::JSRunLoopTimer::invalidate):
* runtime/JSRunLoopTimer.h: Copied from Source/JavaScriptCore/heap/HeapTimer.h.
* runtime/Options.h:
* runtime/PromiseDeferredTimer.cpp: Added.
(JSC::PromiseDeferredTimer::PromiseDeferredTimer):
(JSC::PromiseDeferredTimer::doWork):
(JSC::PromiseDeferredTimer::runRunLoop):
(JSC::PromiseDeferredTimer::addPendingPromise):
(JSC::PromiseDeferredTimer::cancelPendingPromise):
(JSC::PromiseDeferredTimer::scheduleWorkSoon):
(JSC::PromiseDeferredTimer::scheduleBlockedTask):
* runtime/PromiseDeferredTimer.h: Renamed from Source/JavaScriptCore/heap/HeapTimer.h.
(JSC::PromiseDeferredTimer::stopRunningTasks):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
* runtime/VM.h:
* wasm/JSWebAssembly.cpp:
(JSC::reject):
(JSC::webAssemblyCompileFunc):
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):
(JSC::Wasm::B3IRGenerator::memoryKind):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmFormat.h:
(JSC::Wasm::ModuleInformation::internalFunctionCount):
* wasm/WasmFunctionParser.h:
* wasm/WasmMemory.h:
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::MemoryInformation::MemoryInformation):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::MemoryInformation::maximum):
(JSC::Wasm::MemoryInformation::hasReservedMemory): Deleted.
(JSC::Wasm::MemoryInformation::takeReservedMemory): Deleted.
(JSC::Wasm::MemoryInformation::mode): Deleted.
* wasm/WasmModuleParser.cpp:
* wasm/WasmModuleParser.h:
(JSC::Wasm::ModuleParser::ModuleParser):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::stateString):
(JSC::Wasm::Plan::moveToState):
(JSC::Wasm::Plan::fail):
(JSC::Wasm::Plan::parseAndValidateModule):
(JSC::Wasm::Plan::prepare):
(JSC::Wasm::Plan::ThreadCountHolder::ThreadCountHolder):
(JSC::Wasm::Plan::ThreadCountHolder::~ThreadCountHolder):
(JSC::Wasm::Plan::compileFunctions):
(JSC::Wasm::Plan::complete):
(JSC::Wasm::Plan::waitForCompletion):
(JSC::Wasm::Plan::cancel):
(JSC::Wasm::Plan::run): Deleted.
(JSC::Wasm::Plan::initializeCallees): Deleted.
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
(JSC::Wasm::Plan::exports):
(JSC::Wasm::Plan::internalFunctionCount):
(JSC::Wasm::Plan::takeModuleInformation):
(JSC::Wasm::Plan::takeCallLinkInfos):
(JSC::Wasm::Plan::takeWasmExitStubs):
(JSC::Wasm::Plan::setModeAndPromise):
(JSC::Wasm::Plan::mode):
(JSC::Wasm::Plan::pendingPromise):
(JSC::Wasm::Plan::vm):
(JSC::Wasm::Plan::errorMessage):
(JSC::Wasm::Plan::failed):
(JSC::Wasm::Plan::hasWork):
(JSC::Wasm::Plan::hasBeenPrepared):
* wasm/WasmPlanInlines.h: Copied from Source/JavaScriptCore/wasm/WasmB3IRGenerator.h.
(JSC::Wasm::Plan::initializeCallees):
* wasm/WasmValidate.cpp:
* wasm/WasmWorklist.cpp: Added.
(JSC::Wasm::Worklist::priorityString):
(JSC::Wasm::Worklist::QueueElement::setToNextPriority):
(JSC::Wasm::Worklist::iterate):
(JSC::Wasm::Worklist::enqueue):
(JSC::Wasm::Worklist::completePlanSynchronously):
(JSC::Wasm::Worklist::stopAllPlansForVM):
(JSC::Wasm::Worklist::Worklist):
(JSC::Wasm::Worklist::~Worklist):
(JSC::Wasm::existingWorklistOrNull):
(JSC::Wasm::ensureWorklist):
* wasm/WasmWorklist.h: Added.
(JSC::Wasm::Worklist::nextTicket):
(JSC::Wasm::Worklist::Comparator::operator()):
* wasm/js/JSWebAssemblyCallee.h:
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
(JSC::JSWebAssemblyCodeBlock::initialize):
(JSC::JSWebAssemblyCodeBlock::isSafeToRun):
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::initialized):
(JSC::JSWebAssemblyCodeBlock::plan):
(JSC::JSWebAssemblyCodeBlock::runnable):
(JSC::JSWebAssemblyCodeBlock::errorMessage):
(JSC::JSWebAssemblyCodeBlock::callees):
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::createSourceBufferFromValue):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::addUnitializedCodeBlock):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::setMemory): Deleted.
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::codeBlock):
(JSC::JSWebAssemblyInstance::initialized):
(JSC::JSWebAssemblyInstance::module):
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::importFunctions):
(JSC::JSWebAssemblyInstance::setImportFunction): Deleted.
(JSC::JSWebAssemblyInstance::setTable): Deleted.
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::createStub):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::finishCreation):
(JSC::JSWebAssemblyModule::setCodeBlock):
(JSC::JSWebAssemblyModule::buildCodeBlock): Deleted.
(JSC::JSWebAssemblyModule::create): Deleted.
(JSC::JSWebAssemblyModule::codeBlock): Deleted.
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::moduleInformation):
(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::source):
(JSC::JSWebAssemblyModule::takeReservedMemory): Deleted.
(JSC::JSWebAssemblyModule::codeBlockFor): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
(JSC::WebAssemblyInstanceConstructor::createInstance): Deleted.
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModulePrototype.cpp:
(JSC::webAssemblyModuleProtoImports):
(JSC::webAssemblyModuleProtoExports):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyModuleRecord.h:

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

4 years agoAnimated SVG images are not paused when outside viewport
cdumez@apple.com [Tue, 28 Mar 2017 23:11:35 +0000 (23:11 +0000)]
Animated SVG images are not paused when outside viewport
https://bugs.webkit.org/show_bug.cgi?id=170155
<rdar://problem/31288893>

Reviewed by Antti Koivisto.

Source/WebCore:

Make sure animated SVG images get paused when outside the viewport,
similarly to what was already done for animated GIF images. Also
make sure they are paused when they no longer have any renderers
using them.

Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
       svg/animations/animated-svg-image-removed-from-document-paused.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
Restart the animation whenever a new CachedImage client is added. This
will cause us the re-evaluate if the animation should run. The animation
will pause again if the new renderer is not inside the viewport.

(WebCore::CachedImage::animationAdvanced):
Add a flag to newImageAnimationFrameAvailable() so that the renderers can
let us know if we can pause the animation. Pause the animation if all no
renderer requires it (i.e. they are all outside the viewport, or there
are no renderers).

* loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::newImageAnimationFrameAvailable):
By default, the CachedImageClients allow pausing. Only renderer will
potentially prevent pausing if they are inside the viewport.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::isAnimating):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::isAnimating):
Add isAnimating() flag on Image for layout testing purposes.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::newImageAnimationFrameAvailable):
Set canPause flag to true if the renderer is not inside the viewport.

(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
Call startAnimation() if the renderer is now visible to resume SVG
animations. Repainting is enough for GIF animations but not for SVG
animations, we have to explicitly resume them.

* rendering/RenderElement.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::addRendererWithPausedImageAnimations):
(WebCore::RenderView::removeRendererWithPausedImageAnimations):
(WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
* rendering/RenderView.h:
Store CachedImages with the renderers that have paused animations.
This is required for SVG where we need to explicitly resume the
animation on the CachedImage when the renderer becomes visible
again. Having access to the Image will also allow us to do smarter
visibility checks in RenderElement's shouldRepaintForImageAnimation(),
in the future.

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::hasActiveAnimation):
* svg/SVGSVGElement.h:
Add hasActiveAnimation() method.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::startAnimation):
Check that animations are paused before starting them. This avoid
jumping due to unnecessary calls to rootElement->setCurrentTime(0).

(WebCore::SVGImage::isAnimating):
Add isAnimating() method for layout tests purposes.

* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageClients.h:
Call animationAdvanced() on the observer instead of the generic
changedInRect() when the SVGImage is animating. This way, we go
through the same code path as GIF animations and we end up calling
CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
on RenderElement, which determines if the animation should keep
running or not.

* testing/Internals.cpp:
(WebCore::Internals::isImageAnimating):
* testing/Internals.h:
* testing/Internals.idl:
Add layout testing infrastructure.

LayoutTests:

Add layout test coverage.

* platform/mac-wk1/TestExpectations:
* svg/animations/animated-svg-image-outside-viewport-paused-expected.txt: Added.
* svg/animations/animated-svg-image-outside-viewport-paused.html: Added.
* svg/animations/animated-svg-image-removed-from-document-paused-expected.txt: Added.
* svg/animations/animated-svg-image-removed-from-document-paused.html: Added.
* svg/animations/resources/smilAnimation.svg: Added.

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

4 years agoModernize AnalysisTaskPage
rniwa@webkit.org [Tue, 28 Mar 2017 23:00:36 +0000 (23:00 +0000)]
Modernize AnalysisTaskPage
https://bugs.webkit.org/show_bug.cgi?id=170165

Reviewed by Antti Koivisto.

Modernized AnalysisTaskPage and related components. The main refactoring happened in AnalysisTaskPage
from which AnalysisTaskResultsPane and AnalysisTaskTestGroupPane have been extracted.

Decoupled BuildRequest from its results. AnalysisResultsViewer and TestGroupResultsTable now stores
a reference to AnalysisResultsView and Metric to find the results for each build request.
This refactoring is necessary in order to view results of an arbitrary metric in the future.

Also refactored ResultsTable and its subclasses extensively. Instead of making its render() to invoke
subclass' methods such as buildRowGroups, heading, and additionalHeading, rely on each subclass call
to invoke renderTable(), renamed from render(), with callbacks to add extra headers and columns.

This patch also fixes a number of usability issues found by the user such as changing the test name
resets the customized revisions by the virtue of the modern code being naturally more correct.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer):
(AnalysisResultsViewer.prototype.setTestGroupCallback): Deleted. Replaced by "testGroupClick" action.
(AnalysisResultsViewer.prototype.setRangeSelectorLabels): Moved here from ResultsTable since it's
never used in ResultsTable or TestGroupResultsTable.
(AnalysisResultsViewer.prototype.selectedRange): Ditto.
(AnalysisResultsViewer.prototype.setPoints): Now takes metric as the third argument.
(AnalysisResultsViewer.prototype.setTestGroups): Now takes the current test group.
(AnalysisResultsViewer.prototype.didUpdateResults): Deleted.
(AnalysisResultsViewer.prototype.setAnalysisResultsView): Added.
(AnalysisResultsViewer.prototype.render): Invoke _renderTestGroups lazily. Also simplified the logic
to find the selected list item. Since we always use a shadow DOM now, we can simply look for an element
with ".seleted" instead of crafting a unique class name.
(AnalysisResultsViewer.prototype.renderTestGroups): Renamed from buildRowGroups. Specify callbacks to
insert headers for A/B radio buttons, which has been moved from ResultsTable.prototype.render, and the
stacked blocks of testing results.
(AnalysisResultsViewer.prototype._classForTestGroup): Deleted.
(AnalysisResultsViewer.prototype._openStackingBlock): Deleted.
(AnalysisResultsViewer.prototype._expandBetween): Create a new set for expandedPoints to make
_renderTestGroupsLazily.evaluate do the work.
(AnalysisResultsViewer._layoutBlocks): Moved from TestGroupStackingGrid.layout.
(AnalysisResultsViewer._sortBlocksByRow): Moved from AnalysisResultsViewer.TestGroupStackingGrid.
(AnalysisResultsViewer._insertAfterBlockWithSameRange): Ditto.
(AnalysisResultsViewer._insertBlockInFirstAvailableColumn): Ditto.
(AnalysisResultsViewer._createCellsForRow): Ditto.

(AnalysisResultsViewer.TestGroupStackingBlock):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): No longer creates a unique
class name here. See the inline comment for AnalysisResultsViewer.prototype.render.
(AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Deleted. We used to collapse "failed"
test groups as a thin vertical line, and we wanted to show them next to each other in _layoutBlock but
we don't do that anymore.
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Added. Uses
this._analysisResultsView to extract the results for the current metrics.
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):

* public/v3/components/analysis-task-bug-list.js: Added.
(AnalysisTaskBugList): Added. Extracted from AnalysisTaskChartPane.
(AnalysisTaskBugList.prototype.setTask): Added.
(AnalysisTaskBugList.prototype.didConstructShadowTree): Added.
(AnalysisTaskBugList.prototype.render): Added.
(AnalysisTaskBugList.prototype._associateBug): Added.
(AnalysisTaskBugList.prototype._dissociateBug): Added.
(AnalysisTaskBugList.htmlTemplate): Added.

* public/v3/components/chart-pane-base.js:
(ChartPaneBase.htmlTemplate): Added a hook to insert more content at the end in AnalysisTaskChartPane.
(ChartPaneBase.paneFooterTemplate): Added.

* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm):
(CustomizableTestGroupForm.prototype.setCommitSetMap):
(CustomizableTestGroupForm.prototype.startTesting): Renamed from _submitted. Now dispatches an action
by the name of "startTesting" instead of calling this._startCallback.
(CustomizableTestGroupForm.prototype.didConstructShadowTree): Added. Moved the logic to attach event
handlers here to avoid eagerly creating the shadow tree in the constructor.
(CustomizableTestGroupForm.prototype._computeCommitSetMap): Use the newly added this._revisionEditorMap
to find the relevant input element instead of running a querySelector.
(CustomizableTestGroupForm.prototype.render): Lazily invoke _renderCustomRevisionTable. This avoids
overriding the customized revisions when the user finally types in the test group name.
(CustomizableTestGroupForm.prototype._renderCustomRevisionTable): Extracted from render.
(CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Made this a non-static method
since it needs to update this._revisionEditorMap now. Merged _constructRevisionRadioButtons.
(CustomizableTestGroupForm.prototype._createRadioButton): Deleted. See above.
(CustomizableTestGroupForm.cssTemplate):
(CustomizableTestGroupForm.formContent): Use IDs instead of classes to make this.content(ID) work.

* public/v3/components/mutable-list-view.js:
(MutableListView.prototype.setList):
(MutableListView.prototype.setKindList):
(MutableListView.prototype.setAddCallback): Deleted. Replaced by "addItem" action.
(MutableListView.prototype.render):
(MutableListItem.prototype.content):

* public/v3/components/results-table.js:
(ResultsTable): Removed this._rangeSelectorLabels, this._rangeSelectorCallback, and this._selectedRange
as they are only used by AnalysisResultsViewer. Also replaced this._valueFormatter by
this._analysisResultsView which knows a metric.
(ResultsTable.prototype.setValueFormatter): Deleted.
(ResultsTable.prototype.setRangeSelectorLabels): Deleted.
(ResultsTable.prototype.setRangeSelectorCallback): Deleted.
(ResultsTable.prototype.selectedRange): Deleted.
(ResultsTable.prototype._rangeSelectorClicked): Deleted.
(ResultsTable.prototype.setAnalysisResultsView): Added.
(ResultsTable.prototype.renderTable): Added. Removed the logic to add _rangeSelectorLabels since it has
been moved to AnalysisResultsViewer.prototype.render inside buildColumns, which also inserts additional
columns which used to be stored on each ResultsTableRow. Use the same technique to insert additional
headers. Also take the name (thead tr th) of row header (tbody tr td) as an argument and automatically
create a table cell of an appropriate colspan.
(ResultsTable.prototype._createRevisionListCells):
(ResultsTable.prototype.heading): Deleted. Superseded by buildHeaders callback.
(ResultsTable.prototype.additionalHeading): Ditto.
(ResultsTable.prototype.buildRowGroups): Deleted. It is now the responsibility of each subclass to call
ResultsTable's renderTable() in the subclass' render() function.
(ResultsTable.prototype._computeRepositoryList): No longer takes extraRepositories as an argument.
Instead, this function now returns a pair of the repository list and the list of constant commits.
(ResultsTable.htmlTemplate):
(ResultsTable.cssTemplate):

* public/v3/components/test-group-form.js:
(TestGroupForm): Avoid eagerly creating the shadow tree. Also removed the removed the dead code.
(TestGroupForm.prototype.setRepetitionCount): Simply override the value of the select element.
(TestGroupForm.prototype.didConstructShadowTree): Added. Attach event handlers here to avoid eagerly
creating the shadow tree in the constructor.
(TestGroupForm.prototype.startTesting): Renamed from _submitted. Dispatch "startTesting" action instead
of invoking _startCallback which has been removed.
(TestGroupForm.htmlTemplate):
(TestGroupForm.formContent):

* public/v3/components/test-group-results-table.js:
(TestGroupResultsTable):
(TestGroupResultsTable.prototype.didUpdateResults): Deleted. No longer neeed per setAnalysisResultsView
in ResultsTable.
(TestGroupResultsTable.prototype.setTestGroup):
(TestGroupResultsTable.prototype.heading): Deleted.
(TestGroupResultsTable.prototype.render):
(TestGroupResultsTable.prototype._renderTestGroup): Extracted from render.
(TestGroupResultsTable.prototype._buildRowGroups): Renamed from buildRowGroups.
(TestGroupResultsTable.prototype._buildRowGroupForCommitSet): Extracted from buildRowGroups.
(TestGroupResultsTable.prototype._buildComparisonRow): Extracted from buildRowGroups.buildRowGroups

* public/v3/index.html: Include analysis-task-bug-list.js.

* public/v3/models/analysis-results.js:
(AnalysisResults): Inverted the map so that we can easily create a view based on metric.
(AnalysisResults.prototype.find): Ditto.
(AnalysisResults.prototype.add): Ditto.
(AnalysisResults.prototype.viewForMetric): Added.
(AnalysisResults.fetch):
(AnalysisResultsView): Added.
(AnalysisResultsView.prototype.metric): Added.
(AnalysisResultsView.prototype.resultForBuildId): Added.

* public/v3/models/build-request.js:
(BuildRequest.result): Deleted.
(BuildRequest.setResult): Deleted.

* public/v3/models/test-group.js:
(TestGroup): Removed this._allCommitSets since it was never used.
(TestGroup.prototype.didSetResult): Deleted since it was never used.
(TestGroup.prototype.compareTestResults): Now takes an array of measurement set values.
(TestGroup.prototype._valuesForCommitSet): Deleted.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane): This class now includes the form to cutomize the revisions.
(AnalysisTaskChartPane.prototype.setShowForm): Added.
(AnalysisTaskChartPane.prototype._mainSelectionDidChange):
(AnalysisTaskChartPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action when
the user presses the button to start a new A/B testing from the chart.
(AnalysisTaskChartPane.prototype.render): Added.
(AnalysisTaskChartPane.prototype.paneFooterTemplate): Added.
(AnalysisTaskChartPane.cssTemplate):

(AnalysisTaskResultsPane): Added. Encapsulates AnalysisResultsViewer and CustomizableTestGroupForm.
(AnalysisTaskResultsPane.prototype.setPoints): Added.
(AnalysisTaskResultsPane.prototype.setTestGroups): Added.
(AnalysisTaskResultsPane.prototype.setAnalysisResultsView): Added.
(AnalysisTaskResultsPane.prototype.setShowForm): Added.
(AnalysisTaskResultsPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action
when the user presses the button to start a new A/B testing from the chart.
(AnalysisTaskResultsPane.prototype.render): Added.
(AnalysisTaskResultsPane.htmlTemplate): Added.
(AnalysisTaskResultsPane.cssTemplate): Added.

(AnalysisTaskTestGroupPane): Added. Encapsulates TestGroupResultsTable and CustomizableTestGroupForm.
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): Added.
(AnalysisTaskTestGroupPane.prototype.setTestGroups): Added.
(AnalysisTaskTestGroupPane.prototype.setAnalysisResultsView): Added.
(AnalysisTaskTestGroupPane.prototype.render): Added.
(AnalysisTaskTestGroupPane.prototype._renderTestGroups): Added. Updates the list of test groups. Hide
the hidden groups unless showHiddenGroups is set. Updates this._testGroupMap so that the visibility of
groups and their names can be updated without having to re-render the entire list.
(AnalysisTaskTestGroupPane.prototype._renderTestGroupVisibility): Added.
(AnalysisTaskTestGroupPane.prototype._renderTestGroupNames): Added.
(AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added. Update TestGroupResultsTable with
the selected test group. Also highlight the list view, and update the hide-unhide toggle button's label
as needed.
(AnalysisTaskTestGroupPane.htmlTemplate): Added.
(AnalysisTaskTestGroupPane.cssTemplate): Added.

(AnalysisTaskPage): Deleted a massive number of instance variables. They are now manged by newly added
AnalysisTaskChartPane, AnalysisTaskResultsPane, and AnalysisTaskTestGroupPane
(AnalysisTaskPage.prototype.didConstructShadowTree): Added. Attach various event handlers here to avoid
eagerly creating the shadow tree in the constructor.
(AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
(AnalysisTaskPage.prototype._didFetchTask): No longer sets the value formatter to the results viewer
and the results table as they now recieve AnalysisResultsView later in _assignTestResultsIfPossible.
(AnalysisTaskPage.prototype._didFetchMeasurement): Set the metric to the results viewer.
(AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState):
(AnalysisTaskPage.prototype._assignTestResultsIfPossible): Create AnalysisResultsView from the newly
retrieved AnalysisResults and pass it to AnalysisTaskResultsPane and AnalysisTaskTestGroupPane.
(AnalysisTaskPage.prototype.render): Dramatically simplified.
(AnalysisTaskPage.prototype._renderTaskNameAndStatus): Extracted from render.
(AnalysisTaskPage.prototype._renderRelatedTasks): Ditto.
(AnalysisTaskPage.prototype._renderCauseAndFixes): Ditto.
(AnalysisTaskPage.prototype._showTestGroup):
(AnalysisTaskPage.prototype._updateTaskName): Now takes the new name as an argument.
(AnalysisTaskPage.prototype._updateTestGroupName): Now takes the new name as the second argument.
(AnalysisTaskPage.prototype._hideCurrentTestGroup): Now takes the test group to hide.
(AnalysisTaskPage.prototype._associateCommit): Moved to AnalysisTaskBugList.
(AnalysisTaskPage.prototype._dissociateCommit): Ditto.
(AnalysisTaskPage.prototype._retryCurrentTestGroup): Now takes the test group as the first argument.
(AnalysisTaskPage.prototype._chartSelectionDidChange): Deleted.
(AnalysisTaskPage.prototype._createNewTestGroupFromChart): Deleted.
(AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Deleted.
(AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Deleted.
(AnalysisTaskPage.htmlTemplate):
(AnalysisTaskPage.cssTemplate):

* unit-tests/test-groups-tests.js: Updated a test case which was expecting BuildReqeust's result, which
has been removed, to exist.

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

4 years agoMissing render tree position invalidation when tearing down renderers for display...
antti@apple.com [Tue, 28 Mar 2017 22:48:26 +0000 (22:48 +0000)]
Missing render tree position invalidation when tearing down renderers for display:contents subtree
https://bugs.webkit.org/show_bug.cgi?id=170199
<rdar://problem/31260856>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/shadow-dom/slot-renderer-teardown.html

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

    Invalidate the render tree position in case we do a teardown for an element without renderer.

LayoutTests:

* fast/shadow-dom/slot-renderer-teardown-expected.txt: Added.
* fast/shadow-dom/slot-renderer-teardown.html: Added.

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

4 years agoUnreviewed, rolling out r214485.
ryanhaddad@apple.com [Tue, 28 Mar 2017 22:32:43 +0000 (22:32 +0000)]
Unreviewed, rolling out r214485.

This change caused LayoutTest crashes.

Reverted changeset:

"Stop RTCDataChannel when closing page"
https://bugs.webkit.org/show_bug.cgi?id=170166
http://trac.webkit.org/changeset/214485

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

4 years agoApplePayShippingContactUpdate.idl shouldn't have status field
andersca@apple.com [Tue, 28 Mar 2017 22:26:25 +0000 (22:26 +0000)]
ApplePayShippingContactUpdate.idl shouldn't have status field
https://bugs.webkit.org/show_bug.cgi?id=170202
rdar://problem/31307106

Reviewed by Beth Dakin.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
If status isn't set, infer it based on whether there are errors present or not.

* Modules/applepay/ApplePayShippingContactUpdate.h:
Make status optional here; it's still used by the old code path.

* Modules/applepay/ApplePayShippingContactUpdate.idl:
Remove status here.

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

4 years agoWebAssembly: add fallback to use pinned register to load/store state
utatane.tea@gmail.com [Tue, 28 Mar 2017 22:16:01 +0000 (22:16 +0000)]
WebAssembly: add fallback to use pinned register to load/store state
https://bugs.webkit.org/show_bug.cgi?id=169773

Reviewed by Saam Barati.

This patch adds a new pinned register to hold JSWebAssemblyInstance,
which is used to represent the context of running Wasm code.
While we use fast TLS to hold the context in macOS, we do not have
any system reserved fast TLS slot in the other systems. This pinned
register approach is used in these systems. These changes decouple
VM from Wasm module to make Wasm module position independent code.

While using fast TLS could be beneficial in x64 systems which number of
registers is relatively small, pinned register approach could be
beneficial in ARM64 which has plenty of registers. In macOS, we can
switch the implementation with the runtime flag. Thus macOS port can
compare the performance and decide which implementation is used after
landing this patch.

* heap/MarkedBlock.h:
(JSC::MarkedBlock::offsetOfVM):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::loadWasmContext):
(JSC::AssemblyHelpers::storeWasmContext):
(JSC::AssemblyHelpers::loadWasmContextNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextNeedsMacroScratchRegister):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadWasmContext): Deleted.
(JSC::AssemblyHelpers::storeWasmContext): Deleted.
(JSC::AssemblyHelpers::loadWasmContextNeedsMacroScratchRegister): Deleted.
(JSC::AssemblyHelpers::storeWasmContextNeedsMacroScratchRegister): Deleted.
* jit/Repatch.cpp:
(JSC::webAssemblyOwner):
(JSC::linkFor):
(JSC::linkPolymorphicCall):
(JSC::isWebAssemblyToJSCallee): Deleted.
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromWasmThunkGenerator):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* runtime/JSCell.cpp:
(JSC::JSCell::isAnyWasmCallee):
* runtime/JSCellInlines.h:
(JSC::isWebAssemblyToJSCallee):
* runtime/JSType.h:
* runtime/StackFrame.cpp:
(JSC::StackFrame::functionName):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::wasmContextOffset):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::materializeWasmContext):
(JSC::Wasm::B3IRGenerator::restoreWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::getMemoryBaseAndSize):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::loadWasmContext): Deleted.
(JSC::Wasm::storeWasmContext): Deleted.
(JSC::Wasm::restoreWebAssemblyGlobalState): Deleted.
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
* wasm/WasmContext.cpp:
(JSC::loadWasmContext):
(JSC::storeWasmContext):
* wasm/WasmContext.h:
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::getPinnedRegisters):
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave):
(JSC::Wasm::useFastTLS):
(JSC::Wasm::useFastTLSForWasmContext):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::offsetOfCallee):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::finishCreation):
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::callee):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::create):
* wasm/js/WebAssemblyToJSCallee.cpp:
(JSC::WebAssemblyToJSCallee::create):
(JSC::WebAssemblyToJSCallee::createStructure):
(JSC::WebAssemblyToJSCallee::finishCreation):
(JSC::WebAssemblyToJSCallee::visitChildren):
(JSC::WebAssemblyToJSCallee::destroy): Deleted.
* wasm/js/WebAssemblyToJSCallee.h:

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

4 years agoFix Dashboard test _presentPopoverForJavaScriptCoreTestRegressions
aakash_jain@apple.com [Tue, 28 Mar 2017 22:14:49 +0000 (22:14 +0000)]
Fix Dashboard test _presentPopoverForJavaScriptCoreTestRegressions
https://bugs.webkit.org/show_bug.cgi?id=170193

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
Fixed the order of arguments.

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

4 years agoDashboard tests fails to fetch the revision from commits
aakash_jain@apple.com [Tue, 28 Mar 2017 21:56:10 +0000 (21:56 +0000)]
Dashboard tests fails to fetch the revision from commits
https://bugs.webkit.org/show_bug.cgi?id=170191

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js:
Added recordedCommitIndicesByRevisionNumber.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
(setup): Populated trac.recordedCommitIndicesByRevisionNumber since the dashboard code uses this variable.

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

4 years agoSafari crashes when attempting to close tab that is displaying PDF
timothy_horton@apple.com [Tue, 28 Mar 2017 21:43:49 +0000 (21:43 +0000)]
Safari crashes when attempting to close tab that is displaying PDF
https://bugs.webkit.org/show_bug.cgi?id=170201
<rdar://problem/31242019>

Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterNextStablePresentationUpdate:]):
Adopt BlockPtr to fix a leak.

(-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
dispatch_async in the doAfterNextPresentationUpdate callback; since this
recursively calls itself, in cases where doAfterNextPresentationUpdate
returns synchronously (e.g. if the Web Process is missing), we would
recurse infinitely.

* TestWebKitAPI/Tests/WebKit2Cocoa/DoAfterNextPresentationUpdateAfterCrash.mm:
(TEST):
Add a test for doAfterNextStablePresentationUpdate just like the existing
non-stable one.

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

4 years agoWeb Inspector: Add "Disable Caches" option that only applies to the inspected page...
bburg@apple.com [Tue, 28 Mar 2017 21:41:24 +0000 (21:41 +0000)]
Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
https://bugs.webkit.org/show_bug.cgi?id=169865
<rdar://problem/31250573>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Rename the command for disabling resource caching to match the WebCore::Page
flag. This also removes the possibility that this could be confused for the old,
buggy command that this patch rips out.

Source/WebCore:

Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
The old implementation was doing weird stuff like setting no-cache headers and evicting the
contents of the memory cache, neither of which is correct. The new approach has no side effects
on the network, disk, or memory cache so it can be turned on temporarily without causing problems.

New tests:
- http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
- http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html

* inspector/InspectorNetworkAgent.h:
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
(WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
Implement new command.

(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::mainFrameNavigated):
Remove crufty attempts to break caches. I believe these are intended to defeat caching
proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.

* page/Page.h:
(WebCore::Page::isResourceCachingDisabled):
(WebCore::Page::setResourceCachingDisabledOverride):
Add an override setting so that Web Inspector's override does not mess up the value
of isResourceCachingDisabled that may have been set by a WebKit API client.

Source/WebInspectorUI:

Hook up a button in the Network tab to WebCore::Page's resourceCachingDisabled flag.
If it is active, resource loads are subject to a cache policy that never uses a cached response.

* Localizations/en.lproj/localizedStrings.js:
Add localized strings.

* UserInterface/Base/Main.js:
(WebInspector.loaded):
Add a setting for whether to disable resource caching and inform the backend
of our preference. If someone changes the setting, tell the backend again.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
(WebInspector.NetworkGridContentView.prototype.get navigationItems):
(WebInspector.NetworkGridContentView.prototype._resourceCachingDisabledSettingChanged):
(WebInspector.NetworkGridContentView.prototype._toggleDisableResourceCache):
Add a new activatable navigation item that toggles disableResourceCaching for the inspected page.

* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
Update legacy backend commands to remove the old/broken Network.setCacheDisabled command.

LayoutTests:

Add tests that verify the new command works as expected when it disables resource caching.
I also manually verified that the override setting is cleared when Web Inspector disconnects.
This is not easy to check in a layout test since we rely on the Web Inspector to tell whether
a load happened or not.

* http/tests/inspector/network/set-resource-caching-disabled-disk-cache-expected.txt: Added.
* http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html: Added.
* http/tests/inspector/network/set-resource-caching-disabled-memory-cache-expected.txt: Added.
* http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html: Added.

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