WebKit-https.git
3 years ago[Modern Media Controls] Fix media/modern-media-controls/status-label/status-label...
graouts@webkit.org [Thu, 1 Dec 2016 18:38:51 +0000 (18:38 +0000)]
[Modern Media Controls] Fix media/modern-media-controls/status-label/status-label.html
https://bugs.webkit.org/show_bug.cgi?id=165259

Reviewed by Dean Jackson.

We broke the test at media/modern-media-controls/status-label/status-label.html with the
fix for https://bugs.webkit.org/show_bug.cgi?id=165239 since the test would test the
font-family for a StatusLabel which would only inherited to be -apple-system when hosted
in a MediaControls instance. We now remove this assertion and added a dedicated test
for when a StatusLabel is hosted in a MediaControls.

* media/modern-media-controls/status-label/status-label-expected.txt:
* media/modern-media-controls/status-label/status-label-font-expected.txt: Added.
* media/modern-media-controls/status-label/status-label-font.html: Added.
* media/modern-media-controls/status-label/status-label.html:

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

3 years agoMarking media/modern-media-controls/media-controller/media-controller-fullscreen...
ryanhaddad@apple.com [Thu, 1 Dec 2016 18:35:44 +0000 (18:35 +0000)]
Marking media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=165258

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years ago[WebIDL] Remove custom bindings for File and Blob constructors
weinig@apple.com [Thu, 1 Dec 2016 18:04:58 +0000 (18:04 +0000)]
[WebIDL] Remove custom bindings for File and Blob constructors
https://bugs.webkit.org/show_bug.cgi?id=165218

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/request-headers-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
Update results (still failing) to account for stricter rules about dictionary default values.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add/remove new files.

* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob): Deleted.
* bindings/js/JSFileCustom.cpp: Removed.
Remove custom constructors.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GenerateParametersCheck):
Add support for optional sequences without default values. Move string default value
optimizations into GenerateDefaultValue.

* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/Blob.idl:
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
* fileapi/File.idl:
Add support for the generated constructors.

* fileapi/BlobBuilder.cpp: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.cpp.
* fileapi/BlobBuilder.h: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.h.
* fileapi/WebKitBlobBuilder.cpp: Removed.
* fileapi/WebKitBlobBuilder.h: Removed.
Rename WebKitBlobBuilder to BlobBuilder, and update to work with generated constructor.

* fileapi/BlobPropertyBag.h: Added.
* fileapi/BlobPropertyBag.idl: Added.
Added.

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Avoid copies of the BlobPart Vector.

* platform/network/BlobPart.h:
Replace header-guards with #pragma once.

Source/WebKit2:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
Avoid copies of the BlobPart Vector.

LayoutTests:

* fast/files/blob-constructor-expected.txt:
* fast/files/file-constructor-expected.txt:
* fast/files/file-constructor.html:
* fast/files/script-tests/blob-constructor.js:
Update for stricter parsing and changed error text. (The error text
is regressed, but consistent with all generated bindings. I will work
on making improvements on this soon.)

* http/tests/fetch/fetch-as-blob.js:
Update to account for stricter rules about dictionary default values.

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

3 years agoMarking media/modern-media-controls/audio/audio-controls-buttons.html as a timeout.
ryanhaddad@apple.com [Thu, 1 Dec 2016 17:48:28 +0000 (17:48 +0000)]
Marking media/modern-media-controls/audio/audio-controls-buttons.html as a timeout.
https://bugs.webkit.org/show_bug.cgi?id=165234

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[Modern Media Controls] Provide a UI object to show a list of tracks
graouts@webkit.org [Thu, 1 Dec 2016 16:16:38 +0000 (16:16 +0000)]
[Modern Media Controls] Provide a UI object to show a list of tracks
https://bugs.webkit.org/show_bug.cgi?id=165239

Reviewed by Dean Jackson.

We add a new TracksPanel object which we will be using to display a list of
audio and text tracks. The tracks panel can be shown by calling showTracksPanel()
on a MacOSMediaControls object and will be dismissed by hitting the Escape key
or mousing down outside of the panel's bounds. While the tracks panel is up,
arrows can be used to focus individual tracks which can be activated by either
pressing the Space bar or Enter key.

Activating a track will briefly animate its background to indicate selection and
dismissing the tracks panel is also animated with a quick fade-out animation.

Data for the tracks panel is provided by specifying a dataSource property and
implementing the required methods to provide the number of sections in the panel,
the number of tracks in each section, etc.

Tests: media/modern-media-controls/tracks-panel/tracks-panel-hide-click-outside.html
       media/modern-media-controls/tracks-panel/tracks-panel-hide-esc-key.html
       media/modern-media-controls/tracks-panel/tracks-panel-hide.html
       media/modern-media-controls/tracks-panel/tracks-panel-population.html
       media/modern-media-controls/tracks-panel/tracks-panel-right-x.html
       media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-keyboard.html
       media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-mouse.html
       media/modern-media-controls/tracks-panel/tracks-panel.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen):
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen .tracks-panel):
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .tracks-panel):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
(MacOSMediaControls.prototype.hideTracksPanel):
(MacOSMediaControls):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
* Modules/modern-media-controls/controls/placard.css:
(.placard):
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/tracks-panel.css: Added.
(.tracks-panel):
(.tracks-panel *):
(.tracks-panel.fade-out):
(.tracks-panel-section):
(.tracks-panel-section:first-of-type):
(.tracks-panel-section > h3):
(.tracks-panel-section > ul):
(.tracks-panel-section > ul > li):
(.tracks-panel-section > ul > li:focus):
(.tracks-panel-section > ul > li.selected:before):
(.tracks-panel-section > ul > li.animated):
(@keyframes tracks-panel-item-selection):
(22.22%):
* Modules/modern-media-controls/controls/tracks-panel.js: Added.
(TracksPanel.prototype.get presented):
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
(TracksPanel.prototype.get rightX):
(TracksPanel.prototype.set rightX):
(TracksPanel.prototype.trackNodeSelectionAnimationDidEnd):
(TracksPanel.prototype.mouseMovedOverTrackNode):
(TracksPanel.prototype.mouseExitedTrackNode):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype.handleEvent):
(TracksPanel.prototype._childrenFromDataSource.):
(TracksPanel.prototype._childrenFromDataSource):
(TracksPanel.prototype._handleMousedown):
(TracksPanel.prototype._handleKeydown):
(TracksPanel.prototype._dismiss):
(TracksPanel.prototype._focusTrackNode):
(TracksPanel.prototype._focusPreviousTrackNode):
(TracksPanel.prototype._focusNextTrackNode):
(TracksPanel.prototype._focusFirstTrackNode):
(TracksPanel.prototype._focusLastTrackNode):
(TrackNode):
(TrackNode.prototype.activate):
(TrackNode.prototype.handleEvent):
(TrackNode.prototype._animationDidEnd):
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoLog some basic memory usage stats at interesting points in time
akling@apple.com [Thu, 1 Dec 2016 16:15:27 +0000 (16:15 +0000)]
Log some basic memory usage stats at interesting points in time
<https://webkit.org/b/165206>

Reviewed by Antti Koivisto.

This patch adds a mechanism to mark points of interests where we might
want to do performance-related logging:

    class PerformanceLogging {
        enum PointOfInterest {
            MainFrameLoadStarted,
            MainFrameLoadCompleted,
        }
        void didReachPointOfInterest(PointOfInterest)
    }

You get to this object via MainFrame::performanceLogging().

We respond to these callbacks by logging some basic data about memory usage
to the PerformanceLogging channel.

More PointOfInterest values will be added soon.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::setState):
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
* page/PerformanceLogging.cpp: Added.
(WebCore::toString):
(WebCore::getMemoryUsageStatistics):
(WebCore::PerformanceLogging::PerformanceLogging):
(WebCore::writeLog):
(WebCore::PerformanceLogging::didReachPointOfInterest):
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* page/PerformanceLogging.h: Added.
* page/cocoa/PerformanceLoggingCocoa.mm: Added.
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* platform/Logging.h:

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

3 years ago[css-grid] Move more attributes from RenderGrid to the new Grid class
svillar@igalia.com [Thu, 1 Dec 2016 11:05:22 +0000 (11:05 +0000)]
[css-grid] Move more attributes from RenderGrid to the new Grid class
https://bugs.webkit.org/show_bug.cgi?id=165094

Reviewed by Darin Adler.

Moved more attributes from RenderGrid to Grid as they are not really part of the state of
the RenderGrid object. In particular m_autoRepeat{Columns|Rows},
m_autoRepeatEmpty{Columns|Rows} and m_orderIterator. All of them are now private attributes
of the Grid class so clients should use the getters/setters provided by this patch.

This change allows to definitely remove the grid{Column|Row}Count() methods from
RenderGrid. These two became Grid::numTracks() which returns the number of tracks in the
data structure used to represent the grid (currently a matrix). Contrary to that,
RenderGrid::numTracks() returns the actual size of the grid.

No new tests as this is a refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::numTracks):
(WebCore::RenderGrid::Grid::ensureGridSize):
(WebCore::RenderGrid::Grid::setAutoRepeatTracks):
(WebCore::RenderGrid::Grid::autoRepeatTracks):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows):
(WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack):
(WebCore::RenderGrid::Grid::autoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::gridItemSpan):
(WebCore::RenderGrid::Grid::clear):
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackSizesForDirection):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::rawGridTrackSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::numTracks):
(WebCore::RenderGrid::paintChildren):
(WebCore::RenderGrid::gridColumnCount): Deleted.
(WebCore::RenderGrid::gridRowCount): Deleted.
(WebCore::RenderGrid::hasAutoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::isEmptyAutoRepeatTrack): Deleted.
(WebCore::RenderGrid::cachedGridSpan): Deleted.
* rendering/RenderGrid.h:
(WebCore::RenderGrid::autoRepeatCountForDirection): Deleted.

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

3 years agoIntroduce StringImpl::StaticStringImpl with constexpr constructor
utatane.tea@gmail.com [Thu, 1 Dec 2016 09:24:21 +0000 (09:24 +0000)]
Introduce StringImpl::StaticStringImpl with constexpr constructor
https://bugs.webkit.org/show_bug.cgi?id=165093

Reviewed by Darin Adler.

Source/WTF:

This patch adds new class, StringImpl::StaticStringImpl.
By using this class, we can easily create static StringImpls.
This class has constexpr constructor. You can initialize instances
of this class as global static variables without invoking global
constructors.

We already have similar system, StaticASCIILiteral. But using it
requires some special perl script since we need to calculate
hash value. On the other hand, we can use StaticStringImpl without
any script supports since we implement constexpr hash function.
In the future, we will replace all the use of StaticASCIILiteral
with this StaticStringImpl.

We define empty / null strings as StaticStringImpl. And we make
StringImpl::empty() & StringImpl::null() inline functions.

* wtf/Hasher.h:
(WTF::StringHasher::hashWithTop8BitsMasked):
(WTF::StringHasher::hash):
(WTF::StringHasher::finalize):
(WTF::StringHasher::finalizeAndMaskTop8Bits):
(WTF::StringHasher::computeLiteralHash):
(WTF::StringHasher::computeLiteralHashAndMaskTop8Bits):
(WTF::StringHasher::avalancheBits3):
(WTF::StringHasher::avalancheBits2):
(WTF::StringHasher::avalancheBits1):
(WTF::StringHasher::avalancheBits0):
(WTF::StringHasher::avalancheBits):
(WTF::StringHasher::avoidZero):
(WTF::StringHasher::processPendingCharacter):
(WTF::StringHasher::calculateWithRemainingLastCharacter1):
(WTF::StringHasher::calculateWithRemainingLastCharacter0):
(WTF::StringHasher::calculateWithRemainingLastCharacter):
(WTF::StringHasher::calculate1):
(WTF::StringHasher::calculate0):
(WTF::StringHasher::calculate):
(WTF::StringHasher::computeLiteralHashImpl):
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
(WTF::StringImpl::StaticStringImpl::StaticStringImpl):
(WTF::StringImpl::null):
(WTF::StringImpl::empty):
* wtf/text/StringStatics.cpp:
(WTF::StringImpl::null): Deleted.
(WTF::StringImpl::empty): Deleted.

Tools:

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):

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

3 years ago[Win] Skip failing JSC tests.
pvollan@apple.com [Thu, 1 Dec 2016 09:22:51 +0000 (09:22 +0000)]
[Win] Skip failing JSC tests.
https://bugs.webkit.org/show_bug.cgi?id=165140

Reviewed by Mark Lam.

* ChakraCore.yaml:
* microbenchmarks/tan.js:

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

3 years ago[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
carlosgc@webkit.org [Thu, 1 Dec 2016 07:51:51 +0000 (07:51 +0000)]
[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
https://bugs.webkit.org/show_bug.cgi?id=164911

Reviewed by Michael Catanzaro.

The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
image. We only use the buffer to get the image size, so we could save the image size when the image is created,
and then we don't need to care about the buffer anymore.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:

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

3 years agoUnreviewed, rolling out r209168.
beidson@apple.com [Thu, 1 Dec 2016 07:05:42 +0000 (07:05 +0000)]
Unreviewed, rolling out r209168.

Caused 2 API tests to fail

Reverted changeset:

"IndexedDB: When doing puts, don't
"updateAllIndexesForAddRecord" if there are no indexes."
https://bugs.webkit.org/show_bug.cgi?id=165215
http://trac.webkit.org/changeset/209168

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

3 years agoWebAssembly: update binary format to 0xD version
jfbastien@apple.com [Thu, 1 Dec 2016 07:04:18 +0000 (07:04 +0000)]
WebAssembly: update binary format to 0xD version
https://bugs.webkit.org/show_bug.cgi?id=164724

Reviewed by Saam Barati.

As described in the following PR: https://github.com/WebAssembly/design/pull/836

JSTests:

* wasm/Builder.js:
(const._normalizeFunctionSignature):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Type):
(const.emitters.Code):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.block_type):
(export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
* wasm/WASM.js:
* wasm/js-api/test_basic_api.js:
* wasm/self-test/test_BuilderWebAssembly.js:
(EmptyModule):
(CustomSection):
* wasm/self-test/test_WASM.js:
* wasm/wasm.json:

Source/JavaScriptCore:

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::zeroForType):
(JSC::Wasm::B3IRGenerator::addConstant):
(JSC::Wasm::createJSWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::marshallArgument):
* wasm/WasmFormat.cpp:
(JSC::Wasm::toString): Deleted.
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
(JSC::Wasm::toB3Type): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
(JSC::Wasm::ModuleParser::parseType):
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseResultType):
* wasm/generateWasm.py:
(Wasm.__init__):
* wasm/generateWasmOpsHeader.py:
(cppMacro):
(typeMacroizer):
(opcodeMacroizer):
* wasm/wasm.json:

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

3 years agoBuild break when using --minimal
gyuyoung.kim@webkit.org [Thu, 1 Dec 2016 05:25:24 +0000 (05:25 +0000)]
Build break when using --minimal
https://bugs.webkit.org/show_bug.cgi?id=165238

Reviewed by Darin Adler.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Use #if ENABLE(VIDEO_TRACK) guard.

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

3 years agoRoll out StringBuilder changes from the previous patch.
darin@apple.com [Thu, 1 Dec 2016 04:32:50 +0000 (04:32 +0000)]
Roll out StringBuilder changes from the previous patch.
They were a slowdown on a Kraken JSON test.

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

3 years ago[JSC] Specifying same module entry point multiple times cause TypeError
utatane.tea@gmail.com [Thu, 1 Dec 2016 03:56:12 +0000 (03:56 +0000)]
[JSC] Specifying same module entry point multiple times cause TypeError
https://bugs.webkit.org/show_bug.cgi?id=164858

Reviewed by Saam Barati.

Source/JavaScriptCore:

Allow importing the same module multiple times. Previously, when specifying the same
module in the <script type="module" src="here">, it throws TypeError.

* builtins/ModuleLoaderPrototype.js:
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestSatisfy):

LayoutTests:

* js/dom/modules/module-load-same-module-from-different-entry-point-in-src-expected.txt: Added.
* js/dom/modules/module-load-same-module-from-different-entry-point-in-src.html: Added.

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

3 years agoWebAssembly JS API: export a module namespace object instead of a module environment
utatane.tea@gmail.com [Thu, 1 Dec 2016 03:54:24 +0000 (03:54 +0000)]
WebAssembly JS API: export a module namespace object instead of a module environment
https://bugs.webkit.org/show_bug.cgi?id=165121

Reviewed by Saam Barati.

This patch setup AbstractModuleRecord further for WebAssemblyModuleRecord.
For exported entries in a wasm instance, we set up exported entries for
AbstractModuleRecord. This allows us to export WASM exported functions in
the module handling code.

Since the exported entries in the abstract module record are correctly
instantiated, the module namespace object for WASM module also starts
working correctly. So we start exposing the module namespace object
as `instance.exports` instead of the module environment object.

And we move SourceCode, lexicalVariables, and declaredVariables fields to
JSModuleRecord since they are related to JS source code (in the spec words,
they are related to the source text module record).

* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::AbstractModuleRecord):
* runtime/AbstractModuleRecord.h:
(JSC::AbstractModuleRecord::sourceCode): Deleted.
(JSC::AbstractModuleRecord::declaredVariables): Deleted.
(JSC::AbstractModuleRecord::lexicalVariables): Deleted.
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::JSModuleRecord):
* runtime/JSModuleRecord.h:
(JSC::JSModuleRecord::sourceCode):
(JSC::JSModuleRecord::declaredVariables):
(JSC::JSModuleRecord::lexicalVariables):
* wasm/WasmFormat.cpp:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finishCreation):
* wasm/js/WebAssemblyFunction.cpp:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::create):
(JSC::WebAssemblyModuleRecord::WebAssemblyModuleRecord):
(JSC::WebAssemblyModuleRecord::finishCreation):
WebAssemblyModuleRecord::link should perform linking things.
So allocating exported entries should be done here.
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyModuleRecord.h:

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

3 years ago[Modern Media Controls] Add support for right-to-left layouts
commit-queue@webkit.org [Thu, 1 Dec 2016 03:20:30 +0000 (03:20 +0000)]
[Modern Media Controls] Add support for right-to-left layouts
https://bugs.webkit.org/show_bug.cgi?id=165229

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

Source/WebCore:

We implement the "usesLTRUserInterfaceLayoutDirection" property which is set by HTMLMediaElement
and set a CSS class when the layout is left-to-right, flipping the fullscreen volume slider in the
case that it would not be present (right-to-left).

Test: media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get usesLTRUserInterfaceLayoutDirection):
(MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype._updateControlsIfNeeded):

LayoutTests:

Add a test that toggles the layout direction and checks we correctly flip the volume slider.

* media/modern-media-controls/media-controller/media-controller-fullscreen-ltr-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoWeb Inspector: Remove unused parameter of InspectorInstrumentation::didFinishXHRLoading
commit-queue@webkit.org [Thu, 1 Dec 2016 03:16:13 +0000 (03:16 +0000)]
Web Inspector: Remove unused parameter of InspectorInstrumentation::didFinishXHRLoading
https://bugs.webkit.org/show_bug.cgi?id=165233

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

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
Remove unused ThreadableLoaderClient parameter.

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

3 years agoIndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no...
beidson@apple.com [Thu, 1 Dec 2016 02:42:28 +0000 (02:42 +0000)]
IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes.
https://bugs.webkit.org/show_bug.cgi?id=165215

Reviewed by Alex Christensen.

No new tests (No observable behavior change).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes.
  Avoiding this saved us some IDBKey serialization and Javascript object manipulation.

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

3 years ago[Modern Media Controls] LayoutNode: only mark properties as dirty if different than...
commit-queue@webkit.org [Thu, 1 Dec 2016 02:33:04 +0000 (02:33 +0000)]
[Modern Media Controls] LayoutNode: only mark properties as dirty if different than current value
https://bugs.webkit.org/show_bug.cgi?id=165236

Patch by Antoine Quint <graouts@apple.com> on 2016-11-30
Reviewed by Simon Fraser.

Source/WebCore:

Check that the new value is different than the current value before marking the property as dirty.

* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set x):
(LayoutNode.prototype.set y):
(LayoutNode.prototype.set width):
(LayoutNode.prototype.set height):
(LayoutNode.prototype.set visible):
(performScheduledLayout):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.get hasScheduledLayoutCallbacks):

LayoutTests:

Update LayoutNode property tests to check that setting a given property to the
same value doesn't schedule an update.

* media/modern-media-controls/layout-node/height-expected.txt:
* media/modern-media-controls/layout-node/height.html:
* media/modern-media-controls/layout-node/visible-expected.txt:
* media/modern-media-controls/layout-node/visible.html:
* media/modern-media-controls/layout-node/width-expected.txt:
* media/modern-media-controls/layout-node/width.html:
* media/modern-media-controls/layout-node/x-expected.txt:
* media/modern-media-controls/layout-node/x.html:
* media/modern-media-controls/layout-node/y-expected.txt:
* media/modern-media-controls/layout-node/y.html:

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

3 years agoSubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
jiewen_tan@apple.com [Thu, 1 Dec 2016 01:11:11 +0000 (01:11 +0000)]
SubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
https://bugs.webkit.org/show_bug.cgi?id=164744
<rdar://problem/29258083>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Since we don't support any cryptography algorithms that has deriveKey operations,
SubtleCrypto::deriveKey will always return NOT_SUPPORTED_ERR for now.

Test: crypto/subtle/deriveKey-malformed-parameters.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveKeyPromise):
(WebCore::JSSubtleCrypto::deriveKey):
* crypto/SubtleCrypto.idl:

LayoutTests:

* crypto/subtle/deriveKey-malformed-parameters-expected.txt: Added.
* crypto/subtle/deriveKey-malformed-parameters.html: Added.

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

3 years agoWebAssembly builder: don't throw when checker not implemented
jfbastien@apple.com [Thu, 1 Dec 2016 01:03:02 +0000 (01:03 +0000)]
WebAssembly builder: don't throw when checker not implemented
https://bugs.webkit.org/show_bug.cgi?id=165219

Reviewed by Mark Lam.

We should perform whichever checks we've implemented, and assume the rest are OK until bug #163421 is fixed.

* wasm/Builder.js:
* wasm/README.md:
* wasm/function-tests/add-12.js:
* wasm/function-tests/br-if-loop-less-than.js:
* wasm/function-tests/brTableAsIf.js:
* wasm/function-tests/brTableManyValues.js:
* wasm/function-tests/brTableWithLoop.js:
* wasm/function-tests/dumb-eq-if-then-else.js:
* wasm/function-tests/dumb-less-than-fallthrough.js:
* wasm/function-tests/dumb-less-than-ite.js:
* wasm/function-tests/eqz.js:
* wasm/function-tests/factorial.js:
* wasm/function-tests/float-sub.js:
* wasm/function-tests/i32-load.js:
* wasm/function-tests/i32-load8-s.js:
* wasm/function-tests/if-then-else-fallthrough.js:
* wasm/function-tests/if-then-fallthrough.js:
* wasm/function-tests/loop-mult.js:
* wasm/function-tests/loop-sum.js:
* wasm/function-tests/max.js:
* wasm/function-tests/min.js:
* wasm/function-tests/ret5.js:
* wasm/function-tests/select.js:
* wasm/self-test/test_BuilderJSON.js:

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

3 years agoUpdate SubtleCrypto::digest to match the latest spec
jiewen_tan@apple.com [Thu, 1 Dec 2016 00:28:04 +0000 (00:28 +0000)]
Update SubtleCrypto::digest to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164742
<rdar://problem/29258037>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* WebCryptoAPI/digest/test_digest-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch updates the SubtleCrypto::digest method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-digest.
Currently supported digest algorithms are SHA-1, SHA-224, SHA-256, SHA-384,
and SHA-512.

Tests: crypto/subtle/digest-malformed-parameters.html
       crypto/subtle/sha1-digest.html
       crypto/subtle/sha224-digest.html
       crypto/subtle/sha256-digest.html
       crypto/subtle/sha384-digest.html
       crypto/subtle/sha512-digest.html
       crypto/workers/subtle/sha1-digest.html
       crypto/workers/subtle/sha224-digest.html
       crypto/workers/subtle/sha256-digest.html
       crypto/workers/subtle/sha384-digest.html
       crypto/workers/subtle/sha512-digest.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionDigestPromise):
(WebCore::JSSubtleCrypto::digest):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::digest):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.h:

LayoutTests:

* crypto/subtle/digest-malformed-parameters-expected.txt: Added.
* crypto/subtle/digest-malformed-parameters.html: Added.
* crypto/subtle/sha1-digest-expected.txt: Added.
* crypto/subtle/sha1-digest.html: Added.
* crypto/subtle/sha224-digest-expected.txt: Added.
* crypto/subtle/sha224-digest.html: Added.
* crypto/subtle/sha256-digest-expected.txt: Added.
* crypto/subtle/sha256-digest.html: Added.
* crypto/subtle/sha384-digest-expected.txt: Added.
* crypto/subtle/sha384-digest.html: Added.
* crypto/subtle/sha512-digest-expected.txt: Added.
* crypto/subtle/sha512-digest.html: Added.
* crypto/workers/subtle/resources/sha1-digest.js: Added.
* crypto/workers/subtle/resources/sha224-digest.js: Added.
* crypto/workers/subtle/resources/sha256-digest.js: Added.
* crypto/workers/subtle/resources/sha384-digest.js: Added.
* crypto/workers/subtle/resources/sha512-digest.js: Added.
* crypto/workers/subtle/sha1-digest-expected.txt: Added.
* crypto/workers/subtle/sha1-digest.html: Added.
* crypto/workers/subtle/sha224-digest-expected.txt: Added.
* crypto/workers/subtle/sha224-digest.html: Added.
* crypto/workers/subtle/sha256-digest-expected.txt: Added.
* crypto/workers/subtle/sha256-digest.html: Added.
* crypto/workers/subtle/sha384-digest-expected.txt: Added.
* crypto/workers/subtle/sha384-digest.html: Added.
* crypto/workers/subtle/sha512-digest-expected.txt: Added.
* crypto/workers/subtle/sha512-digest.html: Added.

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

3 years ago[Modern Media Controls] UI Library: <audio> controls
graouts@webkit.org [Thu, 1 Dec 2016 00:14:19 +0000 (00:14 +0000)]
[Modern Media Controls] UI Library: <audio> controls
https://bugs.webkit.org/show_bug.cgi?id=164619
<rdar://problem/29207215>

Reviewed by Dean Jackson.

Add a default size for <audio> elements (200x50).

Tests: media/modern-media-controls/audio/audio-controls-buttons.html
       media/modern-media-controls/audio/audio-controls-metrics.html

* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):

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

3 years agoTypeInfo::OutOfLineTypeFlags should be 16 bits in size.
mark.lam@apple.com [Thu, 1 Dec 2016 00:10:44 +0000 (00:10 +0000)]
TypeInfo::OutOfLineTypeFlags should be 16 bits in size.
https://bugs.webkit.org/show_bug.cgi?id=165224

Reviewed by Saam Barati.

There's no reason for OutOfLineTypeFlags to be constraint to 8 bits since the
space is available to us.  Making OutOfLineTypeFlags 16 bits brings TypeInfo up
to 32 bits in size from the current 24 bits.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):

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

3 years ago[Modern Media Controls] Add an HTML comment flag to turn the feature on
graouts@webkit.org [Thu, 1 Dec 2016 00:10:28 +0000 (00:10 +0000)]
[Modern Media Controls] Add an HTML comment flag to turn the feature on
https://bugs.webkit.org/show_bug.cgi?id=165226

Reviewed by Dean Jackson.

Source/WebKit2:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetModernMediaControlsEnabled):
(WKPreferencesGetModernMediaControlsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

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

3 years agoREGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
beidson@apple.com [Wed, 30 Nov 2016 23:53:23 +0000 (23:53 +0000)]
REGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
https://bugs.webkit.org/show_bug.cgi?id=165216

Rubberstamped by Tim Horton.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB): Change invalid ASSERT into a null check.

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

3 years agoAdd separate settings and preferences to enable/disable async decoding for large...
commit-queue@webkit.org [Wed, 30 Nov 2016 23:48:00 +0000 (23:48 +0000)]
Add separate settings and preferences to enable/disable async decoding for large images and animated images
https://bugs.webkit.org/show_bug.cgi?id=165177

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-11-30
Reviewed by Simon Fraser.
Source/WebCore:

Instead of having the async image decoding be controlled by one setting,
two separate settings are added:
    largeImageAsyncDecodingEnabled
    animatedImageAsyncDecodingEnabled

And an existing setting is removed:
    asyncImageDecodingEnabled

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImage.h:
* page/Settings.in:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageObserver.h:

Source/WebKit/mac:

Hook up the async image decoding settings for WebKit1.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences largeImageAsyncDecodingEnabled]):
(-[WebPreferences setLargeImageAsyncDecodingEnabled:]):
(-[WebPreferences animatedImageAsyncDecodingEnabled]):
(-[WebPreferences setAnimatedImageAsyncDecodingEnabled:]):
(-[WebPreferences asyncImageDecodingEnabled]): Deleted.
(-[WebPreferences setAsyncImageDecodingEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Hook up the async image decoding settings for WebKit2.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _largeImageAsyncDecodingEnabled]):
(-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
(-[WKPreferences _animatedImageAsyncDecodingEnabled]):
(-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
(-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
(-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Pref and a menu item to toggle async image decoding settings for WebKits 1 and 2.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleLargeImageAsyncDecodingEnabled:]):
(-[SettingsController largeImageAsyncDecodingEnabled]):
(-[SettingsController toggleAnimatedImageAsyncDecodingEnabled:]):
(-[SettingsController animatedImageAsyncDecodingEnabled]):
(-[SettingsController toggleAsyncImageDecodingEnabled:]): Deleted.
(-[SettingsController asyncImageDecodingEnabled]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

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

3 years agoASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFrom...
zalan@apple.com [Wed, 30 Nov 2016 23:12:45 +0000 (23:12 +0000)]
ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
https://bugs.webkit.org/show_bug.cgi?id=155364
<rdar://problem/27720461>

Reviewed by David Hyatt.

Source/WebCore:

RenderNamedFlowThread is considered to be a root for the current renderer context so
we need to bail out from the containing block traversal here (like we do for the RenderView).

Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):

LayoutTests:

* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.

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

3 years agoIndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
beidson@apple.com [Wed, 30 Nov 2016 22:59:28 +0000 (22:59 +0000)]
IndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
https://bugs.webkit.org/show_bug.cgi?id=165221

Reviewed by Myles C. Maxfield.

No new tests (No observable behavior change).

On a profile of "Lots of writes to an IndexedDB", timer scheduling/firing presented as over 10% of the time.

This patch negates much of that.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::pendingOperationTimerFired): Send 100 operations off to the server
  before spinning the runloop, instead of only 1.

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

3 years ago[Modern Media Controls] Controls are not visible when returning from picture-in-pictu...
commit-queue@webkit.org [Wed, 30 Nov 2016 22:45:38 +0000 (22:45 +0000)]
[Modern Media Controls] Controls are not visible when returning from picture-in-picture playback
https://bugs.webkit.org/show_bug.cgi?id=165183

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

We need to call MediaControlsHost::setPreparedToReturnVideoLayerToInline() when we return from
picture-in-picture playback such that the video layer is correctly stacked under the media controls.
We call that function in a rAF call to ensure it's performed in sync with the next scheduled layout
or the media controls would not appear in sync with the video layer.

We also fix an error from a previous commit in ControlsVisibilitySupport.

* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.syncControl):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):

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

3 years agoUpdate SubtleCrypto::wrapKey to match the latest spec
jiewen_tan@apple.com [Wed, 30 Nov 2016 22:26:10 +0000 (22:26 +0000)]
Update SubtleCrypto::wrapKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164746
<rdar://problem/29258160>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::wrapKey method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-wrapKey.
2. It implements wrapKey operations of the following algorithms: AES-KW.
3. It also replaces JSSubtleCrypto* with auto in all promise functions.

Tests: crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html
       crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html
       crypto/subtle/aes-kw-import-key-wrap-raw-key.html
       crypto/subtle/aes-kw-wrap-key-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html
       crypto/subtle/wrapKey-malformed-parameters.html
       crypto/workers/subtle/aes-cbc-import-key-wrap-key.html
       crypto/workers/subtle/aes-kw-import-key-wrap-key.html
       crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::supportExportKeyThrow):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::JSSubtleCrypto::wrapKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::wrapKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::wrapKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::wrapKeyAES_KW):
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformEncrypt):

LayoutTests:

* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html: Added.
* crypto/subtle/aes-kw-import-key-wrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-kw-import-key-wrap-raw-key.html: Added.
* crypto/subtle/aes-kw-wrap-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-kw-wrap-key-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html: Added.
* crypto/subtle/wrapKey-malformed-parameters-expected.txt: Added.
* crypto/subtle/wrapKey-malformed-parameters.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-wrap-key.html: Added.
* crypto/workers/subtle/aes-kw-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-kw-import-key-wrap-key.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-wrap-key.js: Added.
* crypto/workers/subtle/resources/aes-kw-import-key-wrap-key.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-wrap-key.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html: Added.

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

3 years agoREGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
commit-queue@webkit.org [Wed, 30 Nov 2016 22:21:16 +0000 (22:21 +0000)]
REGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
https://bugs.webkit.org/show_bug.cgi?id=164388
<rdar://problem/29101555>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-11-30
Reviewed by Saam Barati.

Source/JavaScriptCore:

There was a possibility of a deadlock between the main thread and the GC thread
with the SamplingProfiler lock when Inspector is processing samples to send to
the frontend. The Inspector (main thread) was holding the SamplingProfiler lock
while processing samples, which runs JavaScript that could trigger a GC, and
GC then tries to acquire the SamplingProfiler lock to process unprocessed samples.

A simple solution here is to tighten the bounds of when Inspector holds the
SamplingProfiler lock. It only needs the lock when extracting samples from
the SamplingProfiler. It doesn't need to hold the lock for processing those
samples, which is what can run script and cause a GC.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
Tighten bounds of this lock to only where it is needed.

LayoutTests:

* platform/mac/TestExpectations:
Unskip now that tests are no longer flakey.

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

3 years ago[WebIDL] Add support for more missing / exotic IDLTypes
weinig@apple.com [Wed, 30 Nov 2016 22:10:49 +0000 (22:10 +0000)]
[WebIDL] Add support for more missing / exotic IDLTypes
https://bugs.webkit.org/show_bug.cgi?id=165156

Reviewed by Alex Christensen.

- Adds JSDOMConvert support for WebIDL's 'callback interface' and 'callback function'.
- Adds JSDOMConvert support for WebIDL extensions for SerializedScriptValue, Dictionary,
  EventListener and XPathNSResolver (moving much of their special casing out of perl and
  into JSDOMConvert).

* DerivedSources.make:
Adds $(WebCore)/testing to the list of available IDL directories to keep internals
compiling.

* Modules/webaudio/WaveShaperNode.cpp:
* Modules/webaudio/WaveShaperNode.h:
Update to take curve by reference.

* bindings/generic/IDLTypes.h:
(WebCore::IDLWrapper):
Add helper type, IDLWrapper, which serves as a base type for all IDLTypes that are
RefCounted.

* bindings/js/JSDOMConvert.h:
(WebCore::convert):
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convertNewlyCreated):
(WebCore::Converter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convertNewlyCreated):
(WebCore::Converter<IDLSerializedScriptValue<T>>::convert):
(WebCore::JSConverter<IDLSerializedScriptValue<T>>::convert):
(WebCore::Converter<IDLLegacyDictionary<T>>::convert):
(WebCore::Converter<IDLEventListener<T>>::convert):
(WebCore::Converter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated):
Add converters for the new types. IDLSerializedScriptValue, IDLLegacyDictionary, IDLEventListener and IDLXPathNSResolver
have been templatized to avoid including their implementation classes everywhere. We can improve this in the future by
splitting JSDOMConvert up into to separate files.

* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
(IsInterfaceType):
(IsWrapperType):
(ComputeIsCallbackInterface):
(ComputeIsCallbackFunction):
Add new predicates, IsBuiltinType and IsInterfaceType, and re-work IsWrapperType to determine all types that
have a JS wrapper (and consequently a JS{name}.h file).

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
Update to add include for EventListener.

(GetArgumentExceptionFunction):
(GetArgumentExceptionThrower):
(GetAttributeExceptionFunction):
(GetAttributeExceptionThrower):
Add support for exceptions for callbacks.

(PassArgumentExpression):
Factor out logic on how to pass arguments to C++.

(GenerateHeader):
Make toWrapped and JSDOMWrapperConverterTraits work with XPathNSResolver.

(GenerateImplementation):
Update to use PassArgumentExpression and pass a global object reference to JSValueToNative.

(GenerateParametersCheck):
Remove special casing for callbacks.

(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Simplify toJS functions. State and global object are not necessary.

(GetBaseIDLType):
Add support for new types. Add assertion so that unknown types can't get through.

(ShouldPassArgumentByReference):
Rename from ShouldPassWrapperByReference, and merge in CodeGenerator's ShouldPassWrapperByReference.

(JSValueToNativeDOMConvertNeedsThisObject):
Added. Predicate to determine types that need a this object for conversion.

(JSValueToNativeDOMConvertNeedsGlobalObject):
Added. Predicate to determine types that need a global object for conversion.

(JSValueToNative):
Remove special cases for new types.

(NativeToJSValueDOMConvertNeedsState):
Add SerializedScriptValue and XPathNSResolver.

(NativeToJSValueDOMConvertNeedsGlobalObject):
Add SerializedScriptValue and XPathNSResolver.

(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused $statePointer and replace $globalObject with $globalObjectReference. Remove
special cases for new types.

(GenerateConstructorDefinition):
Use PassArgumentExpression.

* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerializedScriptValueInterface.idl:
Update tests. Remove test for a readonly attribute returning a Promise, which is not supported
yet (this was caught by the assertion added to GetBaseIDLType). Add tests for passing and returning
SerializedScriptValues from functions.

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

3 years agoSkipping crashing test js/dom/modules/module-will-fire-beforeload.html.
ryanhaddad@apple.com [Wed, 30 Nov 2016 21:42:40 +0000 (21:42 +0000)]
Skipping crashing test js/dom/modules/module-will-fire-beforeload.html.
https://bugs.webkit.org/show_bug.cgi?id=164883

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years ago[iOS][WK2] Turn on HTML interactive form validation feature
cdumez@apple.com [Wed, 30 Nov 2016 21:42:16 +0000 (21:42 +0000)]
[iOS][WK2] Turn on HTML interactive form validation feature
https://bugs.webkit.org/show_bug.cgi?id=165212
<rdar://problem/29444356>

Reviewed by Simon Fraser.

Turn on HTML interactive form validation feature on iOS WK2
now that we have a native UI.

* Shared/WebPreferencesDefinitions.h:

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

3 years agoUpdate SubtleCrypto::verify to match the latest spec
jiewen_tan@apple.com [Wed, 30 Nov 2016 21:19:20 +0000 (21:19 +0000)]
Update SubtleCrypto::verify to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164741
<rdar://problem/29257935>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::verify method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-verify.
2. It implements verify operations of the following algorithms: HMAC, and
   RSASSA-PKCS1-V1_5.

Tests: crypto/subtle/hmac-generate-key-sign-verify.html
       crypto/subtle/hmac-import-key-verify-sha1.html
       crypto/subtle/hmac-import-key-verify-sha224.html
       crypto/subtle/hmac-import-key-verify-sha256.html
       crypto/subtle/hmac-import-key-verify-sha384.html
       crypto/subtle/hmac-import-key-verify-sha512.html
       crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html
       crypto/subtle/verify-malformed-parameters.html
       crypto/workers/subtle/hmac-import-key-verify.html
       crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionVerifyPromise):
(WebCore::JSSubtleCrypto::verify):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::verify):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::verify):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::verifyRSASSA_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):

LayoutTests:

Besides adding tests for SubtleCrypto::verify, it also enhances
*generate-key-encrypt-decrypt tests.

* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html:
* crypto/subtle/hmac-generate-key-sign-verify-expected.txt: Added.
* crypto/subtle/hmac-generate-key-sign-verify.html: Added.
* crypto/subtle/hmac-import-key-verify-sha1-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha1.html: Added.
* crypto/subtle/hmac-import-key-verify-sha224-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha224.html: Added.
* crypto/subtle/hmac-import-key-verify-sha256-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha256.html: Added.
* crypto/subtle/hmac-import-key-verify-sha384-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha384.html: Added.
* crypto/subtle/hmac-import-key-verify-sha512-expected.txt: Added.
* crypto/subtle/hmac-import-key-verify-sha512.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label-expected.txt:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html:
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt-expected.txt:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html: Added.
* crypto/subtle/verify-malformed-parameters-expected.txt: Added.
* crypto/subtle/verify-malformed-parameters.html: Added.
* crypto/workers/subtle/hmac-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/hmac-import-key-verify.html: Added.
* crypto/workers/subtle/resources/hmac-import-key-verify.js: Added.
* crypto/workers/subtle/resources/rsassa-pkcs1-v1_5-import-key-verify.js: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html: Added.

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

3 years agoProxy is not allowed in the global prototype chain.
mark.lam@apple.com [Wed, 30 Nov 2016 21:13:42 +0000 (21:13 +0000)]
Proxy is not allowed in the global prototype chain.
https://bugs.webkit.org/show_bug.cgi?id=165205

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
- We'll now throw a TypeError if we detect a Proxy in the global prototype chain.

LayoutTests:

* js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: Added.
* js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: Added.

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

3 years ago[CSS Parser] Fix columns shorthand parsing
hyatt@apple.com [Wed, 30 Nov 2016 20:38:46 +0000 (20:38 +0000)]
[CSS Parser] Fix columns shorthand parsing
https://bugs.webkit.org/show_bug.cgi?id=165210

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::consumeColumnWidthOrCount): Deleted.
Bring over the old parser code, since it was actually better at creating implicit values for auto.

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

3 years ago[Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
aestes@apple.com [Wed, 30 Nov 2016 20:34:18 +0000 (20:34 +0000)]
[Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
https://bugs.webkit.org/show_bug.cgi?id=165168
<rdar://problem/29003618>

Reviewed by Simon Fraser.

* platform/RuntimeApplicationChecks.h: Declared applicationBundleIdentifier().
* platform/RuntimeApplicationChecks.mm:
(WebCore::applicationBundleIdentifier): Made non-static.
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): If the new NEFilterSource instance
responds to -setSourceAppBundleID:, call it with applicationBundleIdentifier().
* platform/spi/cocoa/NEFilterSourceSPI.h: Moved NEFilterSourceOptionsRedirectURL into the
!USE(APPLE_INTERNAL_SDK) section and unconditionally declared @property sourceAppBundleID in
a new category on NEFilterSource.

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

3 years agoUnreviewed, rolling out r209112.
commit-queue@webkit.org [Wed, 30 Nov 2016 20:30:16 +0000 (20:30 +0000)]
Unreviewed, rolling out r209112.
https://bugs.webkit.org/show_bug.cgi?id=165208

"It regressed Octane/Raytrace and JetStream" (Requested by
saamyjoon on #webkit).

Reverted changeset:

"We should support CreateThis in the FTL"
https://bugs.webkit.org/show_bug.cgi?id=164904
http://trac.webkit.org/changeset/209112

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

3 years agoUse 'childOfType' template when retrieving Shadow DOM elements
bfulgham@apple.com [Wed, 30 Nov 2016 20:20:32 +0000 (20:20 +0000)]
Use 'childOfType' template when retrieving Shadow DOM elements
https://bugs.webkit.org/show_bug.cgi?id=165145
<rdar://problem/29331830>

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
       fast/shadow-dom/file-input-element-shadow-manipulation.html
       fast/shadow-dom/keygen-shadow-manipulation.html
       fast/shadow-dom/media-shadow-manipulation.html
       fast/shadow-dom/range-input-element-shadow-manipulation.html
       fast/shadow-dom/textarea-shadow-manipulation.html

Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
than relying on expected element positions, as these can be changed by
JavaScript.

Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.

* dom/Element.h:
(WebCore::Element::isUploadButton): Added.
(WebCore::Element::isSliderContainerElement): Added.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
the first child is the one we want.
* html/FileInputType.cpp:
(isType): Added.
(WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
the first child is the one we want.
(WebCore::FileInputType::multipleAttributeChanged): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaControls): Ditto.
(WebCore::HTMLMediaElement::hasMediaControls): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sliderTrackElement): Ditto.
* html/shadow/SliderThumbElement.h:
(isType): Added.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
the first child is the one we want.

LayoutTests:

* fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/color-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/keygen-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/keygen-shadow-manipulation.html: Added.
* fast/shadow-dom/media-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/media-shadow-manipulation.html: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/textarea-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/textarea-shadow-manipulation.html: Added.

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

3 years agoIndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
beidson@apple.com [Wed, 30 Nov 2016 19:59:01 +0000 (19:59 +0000)]
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974

Reviewed by Alex Christensen.

No new tests (No behavior change other than being faster).

Instead of building new SQLiteStatements from scratch each time they're needed and then
finalizing them after they're used for a single operation, we cache them.

For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

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

3 years agoWeb Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
joepeck@webkit.org [Wed, 30 Nov 2016 19:48:04 +0000 (19:48 +0000)]
Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
https://bugs.webkit.org/show_bug.cgi?id=165157
<rdar://problem/27896562>

Reviewed by Brian Burg.

Source/WebInspectorUI:

By correctly disallowing slashes in the scheme Web Inspector resolves
the correct absolute URL and doesn't end up trying to navigate to an
incorrect file URL.

* UserInterface/Base/URLUtilities.js:
(parseURL):
Disallow "/" characters in the scheme portion. (/http://example.com)
Allow path to be optional before a fragment portion. (http://example.com#frag)

LayoutTests:

* inspector/unit-tests/url-utilities-expected.txt:
* inspector/unit-tests/url-utilities.html:
Add some tests for expected valid and invalid parseURL cases.
Note some cases that we don't handle properly and would benefit
by switching to URL constructor which is a much larger change.

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

3 years ago[CSS Parser] Make sure -webkit-background-size coalesces identical values.
hyatt@apple.com [Wed, 30 Nov 2016 19:39:12 +0000 (19:39 +0000)]
[CSS Parser] Make sure -webkit-background-size coalesces identical values.
https://bugs.webkit.org/show_bug.cgi?id=165207

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundSize):

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

3 years ago[MediaStream] Sync video preview layer and parent layer sizes
eric.carlson@apple.com [Wed, 30 Nov 2016 19:20:32 +0000 (19:20 +0000)]
[MediaStream] Sync video preview layer and parent layer sizes
https://bugs.webkit.org/show_bug.cgi?id=165139

Reviewed by Jer Noble.

CALayer auto-resizing doesn't work on iOS, so manually reize the video capture preview layer
whenever the background layer's bounds change.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview): Create layer observer.
(WebCore::AVVideoSourcePreview::backgroundLayerBoundsChanged): Sync preview layer and background
  layer sizes.
(WebCore::AVVideoSourcePreview::invalidate): Invalidate and clear observer.
(-[WebCoreAVVideoCaptureSourceObserver initWithParent:]):
(-[WebCoreAVVideoCaptureSourceObserver setParent:]): Add KVO bounds observer.
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Call
parent when "bounds" changes.
(-[WebCoreAVVideoCaptureSourceObserver actionForKey:]): Return nil to disable all animations.

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

3 years agoReverted r209130.
aestes@apple.com [Wed, 30 Nov 2016 19:19:44 +0000 (19:19 +0000)]
Reverted r209130.

The new test fast/shadow-dom/keygen-shadow-manipulation.html asserts and crashes on Mac debug builds.

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

3 years ago[CSS Parser] Fix a typo in a layout test for transforms
hyatt@apple.com [Wed, 30 Nov 2016 18:51:04 +0000 (18:51 +0000)]
[CSS Parser] Fix a typo in a layout test for transforms
https://bugs.webkit.org/show_bug.cgi?id=165203

Reviewed by Dean Jackson.

* transitions/transition-end-event-transform.html:

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

3 years ago[Win] Apple build is using incorrect ICU library (if present)
bfulgham@apple.com [Wed, 30 Nov 2016 18:45:57 +0000 (18:45 +0000)]
[Win] Apple build is using incorrect ICU library (if present)
https://bugs.webkit.org/show_bug.cgi?id=164934
<rdar://problem/29329654>

Reviewed by Alex Christensen.

Move the 'icuuc.lib' and 'icuin.lib' library names to the end of the set of choices when searching for ICU.
so that we preferentially select the 'new' version of these libraries if they are available.

* Source/cmake/FindICU.cmake:

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

3 years ago[CSS Parser] Fix crash in -webkit-shape-outside parsing
hyatt@apple.com [Wed, 30 Nov 2016 18:42:14 +0000 (18:42 +0000)]
[CSS Parser] Fix crash in -webkit-shape-outside parsing
https://bugs.webkit.org/show_bug.cgi?id=165202

Reviewed by Dean Jackson.

* css/CSSBasicShapes.cpp:
(WebCore::buildSerializablePositionOffset):
The old parser never passed in a singleton value ID for top/right/bottom/left.
The new parser does, and it exposed a bug in the serialization code for
shapes that didn't properly create the offset primitive value as a percentage
in those cases.

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

3 years agoMake it possible to use an existing simulator instance for one-off testing
jbedard@apple.com [Wed, 30 Nov 2016 18:30:47 +0000 (18:30 +0000)]
Make it possible to use an existing simulator instance for one-off testing
https://bugs.webkit.org/show_bug.cgi?id=164568
<rdar://problem/29189133>

Reviewed by Daniel Bates.

With this patch, if a simulator is currently running on the machine and
'--dedicated-simulators' is not passed into the application, only one simulator
instance will be used, and this instance will be the existing instance.
If no simulator is running or '--dedicated-simulators' is passed to the script,
previous behavior will be used.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.__init__): Logic for enabling usage of currently running simulator.
(IOSSimulatorPort._create_simulators): Only create simulators when needed, don't reset already running simulators.
(IOSSimulatorPort.setup_test_run): Don't open already running simulators.
(IOSSimulatorPort._quit_ios_simulator): Only quit simulators if we manage them.
(IOSSimulatorPort.clean_up_test_run): Only clean up simulators if we manage them.
(IOSSimulatorPort._using_dedicated_simulators): True if simulators need to be managed, false if using an existing instance.
(IOSSimulatorPort.device_id_for_worker_number): Access currently running simulator if not managing devices.
* Scripts/webkitpy/xcode/simulator.py:
(Simulator.current_device): Get currently running device.

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

3 years ago[GLIB] IndexedDB: Switch to use new encoder for IDBKeyData
commit-queue@webkit.org [Wed, 30 Nov 2016 18:03:23 +0000 (18:03 +0000)]
[GLIB] IndexedDB: Switch to use new encoder for IDBKeyData
https://bugs.webkit.org/show_bug.cgi?id=165191

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-11-30
Reviewed by Sergio Villar Senin.

Instead of using KeyedEncoder.

* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::isLegacySerializedIDBKeyData): Helper function to check whether the given data were encoded with
KeyedEncoder or not.
(WebCore::serializedTypeForKeyType): Remove #ifdefs for CF and always use the new encoder.
(WebCore::encodeKey): Ditto.
(WebCore::serializeIDBKeyData): Ditto.
(WebCore::decodeKey): Ditto.
(WebCore::deserializeIDBKeyData): Ditto.

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

3 years agoWeb Inspector: Null ResourceResponse Preflight requests cause crash
commit-queue@webkit.org [Wed, 30 Nov 2016 18:01:36 +0000 (18:01 +0000)]
Web Inspector: Null ResourceResponse Preflight requests cause crash
https://bugs.webkit.org/show_bug.cgi?id=165120
<rdar://problem/27911350>

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

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
Only inform Web Inspector about successful responses. Informing with a
null response would break the expected Inspector API contract when
notifying about did receive response. Also, when informing Web Inspector
include a didFinishLoading event so the frontend knows this pre-flight
request is complete.

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

3 years agoCorrect plugin sandbox after r208611
bfulgham@apple.com [Wed, 30 Nov 2016 17:53:12 +0000 (17:53 +0000)]
Correct plugin sandbox after r208611
https://bugs.webkit.org/show_bug.cgi?id=165187
<rdar://problem/29431165>

Reviewed by Alex Christensen.

In r208611 I removed the 'else' clause of a Scheme conditional
that was needed to properly run plugins (such as Flash Player).

This change retains the relevant current sandbox content, while
still stripping out the old code that is no longer needed.

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

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

3 years agoREGRESSION (209086): IDB tests crash under GuardMalloc.
beidson@apple.com [Wed, 30 Nov 2016 17:38:00 +0000 (17:38 +0000)]
REGRESSION (209086): IDB tests crash under GuardMalloc.
https://bugs.webkit.org/show_bug.cgi?id=165201

Reviewed by Chris Dumez.

No new tests (Covered by literally every IDB test when run under GuardMalloc).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commitOnServer): "Commit on Server" operations are special, in that they
  are the last operation a transaction does, and they remove themselves from the protector map right away.
  So when we remove them from the protector map we also need to remove their raw-pointer from the
  "in-progress" queue.

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

3 years agoSome animated image do not animate after reseting their animations
commit-queue@webkit.org [Wed, 30 Nov 2016 17:10:04 +0000 (17:10 +0000)]
Some animated image do not animate after reseting their animations
https://bugs.webkit.org/show_bug.cgi?id=165131

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-11-30
Reviewed by Simon Fraser.
Source/WebCore:

Test: fast/images/reset-image-animation.html

The bug happens because the ImageFrameCache does not reset its cached
frames properly when the BitmapImage rests its animation.

-- We need to ignore caching the new NativeImage of an ImageFrame if the
decoding thread is terminated after asynchronously calling
cacheFrameNativeImageAtIndex() on the main thread through callOnMainThread().
Although the decoding thread was terminated this call is still scheduled
to be executed later on the main thread.

-- We need to open the m_frameRequestQueue before starting a new decoding
thread. Opening m_frameRequestQueue clears the enqueued requests from the
previous decoding thread and allows enqueueing requests for the new thread.

-- We need to clear the ImageFrames which were being decoded at the time
the decoding queue was closing and their new NativeImages were not cached.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Assert the NativeImage
is cached for an ImageFrame which is still being decoded.

(WebCore::ImageFrameCache::startAsyncDecodingQueue): Open the m_frameRequestQueue
before starting the decoding thread. Don't cache the NativeImage of an ImageFrame
unless the decoding thread is still alive and it the same as the one that makes
the asynchronous call to cacheFrameNativeImageAtIndex().

(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Don't request an
image frame to be be asynchronously decoded if it is already being decoded.

(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Clear the ImageFrames that
were being decoded when the decoding thread terminates.

* testing/Internals.cpp:
(WebCore::Internals::resetImageAnimation):
* testing/Internals.h:
* testing/Internals.idl:
Expose BitmapImage::resetAnimation() through Internals so tests can force it.

LayoutTests:

Ensure the image animation is played in order after the animation is reset.

* fast/images/reset-image-animation-expected.txt: Added.
* fast/images/reset-image-animation.html: Added.

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

3 years agoUse 'childOfType' template when retrieving Shadow DOM elements
bfulgham@apple.com [Wed, 30 Nov 2016 17:03:48 +0000 (17:03 +0000)]
Use 'childOfType' template when retrieving Shadow DOM elements
https://bugs.webkit.org/show_bug.cgi?id=165145
<rdar://problem/29331830>

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
       fast/shadow-dom/file-input-element-shadow-manipulation.html
       fast/shadow-dom/keygen-shadow-manipulation.html
       fast/shadow-dom/media-shadow-manipulation.html
       fast/shadow-dom/range-input-element-shadow-manipulation.html
       fast/shadow-dom/textarea-shadow-manipulation.html

Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
than relying on expected element positions, as these can be changed by
JavaScript.

Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.

* dom/Element.h:
(WebCore::Element::isUploadButton): Added.
(WebCore::Element::isSliderContainerElement): Added.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
the first child is the one we want.
* html/FileInputType.cpp:
(isType): Added.
(WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
the first child is the one we want.
(WebCore::FileInputType::multipleAttributeChanged): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaControls): Ditto.
(WebCore::HTMLMediaElement::hasMediaControls): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sliderTrackElement): Ditto.
* html/shadow/SliderThumbElement.h:
(isType): Added.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
the first child is the one we want.

LayoutTests:

* fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/color-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/file-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/keygen-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/keygen-shadow-manipulation.html: Added.
* fast/shadow-dom/media-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/media-shadow-manipulation.html: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/range-input-element-shadow-manipulation.html: Added.
* fast/shadow-dom/textarea-shadow-manipulation-expected.txt: Added.
* fast/shadow-dom/textarea-shadow-manipulation.html: Added.

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

3 years agoStreamline and speed up tokenizer and segmented string classes
darin@apple.com [Wed, 30 Nov 2016 16:59:11 +0000 (16:59 +0000)]
Streamline and speed up tokenizer and segmented string classes
https://bugs.webkit.org/show_bug.cgi?id=165003

Source/JavaScriptCore:

Reviewed by Sam Weinig.

* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue): Use viewWithUnderlyingString when calling
StringBuilder::appendQuotedJSONString, since it now takes a StringView and there is
no benefit in creating a String for that function if one doesn't already exist.

Source/WebCore:

Reviewed by Sam Weinig.

Profiling Speedometer on my iMac showed the tokenizer as one of the
hottest functions. This patch streamlines the segmented string class,
removing various unused features, and also improves some other functions
seen on the Speedometer profile. On my iMac I measured a speedup of
about 3%. Changes include:

- Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
  SegmentedString class and all the code that used to handle them.

- Simplified the SegmentedString advance functions so they are small
  enough to get inlined in the HTML tokenizer.

- Updated callers to call the simpler SegmentedString advance functions
  that don't handle newlines in as many cases as possible.

- Cut down on allocations of SegmentedString and made code move the
  segmented string and the strings that are moved into it rather than
  copying them whenever possible.

- Simplified segmented string functions, removing some branches, mostly
  from the non-fast paths.

- Removed small unused functions and small functions used in only one
  or two places, made more functions private and renamed for clarity.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::documentWrite): Moved a little more of the common code in here
from the two functions belwo. Removed obsolete comment saying this was not
following the DOM specification because it is. Removed unneeded special
cases for 1 argument and no arguments. Take a reference instead of a pointer.
(WebCore::JSHTMLDocument::write): Updated for above.
(WebCore::JSHTMLDocument::writeln): Ditto.

* css/parser/CSSTokenizer.cpp: Added now-needed include.
* css/parser/CSSTokenizer.h: Removed unneeded include.

* css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
here; this is now separate from the use in the HTMLParser. In the long run,
unclear to me whether it is really needed in either.

* dom/Document.cpp:
(WebCore::Document::prepareToWrite): Added. Helper function used by the three
different variants of write. Using this may prevent us from having to construct
a SegmentedString just to append one string after future refactoring.
(WebCore::Document::write): Updated to take an rvalue reference and move the
value through.
(WebCore::Document::writeln): Use a single write call instead of two.

* dom/Document.h: Changed write to take an rvalue reference to SegmentedString
rather than a const reference.

* dom/DocumentParser.h: Changed insert to take an rvalue reference to
SegmentedString. In the future, should probably overload to take a single
string since that is the normal case.

* dom/RawDataDocumentParser.h: Updated for change to DocumentParser.

* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
so that we don't need an assignment operator for SegmentedString that can
copy a String.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
and move the value through.
* html/parser/HTMLDocumentParser.h: Updated for the above.

* html/parser/HTMLEntityParser.cpp:
(WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
Changed the twao calls to advance here to call advancePastNonNewline; no
change in behavior, but asserts what the code was assuming before, that the
character was not a newline.

* html/parser/HTMLInputStream.h:
(WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
and move the value through.
(WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
(WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
SegmentedString, overkill since we can just append an individual string.
(WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
use move, which will reduce reference count churn and other unneeded work.

* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
construction of a SegmentedString, just to append a string.

* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
(WebCore::HTMLSourceTracker::source): Updated for function name change.
* html/parser/HTMLSourceTracker.h: Updated for above.

* html/parser/HTMLTokenizer.cpp: Added now-needed include.
(WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
since this function is never called in response to a newline character.
(WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
(WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
(WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
instead of ADVANCE_TO in cases where the character we are advancing past is
known not to be a newline, so we can use the more efficient advance function
that doesn't check for the newline character.

* html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
SegmentedString.h; not sure that's a good place for it either. In the long run,
unclear to me whether this is really needed.
(WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
Added LIKELY for the not-special character check.
(WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
advanceAndUpdateLineNumber function.
(WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
efficient than advance for cases where the last characer is known not to be
a newline character.
(WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
(WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
constructor; added initial values for the data members to replace.
(WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
FIXME comment that didn't really need to be here. Reorganized a bit.
(WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.

* html/track/BufferedLineReader.cpp:
(WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
scanCharacter function to advance past a newline. Also renamed from getLine
and changed to return Optional<String> instead of using a boolean to indicate
failure and an out argument.

* html/track/BufferedLineReader.h:
(WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
initial values on each data member below.
(WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
and move the value through.
(WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
and easy to replace with two lines of code at its two call sites.
(WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
data members of the class, not just the segmented string.

* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
an rvalue reference and move the value through.
* html/track/InbandGenericTextTrack.h: Updated for the above.

* html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
takes an rvalue reference.

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
and move the value through.
(WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
in to the line reader append function.
(WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
(WebCore::WebVTTParser::flush): More of the same.
(WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
* html/track/WebVTTParser.h: Updated for the above.

* html/track/WebVTTTokenizer.cpp:
(WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
name, just advance. No change in behavior.
(WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
SegmentedString, to add the end of file marker.

* platform/graphics/InbandTextTrackPrivateClient.h: Updated since
parseWebVTTFileHeader takes an rvalue reference.

* platform/text/SegmentedString.cpp:
(WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
The only caller is SegmentedString::toString, inside this file.
(WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
No longer needed.
(WebCore::SegmentedString::operator=): Defined a move assignment operator
rather than an ordinary assignment operator, since that's what the call
sites really need.
(WebCore::SegmentedString::length): Simplified since we no longer need to
support pushed characters.
(WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
can just iterate m_otherSubstrings without an extra check. Also changed to
write directly to the data member of Substring instead of using a function.
(WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
Added. Used when we run out of characters.
(WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
Updated for changes to other member names.
(WebCore::SegmentedString::appendSubstring): Renamed from just append to
avoid ambiguity with the public append function. Changed to take an rvalue
reference, and move in, and added code to set m_currentCharacter properly,
so the caller doesn't have to deal with that.
(WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
Also removed unneeded comment about assertion that fires when trying to close
an already closed string.
(WebCore::SegmentedString::append): Added overloads for rvalue references of
both entire SegmentedString objects and of String. Streamlined to just call
appendSubstring and append to the deque.
(WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
strings and changed to take just a string, not an entire segmented string.
(WebCore::SegmentedString::advanceSubstring): Moved logic into the
advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
(WebCore::SegmentedString::toString): Simplified now that we don't need to
support pushed characters.
(WebCore::SegmentedString::advancePastNonNewlines): Deleted.
(WebCore::SegmentedString::advance8): Deleted.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
advance16. Simplified now that there are no pushed characters. Also changed to
access data members of m_currentSubstring directly instead of calling a function.
(WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
(WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
(WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
Moved code in here from advanceSubstring.
(WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
(WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
(WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
(WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
boolean argument. Rewrote to use the String class less; it's now used only when
we fail to match after the first character rather than being used for the actual
comparison with the literal.

* platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
the class definition to make things easier to read. Moved the SegmentedSubstring
class inside the SegmentedString class, making it a private struct named Substring.
Removed the m_ prefix from data members of the struct, removed many functions from
the struct and made its union be anonymous instead of naming it m_data. Removed
unneeded StringBuilder.h include.
(WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
instead of a separate boolean. We never create an empty substring, nor leave one
in place as the current substring unless the entire segmented string is empty.
(WebCore::SegmentedString::advancePast): Updated to use the new member function
template instead of a non-template member function. The new member function is
entirely rewritten and does the matching directly rather than allocating a string
just to do prefix matching.
(WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
it clear that the literal must be all non-letters or lowercase letters as with
the other "letters ignoring ASCII case" functions. The three call sites all fit
the bill. Implement by calling the new function template.
(WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
(WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
move the string in.
(WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
is never used on an empty substring.
(WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
(WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
Simplified since there are now fewer data members.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
advance, since this is only safe to use if there is some reason it is OK to skip
updating the line number.
(WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
since doing that is the normal desired behavior and not worth mentioning in the
public function name.
(WebCore::SegmentedString::advancePastNewline): Renamed from
advancePastNewlineAndUpdateLineNumber.
(WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
pushed characters are no longer supported.
(WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.

* xml/parser/CharacterReferenceParserInlines.h:
(WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
because the SegmentedString is going to take ownership of the string.
(WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
a String, not a SegmentedString. Also use advancePastNonNewline.

* xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.

* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
(WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
SegmentedString.
* xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
and initialized most data members.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
initialization into the class definition.
(WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
segmented string, but converted the whole thing into a string before using it.
Now we convert to a string right away.

Source/WTF:

And do it without re-introducing:

REGRESSION (r209058): API test StringBuilderTest.Equal crashing
https://bugs.webkit.org/show_bug.cgi?id=165142

Reviewed by Sam Weinig.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::bufferCharacters<LChar>): Moved this here from
the header since it is only used inside the class. Also renamed from
getBufferCharacters.
(WTF::StringBuilder::bufferCharacters<UChar>): Ditto.
(WTF::StringBuilder::appendUninitializedUpconvert): Added. Helper
for the upconvert case in the 16-bit overload of StrinBuilder::append.
(WTF::StringBuilder::append): Changed to use appendUninitializedUpconvert.
(WTF::quotedJSONStringLength): Added. Used in new appendQuotedJSONString
implementation below that now correctly determines the size of what will
be appended by walking thorugh the string twice.
(WTF::appendQuotedJSONStringInternal): Moved the code that writes the
quote marks in here. Also made a few coding style tweaks.
(WTF::StringBuilder::appendQuotedJSONString): Rewrote to use a much
simpler algorithm that grows the string the same way the append function
does. The old code would use reserveCapacity in a way that was costly when
doing a lot of appends on the same string, and also allocated far too much
memory for normal use cases where characters did not need to be turned
into escape sequences.

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append): Tweaked style a bit, fixed a bug where the
m_is8Bit field wasn't set correctly in one case, optimized the function that
adds substrings for the case where this is the first append and the substring
happens to cover the entire string. Also clarified the assertions and removed
an unneeded check from that substring overload.
(WTF::equal): Reimplemented, using equalCommon. Added an overload of the equal
function just for the case where the arguments are StringBuilder, String.
This is needed because of the peculiar behavior of is8Bit in String, different
from any of our other string classes. I think we should consider changing
String::is8Bit to return true for null strings. We could then remove this
overload and probably remove other checks for null and zero length elsewhere
that are also needed only to avoid calling is8Bit on a null String.

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

3 years ago[CSS Parser] Mark a bunch of tests as able to fail
hyatt@apple.com [Wed, 30 Nov 2016 16:56:45 +0000 (16:56 +0000)]
[CSS Parser] Mark a bunch of tests as able to fail
https://bugs.webkit.org/show_bug.cgi?id=165199

Reviewed by Zalan Bujtas.

* TestExpectations:

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

3 years agoUnreviewed, mark tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html as flaky
wenson_hsieh@apple.com [Wed, 30 Nov 2016 16:17:25 +0000 (16:17 +0000)]
Unreviewed, mark tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html as flaky

It seems there are additional causes of test failures when scrolling in iframes. webkit.org/b/165196 will be
used to track this.

* platform/mac-wk2/TestExpectations:

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

3 years agoUnreviewed speculative cmake buildfix after r209070.
ossy@webkit.org [Wed, 30 Nov 2016 09:41:55 +0000 (09:41 +0000)]
Unreviewed speculative cmake buildfix after r209070.

* PlatformMac.cmake: New sources added.

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

3 years ago[WebRTC][OpenWebRTC] Temporary device selection support
philn@webkit.org [Wed, 30 Nov 2016 08:36:45 +0000 (08:36 +0000)]
[WebRTC][OpenWebRTC] Temporary device selection support
https://bugs.webkit.org/show_bug.cgi?id=165141

Reviewed by Alejandro G. Castro.

Make sure the player handles only one audio and video track at
most for now. The device choice can be influenced with the
WEBKIT_VIDEO_DEVICE and WEBKIT_AUDIO_DEVICE environment variables.
Each variable optionally holds the name of the device to use.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::play):
(WebCore::MediaPlayerPrivateGStreamerOwr::load):

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

3 years agoBuild fix with !HAVE(ACCESSIBILITY)
csaavedra@igalia.com [Wed, 30 Nov 2016 08:30:51 +0000 (08:30 +0000)]
Build fix with !HAVE(ACCESSIBILITY)

* accessibility/AXObjectCache.h:
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::postTextStateChangeNotification):

Add dummy implementations.

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

3 years agoWebAssembly JS API: improve Instance
jfbastien@apple.com [Wed, 30 Nov 2016 07:22:17 +0000 (07:22 +0000)]
WebAssembly JS API: improve Instance
https://bugs.webkit.org/show_bug.cgi?id=164757

Reviewed by Keith Miller.

JSTests:

An Instance's `exports` property wasn't populated with exports.

A follow-up patch will do imports.

A few things of note:

 - LowLevelBinary: support 3-byte integers.
 - LowLevelBinary: support proper UTF-8 2003 code points (instead of UTF-16).

* wasm/Builder.js:
* wasm/Builder_WebAssemblyBinary.js: wire up exports, stub other things out some more
(const.emitters.Export):
* wasm/LowLevelBinary.js:
(export.default.LowLevelBinary.prototype.uint24): add, used for UTF-8
(export.default.LowLevelBinary.prototype.string): support UTF-8
(export.default.LowLevelBinary.prototype.getUint24): add, used for UTF-8
(export.default.LowLevelBinary.prototype.getVaruint1): was missing
(export.default.LowLevelBinary.prototype.getString): support UTF-8
(export.default.LowLevelBinary):
* wasm/js-api/test_Instance.js: instance.exports.answer() // <-- this is where the magic of this entire patch is
(ExportedAnswerI32):
* wasm/js-api/test_basic_api.js: punt test to later
(const.c.in.constructorProperties.switch):
* wasm/self-test/test_BuilderWebAssembly.js: UTF-8
(CustomSection):
* wasm/self-test/test_LowLevelBinary_string.js: UTF-8 now works
* wasm/self-test/test_LowLevelBinary_uint16.js: was missing one value
* wasm/self-test/test_LowLevelBinary_uint24.js: Copied from JSTests/wasm/self-test/test_LowLevelBinary_uint8.js.
* wasm/self-test/test_LowLevelBinary_uint8.js: was missing one value
* wasm/self-test/test_LowLevelBinary_varuint1.js: Added.
* wasm/utilities.js: this `dump` thing was useful
(const._dump):

Source/JavaScriptCore:

An Instance's `exports` property wasn't populated with exports.

According to the spec [0], `exports` should present itself as a WebAssembly
Module Record. In order to do this we need to split JSModuleRecord into
AbstractModuleRecord (without the `link` and `evaluate` functions), and
JSModuleRecord (which implements link and evaluate). We can then have a separate
WebAssemblyModuleRecord which shares most of the implementation.

`exports` then maps function names to WebAssemblyFunction and
WebAssemblyFunctionCell, which call into the B3-generated WebAssembly code.

A follow-up patch will do imports.

A few things of note:

 - Use Identifier instead of String. They get uniqued, we need them for the JSModuleNamespaceObject. This is safe because JSWebAssemblyModule creation is on the main thread.
 - JSWebAssemblyInstance needs to refer to the JSWebAssemblyModule used to create it, because the module owns the code, identifiers, etc. The world would be very sad if it got GC'd.
 - Instance.exports shouldn't use putWithoutTransition because it affects all Structures, whereas here each instance needs its own exports.
 - Expose the compiled functions, and pipe them to the InstanceConstructor. Start moving things around to split JSModuleRecord out into JS and WebAssembly parts.

  [0]: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-constructor

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/AbstractModuleRecord.cpp: Copied from Source/JavaScriptCore/runtime/JSModuleRecord.cpp, which I split in two
(JSC::AbstractModuleRecord::AbstractModuleRecord):
(JSC::AbstractModuleRecord::destroy):
(JSC::AbstractModuleRecord::finishCreation):
(JSC::AbstractModuleRecord::visitChildren):
(JSC::AbstractModuleRecord::appendRequestedModule):
(JSC::AbstractModuleRecord::addStarExportEntry):
(JSC::AbstractModuleRecord::addImportEntry):
(JSC::AbstractModuleRecord::addExportEntry):
(JSC::identifierToJSValue):
(JSC::AbstractModuleRecord::hostResolveImportedModule):
(JSC::AbstractModuleRecord::ResolveQuery::ResolveQuery):
(JSC::AbstractModuleRecord::ResolveQuery::isEmptyValue):
(JSC::AbstractModuleRecord::ResolveQuery::isDeletedValue):
(JSC::AbstractModuleRecord::ResolveQuery::Hash::hash):
(JSC::AbstractModuleRecord::ResolveQuery::Hash::equal):
(JSC::AbstractModuleRecord::cacheResolution):
(JSC::getExportedNames):
(JSC::AbstractModuleRecord::getModuleNamespace):
(JSC::printableName):
(JSC::AbstractModuleRecord::dump):
* runtime/AbstractModuleRecord.h: Copied from Source/JavaScriptCore/runtime/JSModuleRecord.h.
(JSC::AbstractModuleRecord::ImportEntry::isNamespace):
(JSC::AbstractModuleRecord::sourceCode):
(JSC::AbstractModuleRecord::moduleKey):
(JSC::AbstractModuleRecord::requestedModules):
(JSC::AbstractModuleRecord::exportEntries):
(JSC::AbstractModuleRecord::importEntries):
(JSC::AbstractModuleRecord::starExportEntries):
(JSC::AbstractModuleRecord::declaredVariables):
(JSC::AbstractModuleRecord::lexicalVariables):
(JSC::AbstractModuleRecord::moduleEnvironment):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::webAssemblyModuleRecordStructure):
(JSC::JSGlobalObject::webAssemblyFunctionStructure):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::create):
(JSC::JSModuleEnvironment::finishCreation):
(JSC::JSModuleEnvironment::getOwnPropertySlot):
(JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames):
(JSC::JSModuleEnvironment::put):
(JSC::JSModuleEnvironment::deleteProperty):
* runtime/JSModuleEnvironment.h:
(JSC::JSModuleEnvironment::create):
(JSC::JSModuleEnvironment::offsetOfModuleRecord):
(JSC::JSModuleEnvironment::allocationSize):
(JSC::JSModuleEnvironment::moduleRecord):
(JSC::JSModuleEnvironment::moduleRecordSlot):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
* runtime/JSModuleNamespaceObject.h:
(JSC::JSModuleNamespaceObject::create):
(JSC::JSModuleNamespaceObject::moduleRecord):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::createStructure):
(JSC::JSModuleRecord::create):
(JSC::JSModuleRecord::JSModuleRecord):
(JSC::JSModuleRecord::destroy):
(JSC::JSModuleRecord::finishCreation):
(JSC::JSModuleRecord::visitChildren):
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSModuleRecord.h:
* runtime/JSScope.cpp:
(JSC::abstractAccess):
(JSC::JSScope::collectClosureVariablesUnderTDZ):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/JSWebAssembly.h:
* wasm/WasmFormat.h: use Identifier instead of String
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
(JSC::Wasm::ModuleParser::parseType):
(JSC::Wasm::ModuleParser::parseImport): fix off-by-one
(JSC::Wasm::ModuleParser::parseFunction):
(JSC::Wasm::ModuleParser::parseExport):
* wasm/WasmModuleParser.h:
(JSC::Wasm::ModuleParser::ModuleParser):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::run):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::module):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::create):
(JSC::JSWebAssemblyModule::finishCreation):
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::moduleInformation):
(JSC::JSWebAssemblyModule::compiledFunctions):
(JSC::JSWebAssemblyModule::exportSymbolTable):
* wasm/js/WebAssemblyFunction.cpp: Added.
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::createStructure):
(JSC::WebAssemblyFunction::WebAssemblyFunction):
(JSC::WebAssemblyFunction::visitChildren):
(JSC::WebAssemblyFunction::finishCreation):
* wasm/js/WebAssemblyFunction.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h.
(JSC::CallableWebAssemblyFunction::CallableWebAssemblyFunction):
(JSC::WebAssemblyFunction::webAssemblyFunctionCell):
* wasm/js/WebAssemblyFunctionCell.cpp: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h.
(JSC::WebAssemblyFunctionCell::create):
(JSC::WebAssemblyFunctionCell::WebAssemblyFunctionCell):
(JSC::WebAssemblyFunctionCell::destroy):
(JSC::WebAssemblyFunctionCell::createStructure):
* wasm/js/WebAssemblyFunctionCell.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h.
(JSC::WebAssemblyFunctionCell::function):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
* wasm/js/WebAssemblyModuleRecord.cpp: Added.
(JSC::WebAssemblyModuleRecord::createStructure):
(JSC::WebAssemblyModuleRecord::create):
(JSC::WebAssemblyModuleRecord::WebAssemblyModuleRecord):
(JSC::WebAssemblyModuleRecord::destroy):
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::visitChildren):
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyModuleRecord.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h.

Source/WTF:

* wtf/Expected.h:
(WTF::ExpectedDetail::destroy): silence a warning

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

3 years ago[GTK] Database process should not initialize gtk
carlosgc@webkit.org [Wed, 30 Nov 2016 07:14:37 +0000 (07:14 +0000)]
[GTK] Database process should not initialize gtk
https://bugs.webkit.org/show_bug.cgi?id=165138

Reviewed by Sergio Villar Senin.

It doesn't use GTK+ at all.

* DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
(WebKit::DatabaseProcessMainUnix):
(): Deleted.

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

3 years agoWe should be able optimize the pattern where we spread a function's rest parameter...
sbarati@apple.com [Wed, 30 Nov 2016 06:24:44 +0000 (06:24 +0000)]
We should be able optimize the pattern where we spread a function's rest parameter to another call
https://bugs.webkit.org/show_bug.cgi?id=163865

Reviewed by Filip Pizlo.

JSTests:

* microbenchmarks/default-derived-constructor.js: Added.
(createClassHierarchy.let.currentClass):
(createClassHierarchy):
* stress/call-varargs-spread.js: Added.
(assert):
(bar):
(foo):
* stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js: Added.
(assert):
(baz):
(bar):
(foo):
* stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js: Added.
(assert):
(foo):
(escape):
(bar):
* stress/phantom-new-array-with-spread-osr-exit.js: Added.
(assert):
(baz):
(bar):
(effects):
(foo):
* stress/phantom-spread-forward-varargs.js: Added.
(assert):
(test1.bar):
(test1.foo):
(test1):
(test2.bar):
(test2.foo):
(test3.baz):
(test3.bar):
(test3.foo):
(test4.baz):
(test4.bar):
(test4.foo):
(test5.baz):
(test5.bar):
(test5.foo):
* stress/phantom-spread-osr-exit.js: Added.
(assert):
(baz):
(bar):
(effects):
(foo):
* stress/spread-call-convert-to-static-call.js: Added.
(assert):
(baz):
(bar):
(foo):
* stress/spread-forward-call-varargs-stack-overflow.js: Added.
(assert):
(identity):
(bar):
(foo):
* stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js: Added.
(assert):
(baz.Array.prototype.Symbol.iterator):
(baz):
(bar):
(foo):
(test):
* stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js: Added.
(assert):
(baz.Array.prototype.Symbol.iterator):
(baz):
(bar):
(foo):
* stress/spread-forward-varargs-stack-overflow.js: Added.
(assert):
(bar):
(foo):

Source/JavaScriptCore:

This patch optimizes the following patterns to prevent both the allocation
of the rest parameter, and the execution of the iterator protocol:

```
function foo(...args) {
    let arr = [...args];
}

and

function foo(...args) {
    bar(...args);
}
```

To do this, I've extended the arguments elimination phase to reason
about Spread and NewArrayWithSpread. I've added two new nodes, PhantomSpread
and PhantomNewArrayWithSpread. PhantomSpread is only allowed over rest
parameters that don't escape. If the rest parameter *does* escape, we can't
convert the spread into a phantom because it would not be sound w.r.t JS
semantics because we would be reading from the call frame even though
the rest array may have changed.

Note that NewArrayWithSpread also understands what to do when one of its
arguments is PhantomSpread(@PhantomCreateRest) even if it itself is escaped.

PhantomNewArrayWithSpread is only allowed over a series of
PhantomSpread(@PhantomCreateRest) nodes. Like with PhantomSpread, PhantomNewArrayWithSpread
is only allowed if none of its arguments that are being spread are escaped
and if it itself is not escaped.

Because there is a dependency between a node being a candidate and
the escaped state of the node's children, I've extended the notion
of escaping a node inside the arguments elimination phase. Now, when
any node is escaped, we must consider all other candidates that are may
now no longer be valid.

For example:

```
function foo(...args) {
    escape(args);
    bar(...args);
}
```

In the above program, we don't know if the function call to escape()
modifies args, therefore, the spread can not become phantom because
the execution of the spread may not be as simple as reading the
arguments from the call frame.

Unfortunately, the arguments elimination phase does not consider control
flow when doing its escape analysis. It would be good to integrate this
phase with the object allocation sinking phase. To see why, consider
an example where we don't eliminate the spread and allocation of the rest
parameter even though we could:

```
function foo(rareCondition, ...args) {
    bar(...args);
    if (rareCondition)
        baz(args);
}
```

There are only a few users of the PhantomSpread and PhantomNewArrayWithSpread
nodes. PhantomSpread is only used by PhantomNewArrayWithSpread and NewArrayWithSpread.
PhantomNewArrayWithSpread is only used by ForwardVarargs and the various
*Call*ForwardVarargs nodes. The users of these phantoms know how to produce
what the phantom node would have produced. For example, NewArrayWithSpread
knows how to produce the values that would have been produced by PhantomSpread(@PhantomCreateRest)
by directly reading from the call frame.

This patch is a 6% speedup on my MBP on ES6SampleBench.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::tryAppendLea):
* b3/B3ValueRep.h:
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createDefaultConstructor):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGForAllKills.h:
(JSC::DFG::forAllKillsInBlock):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasConstant):
(JSC::DFG::Node::constant):
(JSC::DFG::Node::bitVector):
(JSC::DFG::Node::isPhantomAllocation):
* dfg/DFGNodeType.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::OSRAvailabilityAnalysisPhase::run):
(JSC::DFG::LocalOSRAvailabilityCalculator::LocalOSRAvailabilityCalculator):
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
* dfg/DFGOSRAvailabilityAnalysisPhase.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGPreciseLocalClobberize.h:
(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGPromotedHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGPromotedHeapLocation.h:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::LowerDFGToB3):
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargs):
(JSC::FTL::DFG::LowerDFGToB3::getSpreadLengthFromInlineCallFrame):
(JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargsWithSpread):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationMaterializeObjectInOSR):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionMaxArguments):
* runtime/JSFixedArray.h:
(JSC::JSFixedArray::createFromArray):

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

3 years agoUnreviewed, rolling out r209058 and r209074.
commit-queue@webkit.org [Wed, 30 Nov 2016 04:54:04 +0000 (04:54 +0000)]
Unreviewed, rolling out r209058 and r209074.
https://bugs.webkit.org/show_bug.cgi?id=165188

These changes caused API test StringBuilderTest.Equal to crash
and/or fail. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Streamline and speed up tokenizer and segmented string
classes"
https://bugs.webkit.org/show_bug.cgi?id=165003
http://trac.webkit.org/changeset/209058

"REGRESSION (r209058): API test StringBuilderTest.Equal
crashing"
https://bugs.webkit.org/show_bug.cgi?id=165142
http://trac.webkit.org/changeset/209074

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

3 years ago[iOS] Add test for HTML form validation popover dismissal on tap
cdumez@apple.com [Wed, 30 Nov 2016 04:43:08 +0000 (04:43 +0000)]
[iOS] Add test for HTML form validation popover dismissal on tap
https://bugs.webkit.org/show_bug.cgi?id=165185

Reviewed by Simon Fraser.

Add test for HTML form validation popover dismissal on tap outside the
popover.

* fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: Added.
* fast/forms/ios/validation-bubble-dismiss-on-tap.html: Added.

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

3 years agoAX: ARIA tree & treeitem roles & aria-expanded state not spoken to VoiceOver iOS 10
n_wang@apple.com [Wed, 30 Nov 2016 04:38:28 +0000 (04:38 +0000)]
AX: ARIA tree & treeitem roles & aria-expanded state not spoken to VoiceOver iOS 10
https://bugs.webkit.org/show_bug.cgi?id=164936
<rdar://problem/29334274>

Reviewed by Chris Fleizach.

Source/WebCore:

Added a new container type on iOS for trees. Also, since the treeitem role is ignored
on iOS, we should expose the expanded status of a treeitem to its accessible children.

Test: accessibility/ios-simulator/treeitem-expanded.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
(-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
(-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
(-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):

LayoutTests:

* accessibility/ios-simulator/treeitem-expanded-expected.txt: Added.
* accessibility/ios-simulator/treeitem-expanded.html: Added.

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

3 years agoUnreviewed, rolling out r209096, r209104, and r209114.
cdumez@apple.com [Wed, 30 Nov 2016 04:37:03 +0000 (04:37 +0000)]
Unreviewed, rolling out r209096, r209104, and r209114.

Caused over 200 layout test failures on the bots

Reverted changesets:

"IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite
backend."
https://bugs.webkit.org/show_bug.cgi?id=164974
http://trac.webkit.org/changeset/209096

"Followup to:"
https://bugs.webkit.org/show_bug.cgi?id=164974
http://trac.webkit.org/changeset/209104

"REGRESSION (r209104): storage/indexeddb/modern/gc-closes-
database(-private).html timeout."
https://bugs.webkit.org/show_bug.cgi?id=165186
http://trac.webkit.org/changeset/209114

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

3 years ago[Modern Media Controls] Localization
commit-queue@webkit.org [Wed, 30 Nov 2016 04:26:20 +0000 (04:26 +0000)]
[Modern Media Controls] Localization
https://bugs.webkit.org/show_bug.cgi?id=165176

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

Source/WebCore:

We add a new localization file for the purpose of modern media controls, since we may
require different strings than the legacy one.

* English.lproj/modern-media-controls-localized-strings.js: Added.
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/pip-placard.js:
(PiPPlacard):
* Modules/modern-media-controls/main.js:
(UIString):
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsScript):

LayoutTests:

Using the modern media controls module loader to ensure we pick up main.js,
and also because it's the right thing to do.

* media/modern-media-controls/airplay-placard/airplay-placard.html:
* media/modern-media-controls/pip-placard/pip-placard.html:

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

3 years agoWeb Inspector: Improve name sorting in HeapSnapshot data grids
commit-queue@webkit.org [Wed, 30 Nov 2016 04:22:21 +0000 (04:22 +0000)]
Web Inspector: Improve name sorting in HeapSnapshot data grids
https://bugs.webkit.org/show_bug.cgi?id=165170
<rdar://problem/28784421>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-11-29
Reviewed by Matt Baker.

When sorting the Name column, group named properties and unnamed
properties and sort them each individually:

  - Sort named properties by their property name (property names will be unique if they exist)
  - Sort unnamed properties by their class name (guaranteed)
  - Sort any tied class names by their object id

This makes using the Object Graph with Name sort easier to follow.
In the ascending sort you see all the named properties first,
followed by the unnamed (internal) properties.

* UserInterface/Views/HeapSnapshotContentView.js:
(WebInspector.HeapSnapshotObjectGraphContentView):
Since this data grid column now sorts on more than just the "Class Name"
rename it to "Name".

* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WebInspector.HeapSnapshotDataGridTree.buildSortComparator):
Make the sort of the `className` column more general to handle sorting
by property names, class names, and object identifiers.

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get propertyName):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
Provide a lazy `propertyName` accessor where we compute it once and stash
it on the DataGridNode to avoid extra work when resorting.

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate.propertyName):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
In the initial populated sort, provide the necessary property name property
the sort comparator expects.

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

3 years agoREGRESSION (r209104): storage/indexeddb/modern/gc-closes-database(-private).html...
beidson@apple.com [Wed, 30 Nov 2016 03:50:41 +0000 (03:50 +0000)]
REGRESSION (r209104): storage/indexeddb/modern/gc-closes-database(-private).html timeout.
https://bugs.webkit.org/show_bug.cgi?id=165186

Unreviewed gardening.

* TestExpectations: Skip these tests for now until I can resolve things properly.

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

3 years ago[JSC] always wrap AwaitExpression operand in a new Promise
caitp@igalia.com [Wed, 30 Nov 2016 03:42:55 +0000 (03:42 +0000)]
[JSC] always wrap AwaitExpression operand in a new Promise
https://bugs.webkit.org/show_bug.cgi?id=165181

Reviewed by Yusuke Suzuki.

JSTests:

* stress/async-await-basic.js:
(async.awaitedPromisesAreWrapped):

Source/JavaScriptCore:

Ensure operand of AwaitExpression is wrapped in a new Promise by
explicitly creating a new Promise Capability and invoking its
resolve callback. This avoids the specified short-circuit for
Promise.resolve().

* builtins/AsyncFunctionPrototype.js:
(globalPrivate.asyncFunctionResume):

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

3 years agoWe should support CreateThis in the FTL
sbarati@apple.com [Wed, 30 Nov 2016 03:09:10 +0000 (03:09 +0000)]
We should support CreateThis in the FTL
https://bugs.webkit.org/show_bug.cgi?id=164904

Reviewed by Geoffrey Garen.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateThis):
(JSC::FTL::DFG::LowerDFGToB3::storeStructure):
(JSC::FTL::DFG::LowerDFGToB3::allocateCell):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateVariableSizedObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateVariableSizedCell):
* runtime/Structure.h:

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

3 years ago[Modern Media Controls] Show an invalid placard when we fail to load a media file
commit-queue@webkit.org [Wed, 30 Nov 2016 03:05:55 +0000 (03:05 +0000)]
[Modern Media Controls] Show an invalid placard when we fail to load a media file
https://bugs.webkit.org/show_bug.cgi?id=165180

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

Source/WebCore:

We now show a placard with an "invalid" icon when we fail to load the media file.

Tests: media/modern-media-controls/invalid-placard/invalid-placard.html
       media/modern-media-controls/placard-support/placard-support-error.html

* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/invalid-placard.js: Added.
(InvalidPlacard):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get showsStartButton):
(MediaControls.prototype.set showsStartButton):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.hidePlacard):
(MediaControls.prototype._invalidateChildren):
* Modules/modern-media-controls/controls/placard.css:
(.placard .icon):
* Modules/modern-media-controls/images/iOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@3x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

We add tests for the new InvalidPlacard class.

* media/modern-media-controls/invalid-placard/invalid-placard-expected.txt: Added.
* media/modern-media-controls/invalid-placard/invalid-placard.html: Added.
* media/modern-media-controls/media-controls/media-controls-constructor-expected.txt:
* media/modern-media-controls/media-controls/media-controls-constructor.html:
* media/modern-media-controls/media-controls/media-controls-placard-expected.txt:
* media/modern-media-controls/media-controls/media-controls-placard.html:
* media/modern-media-controls/placard-support/placard-support-error-expected.txt: Added.
* media/modern-media-controls/placard-support/placard-support-error.html: Added.

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

3 years agoAllow TracePoint to take arbitrary data
simon.fraser@apple.com [Wed, 30 Nov 2016 03:02:32 +0000 (03:02 +0000)]
Allow TracePoint to take arbitrary data
https://bugs.webkit.org/show_bug.cgi?id=165182

Reviewed by Tim Horton.

Allow TracePoint() to take four numeric arguments, for arbitrary data.

#pragma once

* wtf/SystemTracing.h:
(WTF::TracePoint):

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

3 years ago[Modern Media Controls] Only show controls when the controls attribute is set
commit-queue@webkit.org [Wed, 30 Nov 2016 02:26:04 +0000 (02:26 +0000)]
[Modern Media Controls] Only show controls when the controls attribute is set
https://bugs.webkit.org/show_bug.cgi?id=165175

Source/WebCore:

We now respect the value of the media's "controls" attribute so that the start button and the controls
bar are only shown when that attribute is set to "true".

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

Tests: media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html
       media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html

* Modules/modern-media-controls/controls/controls-bar.js: Added.
(ControlsBar):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/controls-visibility-support.js: Added.
(ControlsVisibilitySupport):
(ControlsVisibilitySupport.prototype.destroy):
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.handleEvent):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

We add new tests to check that the media's "control" attribute is respected. We also update a
series of tests to be more robust and turn the media "controls" attribute on so that the controls
bar is displayed as required by the tests.

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

* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle-expected.txt: Added.
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html: Added.
* media/modern-media-controls/fullscreen-support/fullscreen-support-click.html:
* media/modern-media-controls/media-controls/media-controls-constructor-expected.txt:
* media/modern-media-controls/media-controls/media-controls-constructor.html:
* media/modern-media-controls/pip-support/pip-support-click.html:
* media/modern-media-controls/placard-support/placard-support-airplay.html:
* media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt:
* media/modern-media-controls/scrubber-support/scrubber-support-click.html:
* media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt:
* media/modern-media-controls/scrubber-support/scrubber-support-drag.html:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag.html:

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

3 years agoFollowup to:
beidson@apple.com [Wed, 30 Nov 2016 01:16:18 +0000 (01:16 +0000)]
Followup to:
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974

Unreviewed.

* Modules/indexeddb/IDBTransaction.h: Until I can explore further why these operations
  are not protected in the map, change these raw pointers to RefPtrs.
  This fixes issues seen under GuardMalloc.

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

3 years agoRemove WebPage::SetPageSuppressed
barraclough@apple.com [Wed, 30 Nov 2016 01:08:35 +0000 (01:08 +0000)]
Remove WebPage::SetPageSuppressed
https://bugs.webkit.org/show_bug.cgi?id=165158

Unreviewed revert accidental change.

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

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

3 years agoRemove WebPage::SetPageSuppressed
barraclough@apple.com [Wed, 30 Nov 2016 01:00:12 +0000 (01:00 +0000)]
Remove WebPage::SetPageSuppressed
https://bugs.webkit.org/show_bug.cgi?id=165158

Reviewed by Tim Horton.

This was scaffolding. We've now refactored to the point that the information driving throttling originates
from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
don't need a separate message to handle this - necessary state to determine is provided in ActivityState.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateThrottleState):
    - used to send SetPageSuppressed; no longer does.
* UIProcess/WebPageProxy.h:
    - removed m_pageSuppressed (was used to avoid duplicated messages).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
    - compute throttle state based on m_activityState.
(WebKit::WebPage::setActivityState):
    - update throttle state whenever activity state changes.
(WebKit::WebPage::updatePreferences):
    - update throttle state whenever preferences change (throttling can be disabled via preference).
(WebKit::WebPage::setPageSuppressed): Deleted.
    - Removed WebPage::SetPageSuppressed.
* WebProcess/WebPage/WebPage.h:
    - Removed WebPage::SetPageSuppressed.
    - Added m_processSuppressionEnabled, to cache preference state.
* WebProcess/WebPage/WebPage.messages.in:
    - Removed WebPage::SetPageSuppressed.

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

3 years agoFix exception scope verification failures in runtime/RegExp* files.
mark.lam@apple.com [Wed, 30 Nov 2016 00:06:50 +0000 (00:06 +0000)]
Fix exception scope verification failures in runtime/RegExp* files.
https://bugs.webkit.org/show_bug.cgi?id=165054

Reviewed by Saam Barati.

Also replaced returning JSValue() with returning { }.

* runtime/RegExpConstructor.cpp:
(JSC::toFlags):
(JSC::regExpCreate):
(JSC::constructRegExp):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):
(JSC::collectMatches):
(JSC::RegExpObject::matchGlobal):
* runtime/RegExpObjectInlines.h:
(JSC::getRegExpObjectLastIndexAsUnsigned):
(JSC::RegExpObject::execInline):
(JSC::RegExpObject::matchInline):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::flagsString):
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoFuncSplitFast):

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

3 years agoMarking media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html...
ryanhaddad@apple.com [Wed, 30 Nov 2016 00:00:33 +0000 (00:00 +0000)]
Marking media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html as flaky on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=165169

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years ago[Modern Media Controls] Inline controls show when entering fullscreen
commit-queue@webkit.org [Tue, 29 Nov 2016 23:38:40 +0000 (23:38 +0000)]
[Modern Media Controls] Inline controls show when entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165161

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

We would error when entering fullscreen due to the TracksSupport having its destroy() method
called when tearing down the inline controls and the `mediaController` reference being incorrect.

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

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

3 years ago[Modern Media Controls] Status text stuck saying "Loading" after media starts playing
commit-queue@webkit.org [Tue, 29 Nov 2016 23:38:19 +0000 (23:38 +0000)]
[Modern Media Controls] Status text stuck saying "Loading" after media starts playing
https://bugs.webkit.org/show_bug.cgi?id=165162

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

Source/WebCore:

We forgot to handle the case where none of the special messages need to be set and the
status text should be just an empty string, meaning there is no status text shown in the
controls bar and the scrubber appears instead.

Test: media/modern-media-controls/status-support/status-support-playing.html

* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):

LayoutTests:

Adding a new test ensuring the status text is the empty string once the media starts playing.

* media/modern-media-controls/status-support/status-support-playing-expected.txt: Added.
* media/modern-media-controls/status-support/status-support-playing.html: Added.

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

3 years agoMarking js/dom/modules/module-will-fire-beforeload.html as flaky on mac-wk2 debug.
ryanhaddad@apple.com [Tue, 29 Nov 2016 23:35:19 +0000 (23:35 +0000)]
Marking js/dom/modules/module-will-fire-beforeload.html as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=164883

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoIndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
beidson@apple.com [Tue, 29 Nov 2016 23:28:00 +0000 (23:28 +0000)]
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974

Reviewed by Alex Christensen.

No new tests (No behavior change other than being faster).

Instead of building new SQLiteStatements from scratch each time they're needed and then
finalizing them after used for a single operation, cache them.

For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

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

3 years agoMarking http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html...
ryanhaddad@apple.com [Tue, 29 Nov 2016 23:26:21 +0000 (23:26 +0000)]
Marking http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html as flaky on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=165165

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoMarking http/tests/storage/callbacks-are-called-in-correct-context.html as a timeout...
ryanhaddad@apple.com [Tue, 29 Nov 2016 23:21:43 +0000 (23:21 +0000)]
Marking http/tests/storage/callbacks-are-called-in-correct-context.html as a timeout on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=164961

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoMarking http/tests/security/module-correct-mime-types.html as slow on ios-simulator...
ryanhaddad@apple.com [Tue, 29 Nov 2016 23:17:31 +0000 (23:17 +0000)]
Marking http/tests/security/module-correct-mime-types.html as slow on ios-simulator-wk2.
https://bugs.webkit.org/show_bug.cgi?id=164960

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoUpdate SubtleCrypto::sign to match the latest spec
jiewen_tan@apple.com [Tue, 29 Nov 2016 22:52:03 +0000 (22:52 +0000)]
Update SubtleCrypto::sign to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164740
<rdar://problem/29257864>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::sign method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-sign.
2. It implements sign operations of the following algorithms: HMAC, and
   RSASSA-PKCS1-V1_5.
3. It also replaces promise.copyRef() with WTFMove(promise) for all the
   capture lists of exception callbacks in promise functions.

Tests: crypto/subtle/hmac-import-key-sign-sha1.html
       crypto/subtle/hmac-import-key-sign-sha224.html
       crypto/subtle/hmac-import-key-sign-sha256.html
       crypto/subtle/hmac-import-key-sign-sha384.html
       crypto/subtle/hmac-import-key-sign-sha512.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha1.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha224.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha256.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha384.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha512.html
       crypto/subtle/sign-malformed-parameters.html
       crypto/workers/subtle/hmac-import-key-sign.html
       crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-sign.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
Fix a minor bug.
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionSignPromise):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::sign):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::sign):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::CryptoAlgorithmHMAC::platformSign):
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformSign):
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::commonCryptoHMACAlgorithm):
(WebCore::calculateSignature):
Remove a null guardance since the depending bug is resolved.
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::signRSASSA_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):

LayoutTests:

* crypto/subtle/hmac-import-key-sign-sha1-expected.txt: Added.
* crypto/subtle/hmac-import-key-sign-sha1.html: Added.
* crypto/subtle/hmac-import-key-sign-sha224-expected.txt: Added.
* crypto/subtle/hmac-import-key-sign-sha224.html: Added.
* crypto/subtle/hmac-import-key-sign-sha256-expected.txt: Added.
* crypto/subtle/hmac-import-key-sign-sha256.html: Added.
* crypto/subtle/hmac-import-key-sign-sha384-expected.txt: Added.
* crypto/subtle/hmac-import-key-sign-sha384.html: Added.
* crypto/subtle/hmac-import-key-sign-sha512-expected.txt: Added.
* crypto/subtle/hmac-import-key-sign-sha512.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha1-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha1.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha224-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha224.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha256-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha256.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha384-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha384.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha512-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha512.html: Added.
* crypto/subtle/sign-malformed-parameters-expected.txt: Added.
* crypto/subtle/sign-malformed-parameters.html: Added.
* crypto/workers/subtle/hmac-import-key-sign-expected.txt: Added.
* crypto/workers/subtle/hmac-import-key-sign.html: Added.
* crypto/workers/subtle/resources/hmac-import-key-sign.js: Added.
* crypto/workers/subtle/resources/rsassa-pkcs1-v1_5-import-key-sign.js: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-sign-expected.txt: Added.
* crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-sign.html: Added.

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

3 years agoCan't download move.simple.com direct deposit transition PDF: Non user-triggered...
cdumez@apple.com [Tue, 29 Nov 2016 22:38:26 +0000 (22:38 +0000)]
Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored
https://bugs.webkit.org/show_bug.cgi?id=165148
<rdar://problem/29421771>

Reviewed by Daniel Bates.

Source/WebCore:

We were ignoring non user-triggered activations of anchors that have a
download attribute which is stricter than Chrome and Firefox and breaks
downloads on move.simple.com. This patch relaxes our policy to allow
simulated clicks on such links, similarly to other browsers.

Web authors can anyway already trigger downloads using script by setting
window.location to a specific URL and serving to right HTTP headers to
trigger a download.

Note that our previous behavior matches the current version of the
specification so I also filed a bug against the HTML specification to
see if we can get it changed to match the behavior of browsers:
- https://github.com/whatwg/html/issues/2116

No new tests, updated existing test.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

LayoutTests:

Update existing test to reflect behavior change.

* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html:

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

3 years ago[Linux] run-benchmark should be able to execute the benchmarks with more browsers.
clopez@igalia.com [Tue, 29 Nov 2016 22:15:52 +0000 (22:15 +0000)]
[Linux] run-benchmark should be able to execute the benchmarks with more browsers.
https://bugs.webkit.org/show_bug.cgi?id=164792

Reviewed by Michael Catanzaro.

This removes the GTKBrowserDriver (and the platform 'gtk') from the run-benchmark script,
and adds a new LinuxBrowserDriver with a platform 'linux'.

It add also drivers for Chrome (Chromium), Firefox, Epiphany and MiniBrowser-GTK (previously MiniBrowser).

The detection of the platform is now done automatically, so it is not longer needed to pass a "--platform" parameter.

The tracking of the browser process is now more robust, we track the pid of the browser process and we only try to
kill the ones that were executed by this script, instead of doing a 'killall $browser' (like before).
We also check for browser process childs and we kill them if they are still alive after the main browser process has been killed.
This depends on psutil, so this will only be done if psutil is installed.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunBenchmarkTests.start): The platform is now autodetected and the MiniBrowser driver is renamed to MiniBrowser-GTK.
* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner._run_benchmark): Fix a bug that caused close_browsers to be called twice. Its already called inside BenchmarkRunner._run_one_test.
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py: Added.
(LinuxBrowserDriver): Implement base class that has all the needed functionality for driving the browsers.
(LinuxBrowserDriver.__init__):
(LinuxBrowserDriver.prepare_env):
(LinuxBrowserDriver.restore_env):
(LinuxBrowserDriver.close_browsers): Made the dependency on psutil optional (because it was listed as such on the README file <Tools/Scripts/webkitpy/benchmark_runner/README.md>)
(LinuxBrowserDriver.launch_url):
(LinuxBrowserDriver._get_first_executable_path_from_list):
(LinuxBrowserDriver._screen_size):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_chrome_driver.py: Copied from Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py.
(LinuxChromeDriver):
(LinuxChromeDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_epiphany_driver.py: Renamed from Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_browser_driver.py.
(EpiphanyBrowserDriver):
(EpiphanyBrowserDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_firefox_driver.py: Copied from Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py.
(LinuxFirefoxDriver):
(LinuxFirefoxDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py: Renamed from Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py.
(GTKMiniBrowserDriver):
(GTKMiniBrowserDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
(SimpleHTTPServerDriver):
* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(getplatform):
(getdefaultbrowser):
(parse_args):
* Scripts/webkitpy/benchmark_runner/utils.py:
(load_subclasses): The loading of subclasses was still (even after r196979) sensitive to the order in which the modules are loaded.
We have to ensure that the files containing subclasses of the base_class_file are loaded after the base_class_file,
we can do that by matching against the base_class_file pattern when the list is created.

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

3 years agoWeb Inspector: Breakpoints button enabled state is too subtle
mattbaker@apple.com [Tue, 29 Nov 2016 21:49:51 +0000 (21:49 +0000)]
Web Inspector: Breakpoints button enabled state is too subtle
https://bugs.webkit.org/show_bug.cgi?id=165153

Reviewed by Joseph Pecoraro.

* UserInterface/Images/Breakpoints.svg:
Change to path so stroke and fill can be styled.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-breakpoints):
(.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-breakpoints.activated):
Fill and stroke styles for the active and inactive breakpoint button.

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

3 years ago[Cocoa] Enable two clang warnings recommended by Xcode
aestes@apple.com [Tue, 29 Nov 2016 21:36:51 +0000 (21:36 +0000)]
[Cocoa] Enable two clang warnings recommended by Xcode
https://bugs.webkit.org/show_bug.cgi?id=164498

Reviewed by Mark Lam.

Source/bmalloc:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Source/JavaScriptCore:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Source/WebCore:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Source/WebKit/mac:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Source/WebKit2:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Source/WTF:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
* MiniBrowser/Configurations/Base.xcconfig: Ditto.
* TestWebKitAPI/Configurations/Base.xcconfig: Ditto.
* WebKitTestRunner/Configurations/Base.xcconfig: Ditto.

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

3 years agoAddress post-review feedback following r209070 (AppKit momentum scrolling adoption...
wenson_hsieh@apple.com [Tue, 29 Nov 2016 21:12:26 +0000 (21:12 +0000)]
Address post-review feedback following r209070 (AppKit momentum scrolling adoption for scroll snapping)
https://bugs.webkit.org/show_bug.cgi?id=165147

Reviewed by Simon Fraser.

Addresses some additional review feedback after r209070, which adopts _NSScrollingMomentumCalculator for scroll
snapping. See individual changes below for more details. No new tests, since there is no behavior change.

* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/Page.cpp:
(WebCore::Page::ensureTestTrigger):
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredVelocity):
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):

Rather than force a complete layout pass when the Page first acquires a WheelEventTestTrigger, we now simply
have the scrolling coordinator update its frame node to expect a wheel event test trigger.

* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
(WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
(WebCore::BasicScrollingMomentumCalculator::animationDuration):
(WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
(WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
* page/scrolling/ScrollingMomentumCalculator.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
(WebCore::PlatformWheelEvent::scrollingVelocity):

Change scrolling velocity in PlatformWheelEvent to be a FloatSize instead of a FloatPoint. This change
propagates to the ScrollController, where state variables and arguments pertaining to scrolling velocity are
also now sizes instead of points.

* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::scheduleStatelessScrollSnap):
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
(WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):

Refactor elapsed time to be Seconds instead of double. Additionally, use MonotonicTime::now() instead of
monotonicallyIncreasingTime(), and MonotonicTime instead of double for keeping track of the start time.

* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:

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

3 years agoIndexedDB 2.0: The client's transaction operation queue should flush as much to the...
beidson@apple.com [Tue, 29 Nov 2016 21:08:12 +0000 (21:08 +0000)]
IndexedDB 2.0: The client's transaction operation queue should flush as much to the server as possible.
https://bugs.webkit.org/show_bug.cgi?id=164932

Reviewed by Alex Christensen.

No new tests (No new test necessary, covered extensively by all existing tests).

Profiles showed that on tests with lots of rapid IDBRequests in a row, both the main thread and database
threads were largely idle.

The explanation was simple. Currently the client IDBTransaction queues up operations and only vends them out
to the server 1 at a time, waiting for the previous operation to complete.

While some operations do need to wait for the server to reply, by making the change to send most operations
(all operations with an associated IDBRequest) to the server without waiting we get rid of most of the idleness.

It is possible we can find a few other types of operations to send without waiting, but we haven't yet seen any
test case where they would show up on profiles.

Sending more than one operation at a time was actually a very small part of this change.
As many "edge case" regression tests revealed, we also needed to start having IDBTransaction track all of their
"in progress" operations such that they could be aborted on the client side in exceptional circumstances.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortInProgressOperations): Abort's all in-progress operations (ones that have already
  been sent to the server)
(WebCore::IDBTransaction::abortOnServerAndCancelRequests): Abort in-progress operations before pending ones.
(WebCore::IDBTransaction::operationTimerFired): If we just started an operation with an associated IDBRequest,
  schedule the timer to send another one right away.
(WebCore::IDBTransaction::operationDidComplete):
(WebCore::IDBTransaction::connectionClosedFromServer): Abort in-progress operations before pending ones.
* Modules/indexeddb/IDBTransaction.h:

* Modules/indexeddb/client/TransactionOperation.cpp:
(WebCore::IDBClient::TransactionOperation::TransactionOperation):
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::completed):
(WebCore::IDBClient::TransactionOperation::hasIDBRequest):

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

3 years ago[CSS Parser] Fix ::cue parsing
hyatt@apple.com [Tue, 29 Nov 2016 21:04:05 +0000 (21:04 +0000)]
[CSS Parser] Fix ::cue parsing
https://bugs.webkit.org/show_bug.cgi?id=165152

Reviewed by Zalan Bujtas.

* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setPseudoElementType):
* css/parser/CSSSelectorParser.cpp:
(WebCore::isOnlyPseudoClassFunction):
(WebCore::isOnlyPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::isPseudoClassFunction): Deleted.
(WebCore::isPseudoElementFunction): Deleted.

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

3 years agoHTMLMediaElement::updateVolume should updateIsPlayingMedia
barraclough@apple.com [Tue, 29 Nov 2016 19:46:31 +0000 (19:46 +0000)]
HTMLMediaElement::updateVolume should updateIsPlayingMedia
https://bugs.webkit.org/show_bug.cgi?id=165132

Reviewed by Darin Adler & Jer Noble.

HTMLMediaElement::mediaState takes the volume into account when determining whether media
is playing (audio is not considered to be playing if volume is 0). As such, any change to
the volume may require mediaState to be recomputed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume):

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

3 years agoAdd simple way to implement Wasm ops that require more than one B3 opcode
keith_miller@apple.com [Tue, 29 Nov 2016 19:37:00 +0000 (19:37 +0000)]
Add simple way to implement Wasm ops that require more than one B3 opcode
https://bugs.webkit.org/show_bug.cgi?id=165129

Reviewed by Geoffrey Garen.

JSTests:

* wasm/function-tests/eqz.js: Added.
* wasm/function-tests/max.js: Added.
* wasm/function-tests/min.js: Added.
* wasm/wasm.json:

Source/JavaScriptCore:

This patch adds a simple way to show the B3IRGenerator opcode script how
to generate code for Wasm opcodes that do not have a one to one mapping.
The syntax is pretty simple right now. There are only three things one
can use as of this patch (although more things might be added in the future)
1) Wasm opcode arguments: These are referred to as @<argument_number>. For example,
   I32.sub would map to Sub(@0, @1).
2) 32-bit int constants: These are reffered to as i32(<value>). For example, i32.inc
   would map to Add(@0, i32(1))
3) B3 opcodes: These are referred to as the B3 opcode name followed by the B3Value's constructor
   arguments. A value may take the result of another value as an argument. For example, you can do
   Div(Mul(@0, Add(@0, i32(1))), i32(2)) if there was a b3 opcode that computed the sum from 1 to n.

These scripts are used to implement Wasm's eqz and floating point max/min opcodes. This patch
also adds missing support for the Wasm Neg opcodes.

* jsc.cpp:
(box):
(functionTestWasmModuleFunctions):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::toB3Op): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseBody):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseType):
* wasm/WasmParser.h:
(JSC::Wasm::Parser::parseUInt8):
(JSC::Wasm::Parser::parseValueType):
* wasm/generateWasmB3IRGeneratorInlinesHeader.py:
(Source):
(Source.__init__):
(read):
(lex):
(CodeGenerator):
(CodeGenerator.__init__):
(CodeGenerator.advance):
(CodeGenerator.token):
(CodeGenerator.parseError):
(CodeGenerator.consume):
(CodeGenerator.generateParameters):
(CodeGenerator.generateOpcode):
(CodeGenerator.generate):
(temp):
(generateB3OpCode):
(generateI32ConstCode):
(generateB3Code):
(generateSimpleCode):
* wasm/wasm.json:

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