WebKit-https.git
5 years agoAdd anchor tags for scroll snapping examples.
wenson_hsieh@apple.com [Wed, 16 Sep 2015 01:14:29 +0000 (01:14 +0000)]
Add anchor tags for scroll snapping examples.

* demos/scroll-snap/index.html: Added anchor tags.

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

5 years agoWeb Inspector: Paused Debugger prevents page reload
commit-queue@webkit.org [Wed, 16 Sep 2015 01:03:35 +0000 (01:03 +0000)]
Web Inspector: Paused Debugger prevents page reload
https://bugs.webkit.org/show_bug.cgi?id=148174

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

Source/JavaScriptCore:

* debugger/Debugger.h:
(JSC::Debugger::suppressAllPauses):
(JSC::Debugger::setSuppressAllPauses):
* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::pauseIfNeeded):
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::setSuppressAllPauses):
Provide a way to suppress pauses.

Source/WebCore:

When navigating the page while paused, suppress any pausing until the page
has completed navigation. If not paused and navigating, you can still pause
in pagehide and unload handlers or other late page events.

Could not write a reliable test for this at the moment.
InspectorTest.reloadPage has multiple issues with the output,
so I'll investigate making reload tests more reliable later.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::resume): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
We now use existing InspectorInstrumentation functions instead of a method
on InspectorController during load. In dropping the method InspectorController
can drop a member variable no longer used.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willStartProvisionalLoad):
Add a new instrumentation hook.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
When starting or completing main frame navigations, let the PageDebuggerAgent do some work.

* inspector/PageDebuggerAgent.h:
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::mainFrameStartedLoading):
(WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
(WebCore::PageDebuggerAgent::mainFrameNavigated):
Suppress pausing if navigating while paused. Otherwise behave as normal.

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

5 years ago[Win] Provide a means for viewing the layer tree
bfulgham@apple.com [Wed, 16 Sep 2015 01:00:32 +0000 (01:00 +0000)]
[Win] Provide a means for viewing the layer tree
https://bugs.webkit.org/show_bug.cgi?id=149165

Reviewed by Simon Fraser.

Source/WebCore:

Revise the old fprintf logic to generate a string
containing the layer tree so that it can be output
to the debugger (or elsewhere).

* platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
to 'printLayerTree', and make it available in release builds.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
the PlatformCALayer implementation.
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printIndent): Revise to use two-space indent and use StringBuilder.
(printTransform): Ditto.
(printColor): Added helper function.
(printLayer): Revised to output information on the layer contents.
(PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
(PlatformCALayerWin::printTree): Deleted.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
cocoa repaint counter logic by not painting counters for the layers that
contain the tile grid.
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::drawRepaintCounters):

Source/WebKit/win:

Add a new WebView method "printLayerTree" so that clients
can get a string dump of the current layer tree. Add this
to a new COM interface version so no existing clients break
compatibility.

* Interfaces/IWebViewPrivate.idl:
* WebView.cpp:
(WebView::QueryInterface): Recognize the new interface version.
(WebView::printLayerTree): Added. This just calls the WebCore
implementation.
* WebView.h:

Tools:

Update MiniBrowser with a new Debug menu option that will
dump the current layer tree to the debug console.

* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc:
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h:
* MiniBrowser/win/Common.cpp:
(WndProc): Add handler for 'Print Layer Tree' menu option.
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::printLayerTree): Added Handler.
* MiniBrowser/win/MiniBrowser.h:

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

5 years agoNested isolates can cause an infinite loop when laying out bidi runs
mmaxfield@apple.com [Wed, 16 Sep 2015 00:30:38 +0000 (00:30 +0000)]
Nested isolates can cause an infinite loop when laying out bidi runs
https://bugs.webkit.org/show_bug.cgi?id=149153

Reviewed by David Hyatt.

Source/WebCore:

When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
situation, we will append a placeholder run in the run list, and remember a pointer to these
isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
to the isolated runs and handle them separately (and replace the placeholder with the result).

However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
local root of the render tree we were inspecting (to ensure that we visit the same node
multiple times if there are nested isolate spans). We were not correctly keeping track of this
local root, which was leading us to consider the same root multiple times, thereby leading to
an infinite loop.

The solution is simply to keep root information alongside the isolated run information inside
BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
be a template argument, just like how BidiRun itself is a template argument.

This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
which we will replace.

Test: fast/text/international/unicode-bidi-isolate-nested-crash.html

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
in Void.
* platform/text/BidiResolver.h: Add template argument.
(WebCore::BidiResolver::isolatedRuns):
(WebCore::IsolatedRun>::~BidiResolver):
(WebCore::IsolatedRun>::appendRun):
(WebCore::IsolatedRun>::embed):
(WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
(WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
(WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
(WebCore::IsolatedRun>::commitExplicitEmbedding):
(WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
(WebCore::IsolatedRun>::reorderRunsFromLevels):
(WebCore::IsolatedRun>::createBidiRunsForLine):
(WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
(WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
(WebCore::Run>::~BidiResolver): Deleted.
(WebCore::Run>::appendRun): Deleted.
(WebCore::Run>::embed): Deleted.
(WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
(WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::commitExplicitEmbedding): Deleted.
(WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
(WebCore::Run>::reorderRunsFromLevels): Deleted.
(WebCore::Run>::createBidiRunsForLine): Deleted.
(WebCore::Run>::setMidpointForIsolatedRun): Deleted.
(WebCore::Run>::midpointForIsolatedRun): Deleted.
* rendering/InlineIterator.h:
(WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
(WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
information.
(WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
(WebCore::InlineBidiResolver::appendRun): Ditto.
* rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
(WebCore::setUpResolverToResumeInIsolate):
(WebCore::constructBidiRunsForSegment):
* rendering/line/TrailingObjects.h:

LayoutTests:

* fast/text/international/unicode-bidi-isolate-nested-crash-expected.html: Added.
* fast/text/international/unicode-bidi-isolate-nested-crash.html: Added.

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

5 years agoAdd empty IDBFactory implementation for Modern IDB.
beidson@apple.com [Wed, 16 Sep 2015 00:19:29 +0000 (00:19 +0000)]
Add empty IDBFactory implementation for Modern IDB.
https://bugs.webkit.org/show_bug.cgi?id=149191

Reviewed by Jer Noble.

Source/WebCore:

No new tests (No behavior change).

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):

* Modules/indexeddb/client/IDBFactoryImpl.cpp:
(WebCore::IDBClient::IDBFactory::create):
(WebCore::IDBClient::IDBFactory::IDBFactory):
(WebCore::IDBClient::IDBFactory::getDatabaseNames):
(WebCore::IDBClient::IDBFactory::open):
(WebCore::IDBClient::IDBFactory::deleteDatabase):
(WebCore::IDBClient::IDBFactory::cmp):
* Modules/indexeddb/client/IDBFactoryImpl.h:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* loader/EmptyClients.cpp:
* page/DatabaseProvider.h:

Source/WebKit:

* Storage/WebDatabaseProvider.h:

Source/WebKit2:

* WebProcess/Databases/WebDatabaseProvider.h:

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

5 years agoSplit FontDescription into lower and higher level types
antti@apple.com [Wed, 16 Sep 2015 00:16:58 +0000 (00:16 +0000)]
Split FontDescription into lower and higher level types
https://bugs.webkit.org/show_bug.cgi?id=149036

Reviewed by Darin Adler.

Currently FontDescription is used through the text subsystem. However much of the data it
carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
layer. This makes code confusing. For example families specified in FontDescription are ignored
at lower levels.

Split it into a low level FontDescription and a high level FontCascadeDescription type:

FontDescription <-> Font
FontCascadeDescription <-> FontCascade

The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
The latter has additional data for CSS font cascade semantics and other higher level features.

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

5 years agoGraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
mmaxfield@apple.com [Wed, 16 Sep 2015 00:05:58 +0000 (00:05 +0000)]
GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
https://bugs.webkit.org/show_bug.cgi?id=149193

Reviewed by Anders Carlsson.

There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
should have this member variable.

This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
Template pattern to downcast into specializations.

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

No new tests because there is no behavior change.

* platform/text/BidiResolver.h:
(WebCore::BidiResolverBase::BidiResolverBase):
(WebCore::BidiResolverBase::increment):
(WebCore::BidiResolverBase::appendRun):
(WebCore::BidiResolverBase::incrementInternal):
(WebCore::IsolateRun>::~BidiResolverWithIsolate):
(WebCore::Subclass>::appendRunInternal):
(WebCore::Subclass>::embed):
(WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
(WebCore::Subclass>::lowerExplicitEmbeddingLevel):
(WebCore::Subclass>::raiseExplicitEmbeddingLevel):
(WebCore::Subclass>::commitExplicitEmbedding):
(WebCore::Subclass>::updateStatusLastFromCurrentDirection):
(WebCore::Subclass>::reorderRunsFromLevels):
(WebCore::Subclass>::createBidiRunsForLine):
(WebCore::Subclass>::setMidpointForIsolatedRun):
(WebCore::Subclass>::midpointForIsolatedRun):
(WebCore::BidiResolver::BidiResolver): Deleted.
(WebCore::BidiResolver::increment): Deleted.
(WebCore::BidiResolver::isolatedRuns): Deleted.
(WebCore::Run>::~BidiResolver): Deleted.
(WebCore::Run>::appendRun): Deleted.
(WebCore::Run>::embed): Deleted.
(WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
(WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::commitExplicitEmbedding): Deleted.
(WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
(WebCore::Run>::reorderRunsFromLevels): Deleted.
(WebCore::Run>::createBidiRunsForLine): Deleted.
(WebCore::Run>::setMidpointForIsolatedRun): Deleted.
(WebCore::Run>::midpointForIsolatedRun): Deleted.
* rendering/InlineIterator.h:
(WebCore::InlineBidiResolver::incrementInternal):
(WebCore::InlineBidiResolver::appendRunInternal):
(WebCore::InlineBidiResolver::increment): Deleted.
(WebCore::InlineBidiResolver::appendRun): Deleted.
* rendering/line/TrailingObjects.h:

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

5 years agoWeb Inspector: command-click in NewTabContentView should open new tab without switchi...
bburg@apple.com [Tue, 15 Sep 2015 23:44:30 +0000 (23:44 +0000)]
Web Inspector: command-click in NewTabContentView should open new tab without switching to it
https://bugs.webkit.org/show_bug.cgi?id=149173

Reviewed by Joseph Pecoraro.

To allow a user to quickly restore tabs, it should be possible to command-click
all the tabs that are desired without going back through the [+] tab button.

* UserInterface/Base/Main.js:
(WebInspector.createNewTabWithType): Renamed.

    Use an options object and split creating the tab from deleting the
    replaced tab and showing the new tab. Add better error checking.

(WebInspector.createNewTab): Deleted.
* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView):
(WebInspector.NewTabContentView.prototype._createNewTabWithType): Renamed.

    If the meta key is pressed, don't switch to the new tab or remove this view
    unless there are no more tabs that can be created beyond the current one.

(WebInspector.NewTabContentView.prototype._allowableTabTypes): Added.
(WebInspector.NewTabContentView.prototype._createNewTab): Deleted.

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

5 years agonew Event() without parameter should throw
cdumez@apple.com [Tue, 15 Sep 2015 22:10:54 +0000 (22:10 +0000)]
new Event() without parameter should throw
https://bugs.webkit.org/show_bug.cgi?id=149146
<rdar://problem/22565070>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that a new check is passing.

* web-platform-tests/dom/events/Event-constructors-expected.txt:

Source/WebCore:

new Event() without parameter should throw because the type parameter
is mandatory as per the specification:
https://dom.spec.whatwg.org/#interface-event

Both Firefox and Chrome throw in this case. However, WebKit was
creating an event whose type is the string "undefined". This patch
aligns our behavior with the specification and other major browsers.

No new tests, already covered by existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):

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

5 years ago[GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv...
clopez@igalia.com [Tue, 15 Sep 2015 21:50:18 +0000 (21:50 +0000)]
[GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
https://bugs.webkit.org/show_bug.cgi?id=149172

Reviewed by Martin Robinson.

No new tests, no behavior change.

* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::cairoDevice):

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

5 years agoElement.getAttributeNS() should return null if the attribute does not exist
cdumez@apple.com [Tue, 15 Sep 2015 21:39:02 +0000 (21:39 +0000)]
Element.getAttributeNS() should return null if the attribute does not exist
https://bugs.webkit.org/show_bug.cgi?id=149180
<rdar://problem/22561011>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C DOM tests now that more checks are passing.

* web-platform-tests/dom/nodes/attributes-expected.txt:
* web-platform-tests/dom/nodes/case-expected.txt:

Source/WebCore:

Element.getAttributeNS() should return null if the attribute does not
exist, similarly to what Element.getAttribute() does:
- https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
- https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)

Firefox and Chrome match the specification. However, WebKit was returning
an empty string for getAttributeNS() and null for getAttribute(). This
patch aligns WebKit's behavior with the specification and other browsers.

No new tests, already covered by existing tests.

* dom/Element.idl:

LayoutTests:

Rebaseline / update existing tests now that our behavior has changed.

* fast/dom/Element/attribute-uppercase-expected.txt:
* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt:
* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html:
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt:
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-2-expected.txt:

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

5 years agoContentDistribution should be only used for details elements
rniwa@webkit.org [Tue, 15 Sep 2015 21:31:31 +0000 (21:31 +0000)]
ContentDistribution should be only used for details elements
https://bugs.webkit.org/show_bug.cgi?id=149148

Reviewed by Antti Koivisto.

Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.

We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
a slot-based shadow DOM implementation.

No new tests. There should be no observable behavioral change.

* dom/Element.cpp:
(WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
(WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
~Element.
(WebCore::Element::createShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
since HTMLDetailsElement uses a subclass of ShadowRoot.
(WebCore::Element::childrenChanged):
(WebCore::Element::removeAllEventListeners):

* dom/Element.h:
(Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::childrenChanged): Deleted.

* dom/ShadowRoot.h:
(WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
(WebCore::ShadowRoot::isOrphan):

* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
only relevant for HTMLDetailsElement's shadow DOM.

* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.

* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
(WebCore::ContentDistributor::ensureDistribution):
(WebCore::ContentDistributor::invalidateDistribution):

* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::childrenChanged):
(WebCore::InsertionPoint::insertedInto):
(WebCore::InsertionPoint::removedFrom):
(WebCore::findInsertionPointOf):
(WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.

* html/shadow/InsertionPoint.h:
(WebCore::ShadowRootWithInsertionPoints::create): Added.
(WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.

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

5 years agoUnreviewed, rebaseline several W3C HTML tests on iOS after r189762.
cdumez@apple.com [Tue, 15 Sep 2015 20:42:22 +0000 (20:42 +0000)]
Unreviewed, rebaseline several W3C HTML tests on iOS after r189762.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt:

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

5 years agoImplement calls to JavaScript functions in WebAssembly
commit-queue@webkit.org [Tue, 15 Sep 2015 20:00:23 +0000 (20:00 +0000)]
Implement calls to JavaScript functions in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149093

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-15
Reviewed by Filip Pizlo.

This patch implements calls to JavaScript functions in WebAssembly.
WebAssembly functions can only call JavaScript functions that are
imported to their module via an object that is passed into
loadWebAssembly(). References to JavaScript functions are resolved at
the module's load time, just like asm.js.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionLoadWebAssembly):
* tests/stress/wasm-calls.js:
* tests/stress/wasm/calls.wasm:
* wasm/JSWASMModule.cpp:
(JSC::JSWASMModule::visitChildren):
* wasm/JSWASMModule.h:
(JSC::JSWASMModule::importedFunctions):
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::buildCallImport):
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseExpressionF64):
(JSC::WASMFunctionParser::parseCallImport):
* wasm/WASMFunctionParser.h:
* wasm/WASMFunctionSyntaxChecker.h:
(JSC::WASMFunctionSyntaxChecker::buildCallInternal):
(JSC::WASMFunctionSyntaxChecker::buildCallImport):
(JSC::WASMFunctionSyntaxChecker::updateTempStackHeightForCall):
* wasm/WASMModuleParser.cpp:
(JSC::WASMModuleParser::WASMModuleParser):
(JSC::WASMModuleParser::parse):
(JSC::WASMModuleParser::parseModule):
(JSC::WASMModuleParser::parseFunctionImportSection):
(JSC::WASMModuleParser::getImportedValue):
(JSC::parseWebAssembly):
* wasm/WASMModuleParser.h:

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

5 years ago[Win] Tiled drawing is rendering more times than it should
bfulgham@apple.com [Tue, 15 Sep 2015 19:56:34 +0000 (19:56 +0000)]
[Win] Tiled drawing is rendering more times than it should
https://bugs.webkit.org/show_bug.cgi?id=149144
<rdar://problem/22313905>

Reviewed by Simon Fraser.

Provide a more faithful implemenation of the Objective C tiled drawing logic.
(1) Create a new WebTiledBackingLayerWin class that represents a the
    container of tiles. This matches the Objective C design.
(2) Move implementation of several methods (e.g., isOpaque) to the internal
    class implementation so that the Tile Drawing logic can perform special
    handling in these cases.
(3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
    since it was just duplicating code in TileController and TileGrid.
(4) Clean up the display callback code to avoid performing incorrect flipping
    of the coordinate system.

* PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.
* WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* platform/graphics/ca/PlatformCALayer.cpp:
(PlatformCALayer::flipContext): Added convenience method.
(PlatformCALayer::drawRepaintIndicator): Ditto.
* platform/graphics/ca/TileGrid.cpp:
(TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
indicator on Windows.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
object if using tiled drawing.
(PlatformCALayerWin::~PlatformCALayerWin):
(PlatformCALayerWin::isOpaque): Move implementation to internal class.
(PlatformCALayerWin::setOpaque): Ditto.
(PlatformCALayerWin::setBorderWidth): Ditto.
(PlatformCALayerWin::setBorderColor): Ditto.
(PlatformCALayerWin::contentsScale): Ditto.
(PlatformCALayerWin::setContentsScale): Ditto.
(PlatformCALayerWin::cornerRadius): Ditto.
(PlatformCALayerWin::tiledBacking): Ditto.
(PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
text. Needed to work around bug in CG.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
related member variables.
(PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
(shouldInvertBeforeDrawingContent): Added convenience method.
(shouldInvertBeforeDrawingRepaintCounters): Ditto.
(PlatformCALayerWinInternal::displayCallback):
(PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
share code between the two layer classes.
(PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
(PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
(PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
to WebTiledBackingLayerWin and simplify the remaing code.
(PlatformCALayerWinInternal::setSublayers): Remove tile code.
(PlatformCALayerWinInternal::getSublayers): Ditto.
(PlatformCALayerWinInternal::removeAllSublayers): Ditto.
(PlatformCALayerWinInternal::insertSublayer): Ditto.
(PlatformCALayerWinInternal::sublayerCount): Ditto.
(PlatformCALayerWinInternal::indexOfSublayer): Ditto.
(PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
(PlatformCALayerWinInternal::setBounds): Ditto.
(PlatformCALayerWinInternal::setFrame): Ditto.
(PlatformCALayerWinInternal::isOpaque): Ditto.
(PlatformCALayerWinInternal::setOpaque): Ditto.
(PlatformCALayerWinInternal::contentsScale): Ditto.
(PlatformCALayerWinInternal::setContentsScale): Ditto.
(PlatformCALayerWinInternal::setBorderWidth): Ditto.
(PlatformCALayerWinInternal::setBorderColor): Ditto.
(layerTypeIsTiled): Deleted.
(PlatformCALayerWinInternal::constrainedSize): Deleted.
(PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
(PlatformCALayerWinInternal::addTile): Deleted.
(PlatformCALayerWinInternal::removeTile): Deleted.
(PlatformCALayerWinInternal::tileAtIndex): Deleted.
(PlatformCALayerWinInternal::tileCount): Deleted.
(PlatformCALayerWinInternal::updateTiles): Deleted.
(PlatformCALayerWinInternal::drawTile): Deleted.
(PlatformCALayerWinInternal::createTileController): Deleted.
(PlatformCALayerWinInternal::tiledBacking): Deleted.
* platform/graphics/ca/win/PlatformCALayerWinInternal.h:
(WebCore::PlatformCALayerWinInternal::owner):
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
(WebTiledBackingLayerWin::WebTiledBackingLayerWin):
(WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
(DisplayOnMainThreadContext::DisplayOnMainThreadContext):
(redispatchOnMainQueue):
(WebTiledBackingLayerWin::displayCallback):
(WebTiledBackingLayerWin::setNeedsDisplay):
(WebTiledBackingLayerWin::setNeedsDisplayInRect):
(WebTiledBackingLayerWin::setBounds):
(WebTiledBackingLayerWin::isOpaque):
(WebTiledBackingLayerWin::setOpaque):
(WebTiledBackingLayerWin::contentsScale):
(WebTiledBackingLayerWin::setContentsScale):
(WebTiledBackingLayerWin::setBorderWidth):
(WebTiledBackingLayerWin::setBorderColor):
(WebTiledBackingLayerWin::createTileController):
(WebTiledBackingLayerWin::tiledBacking):
(WebTiledBackingLayerWin::invalidate):
* platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.

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

5 years agoFix the !ENABLE(DFG_JIT) build after r188696
ossy@webkit.org [Tue, 15 Sep 2015 19:47:34 +0000 (19:47 +0000)]
Fix the !ENABLE(DFG_JIT) build after r188696
https://bugs.webkit.org/show_bug.cgi?id=149158

Reviewed by Yusuke Suzuki.

* bytecode/GetByIdStatus.cpp:
* bytecode/GetByIdStatus.h:

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

5 years agofunctions that use try/catch will allocate a top level JSLexicalEnvironment even...
commit-queue@webkit.org [Tue, 15 Sep 2015 19:26:45 +0000 (19:26 +0000)]
functions that use try/catch will allocate a top level JSLexicalEnvironment even when it is not necessary
https://bugs.webkit.org/show_bug.cgi?id=148169

Patch by Saam barati <sbarati@apple.com> on 2015-09-15
Reviewed by Geoffrey Garen.

We used to do this before we had proper lexical scoping
in the bytecode generator. There is absolutely no reason
why need to allocate a top-level "var" activation when a
function/program uses a "catch" block.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::createTryStatement):
(JSC::ASTBuilder::incConstants):
(JSC::ASTBuilder::usesThis):
(JSC::ASTBuilder::usesArguments):
(JSC::ASTBuilder::usesWith):
(JSC::ASTBuilder::usesEval):
(JSC::ASTBuilder::usesCatch): Deleted.
* parser/Nodes.h:
(JSC::ScopeNode::isStrictMode):
(JSC::ScopeNode::setUsesArguments):
(JSC::ScopeNode::usesThis):
(JSC::ScopeNode::needsActivation):
(JSC::ScopeNode::hasCapturedVariables):
(JSC::ScopeNode::captures):
(JSC::ScopeNode::needsActivationForMoreThanVariables): Deleted.
* parser/ParserModes.h:
* runtime/Executable.h:
(JSC::ScriptExecutable::usesEval):
(JSC::ScriptExecutable::usesArguments):
(JSC::ScriptExecutable::needsActivation):
(JSC::ScriptExecutable::isStrictMode):
(JSC::ScriptExecutable::ecmaMode):

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

5 years agoREGRESSION(r189774): CLoop doesn't build after r189774
msaboff@apple.com [Tue, 15 Sep 2015 19:00:13 +0000 (19:00 +0000)]
REGRESSION(r189774): CLoop doesn't build after r189774
https://bugs.webkit.org/show_bug.cgi?id=149171

Unreviewed build fix for the C Loop.

Added needed C Loop label opcodes.

* bytecode/BytecodeList.json:

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

5 years ago[New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymo...
hyatt@apple.com [Tue, 15 Sep 2015 18:38:18 +0000 (18:38 +0000)]
[New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
https://bugs.webkit.org/show_bug.cgi?id=149132

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new tests inside fast/block/inside-inlines/

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::anonymousInlineBlock):
Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
and to type check. This is not currently needed, but I'm just being paranoid and future proof.

(WebCore::InlineFlowBox::addToLine):
Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
if we build intermediate line boxes for lines with anonymous inline blocks.

(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
of the line box that wraps the anonymous inline block to the already-computed position for that block.

Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::collapseMargins):
(WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
collapsing with a sibling block "child").

* rendering/RenderBlockFlow.h:
Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
so that MarginInfo is available during line layout.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::createLineBoxes):
When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
and perform it again if pushed below a float.

(WebCore::constructBidiRunsForSegment):
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::matchedEndLine):
(WebCore::RenderBlockFlow::updateRegionForLine):
(WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
anonymous inline blocks that we encounter.

In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
sure margin info is properly set up at the first dirty line position.

Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
when many anonymous inline blocks are scattered throughout a large-scale line box tree.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::ascentAndDescentForBox):
Make sure to rely on the block layout code for the placement of the boxes themselves. Set up the line box code to not have
an effect on ascent/descent.

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::handleReplaced):
When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
lines are placed. Margin info also has to be current.

* rendering/line/LineBreaker.cpp:
* rendering/line/LineBreaker.h:
Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).

* rendering/line/LineLayoutState.h:
Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
layouts and margin collapses on anonymous inline block children.

LayoutTests:

* fast/block/inside-inlines/new-model/margin-collapse: Added.
* fast/block/inside-inlines/new-model/margin-collapse/001-expected.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/001.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/002-expected.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/002.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/003-expected.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/003.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/004-expected.html: Added.
* fast/block/inside-inlines/new-model/margin-collapse/004.html: Added.

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

5 years agoWeb Inspector: Watch Expressions uncaught exceptions on page reload
commit-queue@webkit.org [Tue, 15 Sep 2015 18:36:04 +0000 (18:36 +0000)]
Web Inspector: Watch Expressions uncaught exceptions on page reload
https://bugs.webkit.org/show_bug.cgi?id=149150

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

Instead of waiting 50ms to Resume, when the page navigates
Resume immediately. This ensures nobody is using a stale
activeCallFrame after the navigation.

Also clean up the manager a bit by removing some deletes.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.restoreBreakpointsSoon):
(WebInspector.DebuggerManager.prototype.reset):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype.debuggerDidResume):
(WebInspector.DebuggerManager.prototype._mainResourceDidChange):
(WebInspector.DebuggerManager.prototype._didResumeInternal):
(WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
(WebInspector.DebuggerManager.prototype.debuggerDidResume.delayedWork): Deleted.

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

5 years agoWeb Inspector: Closing the final inspector tab should be allowed
commit-queue@webkit.org [Tue, 15 Sep 2015 18:26:27 +0000 (18:26 +0000)]
Web Inspector: Closing the final inspector tab should be allowed
https://bugs.webkit.org/show_bug.cgi?id=149130

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

Previously we did not allow closing the last inspector tab. Now, we
will allow closing all inspector tabs, and when the last is closed,
present an unclosable New Tab tab, which would then be used to create
a new tab.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
If we have no tabs to restore, show the New Tab tab.

(WebInspector._openDefaultTab):
When the last tab is closed, the tab bar requests we open a default tab.
Open the New Tab tab.

(WebInspector.TabBar.prototype._handleClick):
Disallow closing the single default tab.

(WebInspector._newTabItemClicked):
(WebInspector.showNewTabTab):
Share logic for showing the New Tab tab.

* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView):
Mark the new tab's tab bar item as the "default" tab bar item. It gets
special behavior when it is the single normal tab (cannot be closed).

* UserInterface/Views/TabBar.css:
(body:not(.window-inactive) .tab-bar > .item:hover > .close):
(body:not(.window-inactive) .tab-bar.single-tab > .item.default-tab:hover > .close):
(.tab-bar.single-tab > .item.default-tab > .close):
(body:not(.window-inactive) .tab-bar:not(.single-tab) > .item:not(.hide-close-button):hover > .close): Deleted.
(.tab-bar > .item.hide-close-button > .close): Deleted.
Update styles to only disable the close button on the
"default-tab" when it is the "single-tab" open. Otherwise
always allow closing tabs.

* UserInterface/Views/TabBar.js:
(WebInspector.TabBar.prototype.removeTabBarItem):
(WebInspector.TabBar.prototype.hasNormalTab):
(WebInspector.TabBar.prototype._openDefaultTab):
When removing the last normal tab, send an event to open
the default tab.

* UserInterface/Views/TabBarItem.js:
(WebInspector.TabBarItem.prototype.get default):
(WebInspector.TabBarItem.prototype.get isDefaultTab):
(WebInspector.TabBarItem.prototype.set isDefaultTab):
(WebInspector.TabBarItem.prototype.get hideCloseButton): Deleted.
(WebInspector.TabBarItem.prototype.set hideCloseButton): Deleted.
Switch to marking a tab bar item as the default tab. This tab
will be allowed when it is the single remaining tab. Currently
the default tab is always the "New Tab" tab.

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

5 years agoWeb Inspector: new tab content view should disallow split console
bburg@apple.com [Tue, 15 Sep 2015 18:18:03 +0000 (18:18 +0000)]
Web Inspector: new tab content view should disallow split console
https://bugs.webkit.org/show_bug.cgi?id=149164

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView.prototype.get supportsSplitContentBrowser):

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

5 years agoMake the IDBAny::Type enum into an enum class.
beidson@apple.com [Tue, 15 Sep 2015 18:09:29 +0000 (18:09 +0000)]
Make the IDBAny::Type enum into an enum class.
https://bugs.webkit.org/show_bug.cgi?id=149169.

Reviewed by Oliver Hunt.

No new tests (Cleanup, no behavior change).

* Modules/indexeddb/IDBAny.h:
* Modules/indexeddb/legacy/LegacyAny.cpp:
(WebCore::LegacyAny::createInvalid):
(WebCore::LegacyAny::createNull):
(WebCore::LegacyAny::LegacyAny):
(WebCore::LegacyAny::domStringList):
(WebCore::LegacyAny::idbCursor):
(WebCore::LegacyAny::idbCursorWithValue):
(WebCore::LegacyAny::idbDatabase):
(WebCore::LegacyAny::idbFactory):
(WebCore::LegacyAny::idbIndex):
(WebCore::LegacyAny::idbObjectStore):
(WebCore::LegacyAny::idbTransaction):
(WebCore::LegacyAny::scriptValue):
(WebCore::LegacyAny::string):
(WebCore::LegacyAny::integer):
(WebCore::LegacyAny::legacyCursor):
(WebCore::LegacyAny::legacyCursorWithValue):
(WebCore::LegacyAny::legacyDatabase):
(WebCore::LegacyAny::legacyFactory):
(WebCore::LegacyAny::legacyIndex):
(WebCore::LegacyAny::legacyObjectStore):
(WebCore::LegacyAny::legacyTransaction):
* Modules/indexeddb/legacy/LegacyCursor.cpp:
(WebCore::LegacyCursor::LegacyCursor):
(WebCore::LegacyCursor::effectiveObjectStore):
* Modules/indexeddb/legacy/LegacyObjectStore.cpp:
* Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
(WebCore::LegacyOpenDBRequest::dispatchEvent):
* Modules/indexeddb/legacy/LegacyRequest.cpp:
(WebCore::LegacyRequest::getResultCursor):
(WebCore::effectiveObjectStore):
* bindings/js/JSIDBAnyCustom.cpp:
(WebCore::toJS):
* inspector/InspectorIndexedDBAgent.cpp:
* page/DatabaseProvider.h:

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

5 years ago[GTK] Remove outdated README under po directory
mcatanzaro@igalia.com [Tue, 15 Sep 2015 17:48:58 +0000 (17:48 +0000)]
[GTK] Remove outdated README under po directory
https://bugs.webkit.org/show_bug.cgi?id=149166

Reviewed by Martin Robinson.

* README: Removed.

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

5 years ago[INTL] Implement supportedLocalesOf on Intl Constructors
commit-queue@webkit.org [Tue, 15 Sep 2015 17:43:27 +0000 (17:43 +0000)]
[INTL] Implement supportedLocalesOf on Intl Constructors
https://bugs.webkit.org/show_bug.cgi?id=147599

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2015-09-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Implements all of the abstract operations used by supportedLocalesOf,
except during canonicalization it does not replace redundant tags,
or subtags with their preferred values.

* icu/unicode/ucal.h: Added.
* icu/unicode/udat.h: Added.
* icu/unicode/umisc.h: Added.
* icu/unicode/unum.h: Added.
* icu/unicode/utypes.h: Clear the U_SHOW_CPLUSPLUS_API flag to prevent C++ headers from being included.
* runtime/CommonIdentifiers.h: Adde localeMatcher.
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf): Implemented.
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf): Implemented.
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf): Implemented.
* runtime/IntlObject.cpp:
(JSC::canonicalizeLanguageTag):
(JSC::getCanonicalLangTag):
(JSC::getPrivateUseLangTag):
(JSC::getGrandfatheredLangTag):
(JSC::canonicalizeLocaleList):
(JSC::bestAvailableLocale):
(JSC::lookupSupportedLocales):
(JSC::bestFitSupportedLocales):
(JSC::supportedLocales):
(JSC::getIntlStringOption):
(JSC::getIntlBooleanOption):
* runtime/IntlObject.h:
* runtime/JSCJSValue.h: Added toLength.
* runtime/JSCJSValue.cpp: Added toLength.
(JSC::JSValue::toLength): Implement ToLength from ECMA 262 6.0 7.1.15
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::intlCollatorAvailableLocales): Added lazy locale list.
(JSC::JSGlobalObject::intlDateTimeFormatAvailableLocales): Added lazy locale list.
(JSC::JSGlobalObject::intlNumberFormatAvailableLocales): Added lazy locale list.
* runtime/JSGlobalObject.h:

LayoutTests:

* js/intl-collator-expected.txt: Added tests for supportedLocalesOf
* js/intl-datetimeformat-expected.txt: Added tests for supportedLocalesOf
* js/intl-numberformat-expected.txt: Added tests for supportedLocalesOf
* js/script-tests/intl-collator.js: Added tests for supportedLocalesOf
* js/script-tests/intl-datetimeformat.js: Added tests for supportedLocalesOf
* js/script-tests/intl-numberformat.js: Added tests for supportedLocalesOf

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

5 years agoMove most IDB object encoding/decoding from WebKit2 to WebCore.
beidson@apple.com [Tue, 15 Sep 2015 16:36:19 +0000 (16:36 +0000)]
Move most IDB object encoding/decoding from WebKit2 to WebCore.
https://bugs.webkit.org/show_bug.cgi?id=149152

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Cleanup, no behavior change).

* Modules/indexeddb/IDBDatabaseMetadata.h:
(WebCore::IDBDatabaseMetadata::encode):
(WebCore::IDBDatabaseMetadata::decode):
* Modules/indexeddb/IDBIndexMetadata.h:
(WebCore::IDBIndexMetadata::encode):
(WebCore::IDBIndexMetadata::decode):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPath::encode):
(WebCore::IDBKeyPath::decode):
* Modules/indexeddb/IDBKeyRangeData.h:
(WebCore::IDBKeyRangeData::encode):
(WebCore::IDBKeyRangeData::decode):
* Modules/indexeddb/IDBObjectStoreMetadata.h:
(WebCore::IDBObjectStoreMetadata::encode):
(WebCore::IDBObjectStoreMetadata::decode):

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<IDBDatabaseMetadata>::encode): Deleted.
(IPC::ArgumentCoder<IDBDatabaseMetadata>::decode): Deleted.
(IPC::ArgumentCoder<IDBIndexMetadata>::encode): Deleted.
(IPC::ArgumentCoder<IDBIndexMetadata>::decode): Deleted.
(IPC::ArgumentCoder<IDBKeyData>::encode): Deleted.
(IPC::ArgumentCoder<IDBKeyData>::decode): Deleted.
(IPC::ArgumentCoder<IDBKeyPath>::encode): Deleted.
(IPC::ArgumentCoder<IDBKeyPath>::decode): Deleted.
(IPC::ArgumentCoder<IDBKeyRangeData>::encode): Deleted.
(IPC::ArgumentCoder<IDBKeyRangeData>::decode): Deleted.
(IPC::ArgumentCoder<IDBObjectStoreMetadata>::encode): Deleted.
(IPC::ArgumentCoder<IDBObjectStoreMetadata>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:

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

5 years agoMake the enum IDBKey::Type into a utility enum class.
beidson@apple.com [Tue, 15 Sep 2015 15:51:02 +0000 (15:51 +0000)]
Make the enum IDBKey::Type into a utility enum class.
https://bugs.webkit.org/show_bug.cgi?id=149149

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Cleanup, no behavior change).

* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::isValid):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createNumber):
(WebCore::IDBKey::createDate):
(WebCore::IDBKey::createMultiEntryArray):
(WebCore::IDBKey::createArray):
(WebCore::IDBKey::type):
(WebCore::IDBKey::array):
(WebCore::IDBKey::string):
(WebCore::IDBKey::date):
(WebCore::IDBKey::number):
(WebCore::IDBKey::compareTypes):
(WebCore::IDBKey::IDBKey):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::minimum):
(WebCore::IDBKeyData::maximum):
* Modules/indexeddb/IndexedDB.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyToJSValue):
(WebCore::createIDBKeyFromValue):
(WebCore::createIDBKeyFromScriptValueAndKeyPath):
(WebCore::generateIndexKeysForValue):
* inspector/InspectorIndexedDBAgent.cpp:

Source/WebKit2:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::putRecordInBackingStore):

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

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

5 years agoUnreviewed gardening.
achristensen@apple.com [Tue, 15 Sep 2015 15:33:09 +0000 (15:33 +0000)]
Unreviewed gardening.

* platform/win/TestExpectations:
Fix Windows tests after r189769.

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

5 years ago[cmake] Enable debug fission only if it is supported
ossy@webkit.org [Tue, 15 Sep 2015 15:01:09 +0000 (15:01 +0000)]
[cmake] Enable debug fission only if it is supported
https://bugs.webkit.org/show_bug.cgi?id=149161

Reviewed by Martin Robinson.

* Source/cmake/OptionsCommon.cmake:

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

5 years ago[CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
jfernandez@igalia.com [Tue, 15 Sep 2015 14:48:41 +0000 (14:48 +0000)]
[CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
https://bugs.webkit.org/show_bug.cgi?id=148942

Reviewed by Sergio Villar Senin.

This patch changes the names of several functions and variables
defined to implement the alignment logic. We want to use from now
on the terms row-axis and column-axis when referring to the
alignment direction the logic is applied to.

No new tests, no new functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
* rendering/RenderGrid.h:

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

5 years agoBuild fix after r189774
ssakshuwong@apple.com [Tue, 15 Sep 2015 11:06:10 +0000 (11:06 +0000)]
Build fix after r189774

* jit/JITOperations.cpp

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

5 years agoLayout Test http/tests/media/media-document-referer.html is flaky
ap@apple.com [Tue, 15 Sep 2015 06:46:48 +0000 (06:46 +0000)]
Layout Test http/tests/media/media-document-referer.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=145257

Reviewed by Chris Dumez.

* http/tests/media/media-document-referer.html: Increase the timeout, one second is not much.

* platform/gtk/TestExpectations: Fingers crossed, this will help Gtk as well.

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

5 years agoUnreviewed, EFL gardening on 15th Sep.
gyuyoung.kim@webkit.org [Tue, 15 Sep 2015 06:25:23 +0000 (06:25 +0000)]
Unreviewed, EFL gardening on 15th Sep.

Mark tests of css1/box_properties to flaky and tests of editing, fast are set to timeout.

* platform/efl/TestExpectations:

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

5 years agoRemove all uses of PassRefPtr in WebCore/xml
gyuyoung.kim@webkit.org [Tue, 15 Sep 2015 06:00:54 +0000 (06:00 +0000)]
Remove all uses of PassRefPtr in WebCore/xml
https://bugs.webkit.org/show_bug.cgi?id=149114

Reviewed by Darin Adler.

* dom/DecodedDataDocumentParser.h:
* dom/DocumentParser.h:
* dom/RawDataDocumentParser.h:
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::append):
* html/parser/HTMLDocumentParser.h:
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::append):
* html/parser/TextDocumentParser.h:
* xml/NativeXPathNSResolver.cpp:
(WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
* xml/NativeXPathNSResolver.h:
(WebCore::NativeXPathNSResolver::create):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
* xml/XMLHttpRequestProgressEventThrottle.h:
* xml/XMLSerializer.h:
* xml/XPathEvaluator.cpp:
(WebCore::XPathEvaluator::createExpression):
(WebCore::XPathEvaluator::createNSResolver):
(WebCore::XPathEvaluator::evaluate):
* xml/XPathEvaluator.h:
* xml/XPathNodeSet.h: Fix style errors.
(WebCore::XPath::NodeSet::NodeSet):
(WebCore::XPath::NodeSet::append):
* xml/XPathPath.cpp:
(WebCore::XPath::Filter::evaluate):
(WebCore::XPath::LocationPath::evaluate):
* xml/XPathValue.h: ditto.
(WebCore::XPath::Value::Value):
(WebCore::XPath::Value::Data::create):
(WebCore::XPath::Value::Data::Data):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::transformToDocument):
(WebCore::XSLTProcessor::transformToFragment):
* xml/XSLTProcessor.h:
(WebCore::XSLTProcessor::setXSLStyleSheet):
(WebCore::XSLTProcessor::importStylesheet):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):
* xml/parser/XMLDocumentParser.h:

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

5 years agorename callFrameForThrow to callFrameForCatch
commit-queue@webkit.org [Tue, 15 Sep 2015 04:05:10 +0000 (04:05 +0000)]
rename callFrameForThrow to callFrameForCatch
https://bugs.webkit.org/show_bug.cgi?id=149136

Patch by Saam barati <sbarati@apple.com> on 2015-09-14
Reviewed by Michael Saboff.

We use "callFrameForThrow" to mean the call frame in
which we're catching the exception. The field name
should accurately represent its purpose by being
named "callFrameForCatch".

* jit/CCallHelpers.h:
(JSC::CCallHelpers::jumpToExceptionHandler):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/VM.h:
(JSC::VM::exceptionOffset):
(JSC::VM::callFrameForCatchOffset):
(JSC::VM::targetMachinePCForThrowOffset):
(JSC::VM::callFrameForThrowOffset): Deleted.

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

5 years ago[ES6] Implement tail calls in the LLInt and Baseline JIT
msaboff@apple.com [Tue, 15 Sep 2015 03:00:34 +0000 (03:00 +0000)]
[ES6] Implement tail calls in the LLInt and Baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=148661

Patch by Basile Clement <basile_clement@apple.com> on 2015-09-14
Reviewed by Filip Pizlo.

This patch introduces two new opcodes, op_tail_call and
op_tail_call_varargs, to perform tail calls, and implements them in the
LLInt and baseline JIT. Their use prevents DFG and FTL compilation for
now. They are currently implemented by sliding the call frame and
masquerading as our own caller right before performing an actual call.

This required to change the operationLink family of operation to return
a SlowPathReturnType instead of a char* in order to distinguish between
exception cases and actual call cases. We introduce a new FrameAction
enum that indicates whether to reuse (non-exceptional tail call) or
keep the current call frame (non-tail call, and exceptional cases).

This is also a semantics change, since the Function.caller property is
now leaking tail calls. Since tail calls are only used in strict mode,
which poisons this property, the only way of seeing this semantics
change is when a sloppy function calls a strict function that then
tail-calls a sloppy function. Previously, the second sloppy function's
caller would have been the strict function (i.e. raises a TypeError
when the .caller attribute is accessed), while it is now the first
sloppy function. Tests have been updated to reflect that.

This also changes the assumptions we make about call frames. In order
to be relatively efficient, we want to be able to compute the frame
size based only on the argument count, which was not possible
previously. To enable this, we now enforce at the bytecode generator,
DFG and FTL level that any space reserved for a call frame is
stack-aligned, which allows to easily compute its size when performing
a tail call. In all the "special call cases" (calls from native code,
inlined cache calls, etc.), we are starting the frame at the current
stack pointer and thus will always have a stack-aligned frame size.

Finally, this patch adds a couple of tests to check that tail calls run
in constant stack space, as well as tests checking that tail calls are
recognized correctly. Those tests use the handy aforementioned leaking
of tail calls through Function.caller to detect tail calls.

Given that this patch only implements tail calls for the LLInt and
Baseline JIT, tail calls are disabled by default.  Until changes are
landed for all tiers, tail call testing and use requires the
--enableTailCalls=true or equivalent.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AbortReason.h:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Call::Call):
(JSC::AbstractMacroAssembler::repatchNearCall):
(JSC::AbstractMacroAssembler::repatchCompact):
* assembler/CodeLocation.h:
(JSC::CodeLocationNearCall::CodeLocationNearCall):
(JSC::CodeLocationNearCall::callMode):
(JSC::CodeLocationCommon::callAtOffset):
(JSC::CodeLocationCommon::nearCallAtOffset):
(JSC::CodeLocationCommon::dataLabelPtrAtOffset):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::locationOfNearCall):
(JSC::LinkBuffer::locationOf):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::nearCall):
(JSC::MacroAssemblerARM::nearTailCall):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::linkCall):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::nearCall):
(JSC::MacroAssemblerARM64::nearTailCall):
(JSC::MacroAssemblerARM64::ret):
(JSC::MacroAssemblerARM64::linkCall):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::nearCall):
(JSC::MacroAssemblerARMv7::nearTailCall):
(JSC::MacroAssemblerARMv7::call):
(JSC::MacroAssemblerARMv7::linkCall):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::nearCall):
(JSC::MacroAssemblerMIPS::nearTailCall):
(JSC::MacroAssemblerMIPS::call):
(JSC::MacroAssemblerMIPS::linkCall):
(JSC::MacroAssemblerMIPS::repatchCall):
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::call):
(JSC::MacroAssemblerSH4::nearTailCall):
(JSC::MacroAssemblerSH4::nearCall):
(JSC::MacroAssemblerSH4::linkCall):
(JSC::MacroAssemblerSH4::repatchCall):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::linkCall):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::breakpoint):
(JSC::MacroAssemblerX86Common::nearTailCall):
(JSC::MacroAssemblerX86Common::nearCall):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::linkCall):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::callTypeFor):
(JSC::CallLinkInfo::isVarargsCallType):
(JSC::CallLinkInfo::CallLinkInfo):
(JSC::CallLinkInfo::specializationKind):
(JSC::CallLinkInfo::callModeFor):
(JSC::CallLinkInfo::callMode):
(JSC::CallLinkInfo::isTailCall):
(JSC::CallLinkInfo::isVarargs):
(JSC::CallLinkInfo::registerPreservationMode):
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromLLInt):
* bytecode/CallMode.cpp: Added.
(WTF::printInternal):
* bytecode/CallMode.h: Added.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitCallInTailPosition):
(JSC::BytecodeGenerator::emitCallEval):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
(JSC::BytecodeGenerator::emitConstructVarargs):
* bytecompiler/NodesCodegen.cpp:
(JSC::CallArguments::CallArguments):
(JSC::LabelNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCallWithoutSettingResult):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
* interpreter/Interpreter.h:
(JSC::Interpreter::isCallBytecode):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::jumpToExceptionHandler):
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::emit_op_call):
(JSC::JIT::emit_op_tail_call):
(JSC::JIT::emit_op_call_eval):
(JSC::JIT::emit_op_call_varargs):
(JSC::JIT::emit_op_tail_call_varargs):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::emitSlow_op_call):
(JSC::JIT::emitSlow_op_tail_call):
(JSC::JIT::emitSlow_op_call_eval):
(JSC::JIT::emitSlow_op_call_varargs):
(JSC::JIT::emitSlow_op_tail_call_varargs):
(JSC::JIT::emitSlow_op_construct_varargs):
* jit/JITCall32_64.cpp:
(JSC::JIT::emitSlow_op_call):
(JSC::JIT::emitSlow_op_tail_call):
(JSC::JIT::emitSlow_op_call_eval):
(JSC::JIT::emitSlow_op_call_varargs):
(JSC::JIT::emitSlow_op_tail_call_varargs):
(JSC::JIT::emitSlow_op_construct_varargs):
(JSC::JIT::emit_op_call):
(JSC::JIT::emit_op_tail_call):
(JSC::JIT::emit_op_call_eval):
(JSC::JIT::emit_op_call_varargs):
(JSC::JIT::emit_op_tail_call_varargs):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
(JSC::JIT::updateTopCallFrame):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/Repatch.cpp:
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::linkCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::baselineGetterReturnThunkGenerator):
* jit/ThunkGenerators.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::arityCheckFor):
(JSC::CommonSlowPaths::opIn):
* runtime/Options.h:
* tests/stress/mutual-tail-call-no-stack-overflow.js: Added.
(shouldThrow):
(sloppyCountdown.even):
(sloppyCountdown.odd):
(strictCountdown.even):
(strictCountdown.odd):
(strictCountdown):
(odd):
(even):
* tests/stress/tail-call-no-stack-overflow.js: Added.
(shouldThrow):
(strictLoop):
(strictLoopArityFixup1):
(strictLoopArityFixup2):
* tests/stress/tail-call-recognize.js: Added.
(callerMustBeRun):
(callerMustBeStrict):
(runTests):
* tests/stress/tail-call-varargs-no-stack-overflow.js: Added.
(shouldThrow):
(strictLoop):
* tests/stress/tail-calls-dont-overwrite-live-stack.js: Added.
(tail):
(obj.method):
(obj.get fromNative):
(getThis):

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

5 years agoWKWebView scroll deceleration rate is not being set properly
wenson_hsieh@apple.com [Tue, 15 Sep 2015 02:42:39 +0000 (02:42 +0000)]
WKWebView scroll deceleration rate is not being set properly
https://bugs.webkit.org/show_bug.cgi?id=149145
<rdar://problem/22064071>

Reviewed by Simon Fraser.

We are not currently setting the web view's deceleration rate to the correct preferred value because we
are setting the decelerationRate property of the scrollView, which snaps input values to the closer of
two predefined UIKit constants, UIScrollViewDecelerationRateFast and UIScrollViewDecelerationRateNormal.
To fix this, we directly set the horizontal and vertical scroll deceleration factors to the preferred
value.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginDragging:]): Directly set the scroll view's deceleration factor without
        going through the decelerationRate property.

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

5 years agofast/events/frame-scroll-fake-mouse-move.html is flaky
ap@apple.com [Tue, 15 Sep 2015 02:28:29 +0000 (02:28 +0000)]
fast/events/frame-scroll-fake-mouse-move.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=149140

Reviewed by Darin Adler.

* fast/events/frame-scroll-fake-mouse-move.html:

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

5 years agoPolish code for r189579.
dewei_zhu@apple.com [Tue, 15 Sep 2015 02:13:03 +0000 (02:13 +0000)]
Polish code for r189579.
https://bugs.webkit.org/show_bug.cgi?id=149131

Reviewed by Chris Dumez.

Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
"characterSetForBindings". Optimize the way to get text encoding.

* dom/Document.cpp:
(WebCore::Document::characterSetWithUTF8Fallback):
(WebCore::Document::encoding): Deleted.
(WebCore::Document::characterSetForBindings): Deleted.
* dom/Document.h:
(WebCore::Document::encoding):
(WebCore::Document::textEncoding):
* dom/Document.idl:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDecoderIfNeeded):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):

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

5 years agoDrop non-standard [IsIndex] WebKit IDL extended attribute
cdumez@apple.com [Tue, 15 Sep 2015 01:48:38 +0000 (01:48 +0000)]
Drop non-standard [IsIndex] WebKit IDL extended attribute
https://bugs.webkit.org/show_bug.cgi?id=149122
<rdar://problem/22547139>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C DOM tests now that more checks are passing.

* web-platform-tests/dom/nodes/CharacterData-deleteData-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-replaceData-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt:

Source/WebCore:

Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
causes us to throw an IndexSizeError if the input value is negative. Web
IDL supports no such thing. Instead Web IDL supports:
1. Default behavior: the input value wraps around if it does not fit.
2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
3. [Clamp]: The input value will be clamped if it does not fit [2].

Our bindings generator supports all three. We don't need the non-standard
[IsIndex].

We previously used [IsIndex] in places where we're supposed to wrap around
as per Web IDL. Therefore, we threw for negative values but other browsers
don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
return the substring from offset to the end of the string. It does so in
Firefox and Chrome. However, WebKit was throwing an Exception.

This change impacts the CharacterData and the SVGTextContentElement
API. The compatibility risk is low because we were throwing an exception
for negative values and we now wrap the value around instead, as other
browsers do.

No new tests, already covered by existing tests.

[1] https://heycam.github.io/webidl/#EnforceRange
[2] https://heycam.github.io/webidl/#Clamp

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck): Deleted.
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
* bindings/scripts/test/TestEventTarget.idl:
* dom/CharacterData.cpp:
(WebCore::CharacterData::deleteData):
(WebCore::CharacterData::replaceData):
* dom/CharacterData.idl:
* dom/ClientRectList.idl:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::getSubStringLength):
(WebCore::SVGTextContentElement::selectSubString):
* svg/SVGTextContentElement.idl:

LayoutTests:

* dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt:
* dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt:
* dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt:
* dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt:
* dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt:
* dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt:
Rebaseline outdated DOM tests that are now failing.

* svg/custom/getSubStringLength-expected.txt:
* svg/custom/script-tests/getSubStringLength.js:
* svg/custom/script-tests/selectSubString.js:
* svg/custom/selectSubString-expected.txt:
Update existing SVG tests that were expecting an exception if the nchars
parameter in the SVGTextContentElement API is negative. I have verified
that Chrome and Firefox do not throw for these either.

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

5 years agoAdd tests for control characters being rendered visibly
mmaxfield@apple.com [Tue, 15 Sep 2015 01:36:33 +0000 (01:36 +0000)]
Add tests for control characters being rendered visibly
https://bugs.webkit.org/show_bug.cgi?id=149142

Reviewed by Alexey Proskuryakov.

According to [1] and [2], all browsers are migrating to rendering control characters. This patch
adds tests for this behavior. Because we do not implement the behavior yet [3], these tests are
marked as failing.

[1] http://logs.csswg.org/irc.w3.org/css/2015-02-08/#e520447
[2] https://lists.w3.org/Archives/Public/www-style/2015Sep/0076.html
[3] https://bugs.webkit.org/show_bug.cgi?id=149128

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* fast/text/control-characters/visible-control-characters-1-expected-mismatch.html: Added.
* fast/text/control-characters/visible-control-characters-1.html: Added.
* fast/text/control-characters/visible-control-characters-2-expected-mismatch.html: Added.
* fast/text/control-characters/visible-control-characters-2.html: Added.
* fast/text/control-characters/visible-control-characters-3-expected-mismatch.html: Added.
* fast/text/control-characters/visible-control-characters-3.html: Added.
* fast/text/control-characters/visible-control-characters-2-expected-mismatch.xhtml: Added.
* fast/text/control-characters/visible-control-characters-2.xhtml: Added.
* fast/text/control-characters/visible-control-characters-3-expected-mismatch.xhtml: Added.
* fast/text/control-characters/visible-control-characters-3.xhtml: Added.

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

5 years agoWebKitTestRunner declarative language setting is broken for iOS
mmaxfield@apple.com [Tue, 15 Sep 2015 01:21:54 +0000 (01:21 +0000)]
WebKitTestRunner declarative language setting is broken for iOS
https://bugs.webkit.org/show_bug.cgi?id=149119

Unreviewed.

Tools:

In all of the patches on webkit.org/b/189669, my patch to get this working on iOS was
lost in the final version which got committed. This simply implements the existing
OS X behavior on iOS.

* WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

* platform/ios-simulator/TestExpectations:

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

5 years agoUnreviewed, add myself to committers list.
dewei_zhu@apple.com [Tue, 15 Sep 2015 00:58:45 +0000 (00:58 +0000)]
Unreviewed, add myself to committers list.

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

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

5 years agoLLInt get/put inline caches shouldn't use tons of opcodes
fpizlo@apple.com [Tue, 15 Sep 2015 00:55:17 +0000 (00:55 +0000)]
LLInt get/put inline caches shouldn't use tons of opcodes
https://bugs.webkit.org/show_bug.cgi?id=149106

Reviewed by Geoffrey Garen.

Our LLInt get/put inline caches currently use separate opcodes to reduce branching. For
example, instead of having get_by_id branch on the kind of offset (inline or
out-of-line), we have two get_by_id instructions: get_by_id and get_by_id_out_of_line.
But the problem with this approach is that it doesn't scale. In the property type
inference work (https://bugs.webkit.org/show_bug.cgi?id=148610), we need each kind of put
inline cache to support 11 different kinds of type checks. It seemed ridiculous to add 60
new put_by_id opcodes (there are currently 6 variants of put_by_id, so after adding type
checks, we'd have 6 * 11 = 66 variants of put_by_id).

So, this patch completely changes the strategy to mostly using branching inside the
opcode implementation. It's unlikely to have a performance effect. For example, the long
road to generational GC caused a seemingly prohibitive regression in LLInt inline caches,
and yet nobody noticed. The regression was because the inline cache was in terms of the
structure, not the structure ID, so the code was doing a structure ID table lookup. If we
didn't notice that, then we probably won't notice a couple new branches. (Also, this
patch fixes that regression - the code no longer does such lookups except in the one
unavoidable case in put_by_id transition chain checking.)

This patch also turns the isDirect operand of put_by_id into a flags field. I will use
this flags field to encode the desired type check in bug 148610.

This patch has no effect on performance according to run-jsc-benchmarks.

Relanding this patch with LLInt fixes for non-x86. Previous attempts to fix non-x86 LLInt
build also caused every 64-bit test to crash on every platform. So the patch got rolled
out. This fixes the non-x86 LLInt build while also ensuring that 64-bit platforms don't
crash.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdOp):
(JSC::CodeBlock::printGetByIdCacheStatus):
(JSC::CodeBlock::printPutByIdCacheStatus):
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
* bytecode/CodeBlock.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
* bytecode/Instruction.h:
(JSC::Instruction::Instruction):
* bytecode/PutByIdFlags.cpp: Added.
(WTF::printInternal):
* bytecode/PutByIdFlags.h: Added.
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedInstruction::UnlinkedInstruction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutById):
(JSC::BytecodeGenerator::emitDirectPutById):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_by_id):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

5 years agoDocument.createNodeIterator(null) / Document.createTreeWalker(null) should throw...
cdumez@apple.com [Tue, 15 Sep 2015 00:30:03 +0000 (00:30 +0000)]
Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=149126
<rdar://problem/22564891>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that a new check is passing.

* web-platform-tests/dom/traversal/TreeWalker-basic-expected.txt:

Source/WebCore:

Document.createNodeIterator(null) / Document.createTreeWalker(null)
should throw a TypeError:
https://dom.spec.whatwg.org/#interface-document

This is because the parameter is not nullable and Web IDL says we
should throw a TypeError in this case.

Firefox and Chrome throw an exception in this case. This patch
aligns our behavior with the specification and other major browsers.

No new tests, already covered by existing W3C test.

* dom/Document.cpp:
(WebCore::Document::createNodeIterator):
(WebCore::Document::createTreeWalker):
* dom/Document.h:
* dom/Document.idl:
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::NodeIterator):
* dom/NodeIterator.h:
(WebCore::NodeIterator::create):
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::NodeIteratorBase):
* dom/Traversal.h:
* dom/TreeWalker.cpp:
(WebCore::TreeWalker::TreeWalker):
* dom/TreeWalker.h:
(WebCore::TreeWalker::create):

LayoutTests:

Update existing tests to add test coverage for this case.

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createNodeIterator-parameters.html:
* fast/dom/createTreeWalker-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters.html:

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

5 years agoFix Windows clean build after r189746
achristensen@apple.com [Tue, 15 Sep 2015 00:29:00 +0000 (00:29 +0000)]
Fix Windows clean build after r189746

* WebCore.vcxproj/copyForwardingHeaders.cmd:
Copy headers from new legacy directory.

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

5 years agoWeb Inspector: tab bar stutters when moving mouse after closing tab
bburg@apple.com [Tue, 15 Sep 2015 00:27:56 +0000 (00:27 +0000)]
Web Inspector: tab bar stutters when moving mouse after closing tab
https://bugs.webkit.org/show_bug.cgi?id=149138

Reviewed by Joseph Pecoraro.

The tab bar lacked the 'static-layout' class between when the Promise microtask
ran and the beginning of the requestAnimationFrame. This caused a flash of
tabs that are way too wide.

Re-add the static-layout class immediately after measuring the 'after' tab size.
This code should probably just manually compute tab sizes since flexbox
layout is quite slow and our measurement code here forces layout several times.

* UserInterface/Views/TabBar.js:

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

5 years agowindow.HTMLDetailsElement should exist
cdumez@apple.com [Tue, 15 Sep 2015 00:17:20 +0000 (00:17 +0000)]
window.HTMLDetailsElement should exist
https://bugs.webkit.org/show_bug.cgi?id=149139

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C tests now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-details-element/details-expected.txt:
* web-platform-tests/html/semantics/interfaces-expected.txt:

Source/WebCore:

window.HTMLDetailsElement should exist:
https://html.spec.whatwg.org/multipage/forms.html#the-details-element

Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
address the problem.

No new tests, already covered by existing tests.

* html/HTMLDetailsElement.idl:

LayoutTests:

Rebaseline test now that HTMLDetailsElement is exposed on the global
Window object.

* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

5 years agoWeb Inspector: backend command promises are not rejected when a protocol error occurs
bburg@apple.com [Tue, 15 Sep 2015 00:10:01 +0000 (00:10 +0000)]
Web Inspector: backend command promises are not rejected when a protocol error occurs
https://bugs.webkit.org/show_bug.cgi?id=141403

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Fix a few corner cases for how InspectorBackend delivers command failures.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackend.Command.prototype.deliverFailure): Added.
(InspectorBackend.Command.prototype._invokeWithArguments):

    If argument-checking fails, return a rejected promise or invoke the supplied callback
    on a zero-delay setTimeout to ensure that the reply is asynchronous.

LayoutTests:

Expand coverage of an existing protocol layer test to cover success and failure modes.

* inspector/protocol/inspector-backend-invocation-return-value-expected.txt:
* inspector/protocol/inspector-backend-invocation-return-value.html:

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

5 years agoUnreviewed, rolling out r189751, r189752, and r189754.
commit-queue@webkit.org [Mon, 14 Sep 2015 23:44:33 +0000 (23:44 +0000)]
Unreviewed, rolling out r189751, r189752, and r189754.
https://bugs.webkit.org/show_bug.cgi?id=149143

caused crashes everywhere (Requested by alexchristensen on
#webkit).

Reverted changesets:

"LLInt get/put inline caches shouldn't use tons of opcodes"
https://bugs.webkit.org/show_bug.cgi?id=149106
http://trac.webkit.org/changeset/189751

"Unreviewed, fix non-x86 LLInt build."
http://trac.webkit.org/changeset/189752

"Unreviewed, really fix non-x86 LLInt build without also
breaking everything else."
http://trac.webkit.org/changeset/189754

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

5 years agoWeb Inspector: middle-clicking a tab in the tab bar should close it
bburg@apple.com [Mon, 14 Sep 2015 23:40:07 +0000 (23:40 +0000)]
Web Inspector: middle-clicking a tab in the tab bar should close it
https://bugs.webkit.org/show_bug.cgi?id=149135

Reviewed by Joseph Pecoraro.

This matches the behavior of the tab bar in Safari and other browsers.

* UserInterface/Views/TabBar.js:
(WebInspector.TabBar.prototype._handleMouseDown):
(WebInspector.TabBar.prototype._handleClick):

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

5 years agoTest gardening after r189670
mmaxfield@apple.com [Mon, 14 Sep 2015 23:31:32 +0000 (23:31 +0000)]
Test gardening after r189670

Unreviewed.

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

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

5 years agoAdd scroll snap blog post resources.
wenson_hsieh@apple.com [Mon, 14 Sep 2015 23:27:37 +0000 (23:27 +0000)]
Add scroll snap blog post resources.

* blog-files/scroll-snap/overflow-normal.mp4: Added.
* blog-files/scroll-snap/snap-2d-rotated.mp4: Added.
* blog-files/scroll-snap/snap-2d.mp4: Added.
* blog-files/scroll-snap/snap-coordinates-centered.mp4: Added.
* blog-files/scroll-snap/snap-coordinates.mp4: Added.
* blog-files/scroll-snap/snap-repeat-100.mp4: Added.

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

5 years agoFix AppleWin CMake build
commit-queue@webkit.org [Mon, 14 Sep 2015 23:23:29 +0000 (23:23 +0000)]
Fix AppleWin CMake build
https://bugs.webkit.org/show_bug.cgi?id=149137

Patch by Alex Christensen <achristensen@webkit.org> on 2015-09-14
Reviewed by Brent Fulgham.

* PlatformAppleWin.cmake:
Spell Inband correctly.
* css/makegrammar.pl:
Add quotes so bison can be in a directory with spaces in it.

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

5 years agoAdd scroll snap demo directory and files.
wenson_hsieh@apple.com [Mon, 14 Sep 2015 23:21:20 +0000 (23:21 +0000)]
Add scroll snap demo directory and files.

* demos/scroll-snap/images/1.png: Added.
* demos/scroll-snap/images/10.png: Added.
* demos/scroll-snap/images/11.png: Added.
* demos/scroll-snap/images/12.png: Added.
* demos/scroll-snap/images/13.png: Added.
* demos/scroll-snap/images/14.png: Added.
* demos/scroll-snap/images/15.png: Added.
* demos/scroll-snap/images/16.png: Added.
* demos/scroll-snap/images/2.png: Added.
* demos/scroll-snap/images/3.png: Added.
* demos/scroll-snap/images/4.png: Added.
* demos/scroll-snap/images/5.png: Added.
* demos/scroll-snap/images/6.png: Added.
* demos/scroll-snap/images/7.png: Added.
* demos/scroll-snap/images/8.png: Added.
* demos/scroll-snap/images/9.png: Added.
* demos/scroll-snap/images/bluecross.svg: Added.
* demos/scroll-snap/images/corner.svg: Added.
* demos/scroll-snap/index.html: Added.

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

5 years agoUnreviewed, really fix non-x86 LLInt build without also breaking everything else.
fpizlo@apple.com [Mon, 14 Sep 2015 22:40:29 +0000 (22:40 +0000)]
Unreviewed, really fix non-x86 LLInt build without also breaking everything else.

* llint/LowLevelInterpreter64.asm:

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

5 years agoConsolidate touch event code dealing with force.
mitz@apple.com [Mon, 14 Sep 2015 22:25:36 +0000 (22:25 +0000)]
Consolidate touch event code dealing with force.

Reviewed by Beth Dakin.

* Shared/WebEvent.h:
(WebKit::WebPlatformTouchPoint::state):
(WebKit::WebPlatformTouchPoint::setForce):
(WebKit::WebPlatformTouchPoint::force):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::positionForCGPoint):
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* Shared/ios/WebPlatformTouchPointIOS.cpp:
(WebKit::WebPlatformTouchPoint::encode):
(WebKit::WebPlatformTouchPoint::decode):

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

5 years agoUnreviewed, fix non-x86 LLInt build.
fpizlo@apple.com [Mon, 14 Sep 2015 22:25:30 +0000 (22:25 +0000)]
Unreviewed, fix non-x86 LLInt build.

* llint/LowLevelInterpreter64.asm:

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

5 years agoLLInt get/put inline caches shouldn't use tons of opcodes
fpizlo@apple.com [Mon, 14 Sep 2015 22:10:52 +0000 (22:10 +0000)]
LLInt get/put inline caches shouldn't use tons of opcodes
https://bugs.webkit.org/show_bug.cgi?id=149106

Reviewed by Geoffrey Garen.

Our LLInt get/put inline caches currently use separate opcodes to reduce branching. For
example, instead of having get_by_id branch on the kind of offset (inline or
out-of-line), we have two get_by_id instructions: get_by_id and get_by_id_out_of_line.
But the problem with this approach is that it doesn't scale. In the property type
inference work (https://bugs.webkit.org/show_bug.cgi?id=148610), we need each kind of put
inline cache to support 11 different kinds of type checks. It seemed ridiculous to add 60
new put_by_id opcodes (there are currently 6 variants of put_by_id, so after adding type
checks, we'd have 6 * 11 = 66 variants of put_by_id).

So, this patch completely changes the strategy to mostly using branching inside the
opcode implementation. It's unlikely to have a performance effect. For example, the long
road to generational GC caused a seemingly prohibitive regression in LLInt inline caches,
and yet nobody noticed. The regression was because the inline cache was in terms of the
structure, not the structure ID, so the code was doing a structure ID table lookup. If we
didn't notice that, then we probably won't notice a couple new branches. (Also, this
patch fixes that regression - the code no longer does such lookups except in the one
unavoidable case in put_by_id transition chain checking.)

This patch also turns the isDirect operand of put_by_id into a flags field. I will use
this flags field to encode the desired type check in bug 148610.

This patch has no effect on performance according to run-jsc-benchmarks.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdOp):
(JSC::CodeBlock::printGetByIdCacheStatus):
(JSC::CodeBlock::printPutByIdCacheStatus):
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
* bytecode/CodeBlock.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
* bytecode/Instruction.h:
(JSC::Instruction::Instruction):
* bytecode/PutByIdFlags.cpp: Added.
(WTF::printInternal):
* bytecode/PutByIdFlags.h: Added.
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedInstruction::UnlinkedInstruction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutById):
(JSC::BytecodeGenerator::emitDirectPutById):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_by_id):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

5 years ago[Win] Unreviewed build fix after r189746
achristensen@apple.com [Mon, 14 Sep 2015 21:27:58 +0000 (21:27 +0000)]
[Win] Unreviewed build fix after r189746

* WebCore.vcxproj/WebCoreIncludeCommon.props:
Include new legacy directory.

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

5 years agoProgress towards CMake on Mac.
achristensen@apple.com [Mon, 14 Sep 2015 21:22:46 +0000 (21:22 +0000)]
Progress towards CMake on Mac.
https://bugs.webkit.org/show_bug.cgi?id=149123

Reviewed by Chris Dumez.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:
Defined and enabled some more features needed on Mac.
* Source/cmake/WebKitMacros.cmake:
Objective C bindings need special changes when generating:
Some of the bindings do not generate a .mm file but the header is needed.
Some of the bindings do generate a .mm file that doesn't compile but the header is needed.
In order to handle these cases, it is necessary to change the GENERATE_BINDINGS macro just for ObjC.

Source/JavaScriptCore:

* CMakeLists.txt:
Make forwarding headers for the replay subdirectory.
* PlatformMac.cmake:
Make forwarding headers for the generated inspector headers.
They should eventually either be packaged correctly with JavaScriptCore headers and included correctly.

Source/WebCore:

* CMakeLists.txt:
Added some more files.
* PlatformMac.cmake:
Added more files and listed the strange ObjC bindings.
* contentextensions/DFACombiner.cpp:
* contentextensions/DFACombiner.h:
Added preprocessor protection.
* platform/FileSystem.h:
Include utility.  It's needed to compile the different configurations.
* platform/ScrollAnimator.cpp:
ScrollAnimator is an abstract class on Mac.  Don't compile it.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
FontAntialiasingStateSaver.h is only used on iOS.
* rendering/RenderThemeMac.mm:
config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.

Source/WebKit:

* CMakeLists.txt:
* PlatformMac.cmake:
Added more sources, make non-c99 sources compile as objc++
* PlatformWin.cmake:
Moved WebCoreTestSupport sources and includes to CMakeLists.txt to share.

Source/WebKit/mac:

* WebView/WebPDFDocumentExtras.mm:
(appendValuesInPDFNameSubtreeToVector):
* WebView/WebPDFView.mm:
Removed cmake include quirks that are not needed when we include things correctly from Quartz.framework/Frameworks.

Source/WebKit2:

* PlatformMac.cmake:
Added some more sources.

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

5 years ago[iOS] Stop importing WebKitAdditions/WKContentViewInteraction.mm
mitz@apple.com [Mon, 14 Sep 2015 21:16:31 +0000 (21:16 +0000)]
[iOS] Stop importing WebKitAdditions/WKContentViewInteraction.mm
https://bugs.webkit.org/show_bug.cgi?id=149127

Reviewed by Beth Dakin.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):

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

5 years ago[ES6] Cache the resolution result in JSModuleRecord
utatane.tea@gmail.com [Mon, 14 Sep 2015 21:15:19 +0000 (21:15 +0000)]
[ES6] Cache the resolution result in JSModuleRecord
https://bugs.webkit.org/show_bug.cgi?id=148896

Reviewed by Saam Barati.

The resolveExport operation is frequently called. For example,
1. When instantiating the module environment, we call it for each exported name and imported
   name.
2. When linking the imported module environment to the code block, we call it to resolve the
   resolution.
3. When looking up the property from the namespace object, we call it to look up the original
   module for the imported binding.
4. When creating the namespace object, we need to collect all the exported names from the module
   and need to resolve them by calling resolveExport.

However, resolveExport takes some cost. It traces the imported modules and resolves the reference
queried by the original module.

The resolveExport operation is pure function; given a module record and an export name,
it always returns the same result. So we cache resolution results in the module record to avoid
repeated resolveExport calls with the same arguments.
Here, we only cache the correctly resolved references, since,
1. We rarely looked up the non-correctly-resolved ones. In the linking phase, attempting to
   resolve non-correctly-resolved ones throws a syntax error. So only namespace object creation
   phase does it in a syntax valid script.
2. This strategy limits the size of the cache map. The number of the correctly exported bindings
   is defined by the modules' code. So the size does not become infinitely large.

Currently, the all modules cannot be linked twice. For example,

  graph 1

  -> (A) -> (B)

  graph 2

  -> (C) -> (A) -> (B)

We cannot test the behavior now because when executing the graph 2, (A) and (B) are already linked,
it raises an error in the current loader spec. But it should be allowed[1] since it will occur when
there is multiple module tag in WebCore.

[1]: https://github.com/whatwg/loader/issues/41

* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::ResolveQuery::Hash::hash):
(JSC::JSModuleRecord::ResolveQuery::Hash::equal):
(JSC::JSModuleRecord::cacheResolution):
(JSC::ResolveQueryHash::hash): Deleted.
(JSC::ResolveQueryHash::equal): Deleted.
(JSC::resolveExportLoop): Deleted.
* runtime/JSModuleRecord.h:
* tests/modules/caching-should-not-make-ambiguous.js: Added.
* tests/modules/caching-should-not-make-ambiguous/A.js: Added.
* tests/modules/caching-should-not-make-ambiguous/B.js: Added.
* tests/modules/caching-should-not-make-ambiguous/C.js: Added.
* tests/modules/caching-should-not-make-ambiguous/D.js: Added.
* tests/modules/caching-should-not-make-ambiguous/main.js: Added.
* tests/modules/different-view.js: Added.
(from.string_appeared_here.shouldThrow):
* tests/modules/different-view/A.js: Added.
* tests/modules/different-view/B.js: Added.
* tests/modules/different-view/C.js: Added.
* tests/modules/different-view/D.js: Added.
* tests/modules/different-view/E.js: Added.
* tests/modules/different-view/main.js: Added.
* tests/modules/fallback-ambiguous.js: Added.
(from.string_appeared_here.shouldThrow):
* tests/modules/fallback-ambiguous/A.js: Added.
* tests/modules/fallback-ambiguous/B.js: Added.
* tests/modules/fallback-ambiguous/C.js: Added.
* tests/modules/fallback-ambiguous/D.js: Added.
* tests/modules/fallback-ambiguous/E.js: Added.
* tests/modules/fallback-ambiguous/main.js: Added.
* tests/modules/self-star-link.js: Added.
* tests/modules/self-star-link/A.js: Added.
* tests/modules/self-star-link/B.js: Added.
* tests/modules/self-star-link/C.js: Added.
* tests/modules/self-star-link/D.js: Added.
* tests/modules/self-star-link/E.js: Added.
* tests/modules/uncacheable-when-see-star.js: Added.
* tests/modules/uncacheable-when-see-star/A-pre.js: Added.
* tests/modules/uncacheable-when-see-star/A.js: Added.
* tests/modules/uncacheable-when-see-star/B.js: Added.
* tests/modules/uncacheable-when-see-star/C.js: Added.
* tests/modules/uncacheable-when-see-star/D.js: Added.
* tests/modules/uncacheable-when-see-star/E-pre.js: Added.
* tests/modules/uncacheable-when-see-star/E.js: Added.
* tests/modules/uncacheable-when-see-star/main1.js: Added.
* tests/modules/uncacheable-when-see-star/main2.js: Added.

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

5 years agoRename current concrete IDB implementation to "Legacy".
beidson@apple.com [Mon, 14 Sep 2015 21:01:41 +0000 (21:01 +0000)]
Rename current concrete IDB implementation to "Legacy".
https://bugs.webkit.org/show_bug.cgi?id=149118

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

This patch makes IDL bindings abstract.
It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
Finally it moves those files and their support classes to a "legacy" subfolder.

* CMakeLists.txt:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
* Modules/indexeddb/IDBAny.cpp:
* Modules/indexeddb/IDBAny.h:
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBCursorWithValue.h:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.cpp:
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.cpp:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.cpp:
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.cpp:
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
* Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
* Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
* Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
* Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
* Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
* Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
* Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
* Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
* Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
* Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
* Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
* Modules/indexeddb/legacy/LegacyAny.h: Added.
* Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
* Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
* Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
* Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
* Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
* Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
* Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
* Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
* Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
* Modules/indexeddb/legacy/LegacyIndex.h: Added.
* Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
* Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
* Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
* Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
* Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
* Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
* WebCore.xcodeproj/project.pbxproj:
* WebCore.vcxproj/WebCore.vcxproj:

Source/WebKit2:

* CMakeLists.txt:

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

5 years agoDisable PICTURE_SIZES on AppleWin
cdumez@apple.com [Mon, 14 Sep 2015 20:36:04 +0000 (20:36 +0000)]
Disable PICTURE_SIZES on AppleWin
https://bugs.webkit.org/show_bug.cgi?id=149125

Reviewed by Alexey Proskuryakov.

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props:

LayoutTests:

* platform/win/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt: Removed.

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

5 years agoImplement the arithmetic instructions for floats in WebAssembly
commit-queue@webkit.org [Mon, 14 Sep 2015 18:30:08 +0000 (18:30 +0000)]
Implement the arithmetic instructions for floats in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149102

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-14
Reviewed by Geoffrey Garen.

This patch implements the arithmetic instructions for floats (float32)
in WebAssembly by converting the float operands to doubles, performing
the equivalent double instructions, and converting the result back to
float. The asm.js spec says that "As proved in 'When is double rounding
innocuous?' (Figueroa 1995), both the 32- and 64-bit versions of
standard arithmetic operations produce equivalent results when given
32-bit inputs and coerced to 32-bit outputs."
(http://asmjs.org/spec/latest/#floatish)

This patch also pads WebAssembly call frames by maxFrameExtentForSlowPathCall,
so that there is no need to adjust the stack pointer every time we make
a slow path call.

* tests/stress/wasm-arithmetic-float32.js:
* tests/stress/wasm/arithmetic-float32.wasm:
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):
(JSC::WASMFunctionCompiler::buildUnaryF32):
(JSC::WASMFunctionCompiler::buildBinaryF32):
(JSC::WASMFunctionCompiler::callOperation):
(JSC::WASMFunctionCompiler::callAndUnboxResult):
(JSC::WASMFunctionCompiler::endFunction): Deleted.
(JSC::WASMFunctionCompiler::buildBinaryI32): Deleted.
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionF32):
(JSC::WASMFunctionParser::parseUnaryExpressionF32):
(JSC::WASMFunctionParser::parseBinaryExpressionF32):
* wasm/WASMFunctionParser.h:
* wasm/WASMFunctionSyntaxChecker.h:
(JSC::WASMFunctionSyntaxChecker::buildUnaryF32):
(JSC::WASMFunctionSyntaxChecker::buildBinaryF32):

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

5 years agoUnreviewed, skip fast/text/international/system-language for now.
said@apple.com [Mon, 14 Sep 2015 17:57:27 +0000 (17:57 +0000)]
Unreviewed, skip fast/text/international/system-language for now.
WebKitTestRunner declarative language setting is broken for iOS.

* platform/ios-simulator/TestExpectations:

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

5 years agoUnreviewed, expect css3/flexbox/image-percent-max-height.html to fail on iOS.
said@apple.com [Mon, 14 Sep 2015 17:38:48 +0000 (17:38 +0000)]
Unreviewed, expect css3/flexbox/image-percent-max-height.html to fail on iOS.
The test is already expected to fail on mac, windows and gtk.

* platform/ios-simulator/TestExpectations:

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

5 years agoUnreviewed, rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html on...
cdumez@apple.com [Mon, 14 Sep 2015 16:30:18 +0000 (16:30 +0000)]
Unreviewed, rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html on iOS.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:

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

5 years agoWeb Inspector: Border under the styles filter field is clipped
nvasilyev@apple.com [Mon, 14 Sep 2015 16:24:34 +0000 (16:24 +0000)]
Web Inspector: Border under the styles filter field is clipped
https://bugs.webkit.org/show_bug.cgi?id=149115

Reviewed by Darin Adler.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content + .options-container > .filter-bar):

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

5 years agoSkip fast/text/international/system-language where unsupported.
ap@apple.com [Mon, 14 Sep 2015 16:14:21 +0000 (16:14 +0000)]
Skip fast/text/international/system-language where unsupported.

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

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

5 years agoEden GC should not try to jettison old CodeBlocks in the remembered set
ggaren@apple.com [Mon, 14 Sep 2015 16:09:20 +0000 (16:09 +0000)]
Eden GC should not try to jettison old CodeBlocks in the remembered set
https://bugs.webkit.org/show_bug.cgi?id=149108

Reviewed by Saam Barati.

All we know about objects in the remembered set is that they must be
visited. We don't know whether they're referenced or not because we
won't mark the objects that point to them.

Therefore, it's incorrect for a CodeBlock to consider jettisoning
itself when it's marked as a part of the remembered set: Some
old object might have visited the CodeBlock strongly if given the chance.

I believe this doesn't cause any problems currently because we happen
to visit all strong references to all CodeBlocks elligible for jettison
during every GC.

However, this behavior is a logical oddity that tripped me up, and I
believe it will start causing real problems once we start to jettison
baseline CodeBlocks, since we do not visit all strong references to all
baseline CodeBlocks during every GC.

* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::clearMarksForEdenCollection):
(JSC::CodeBlockSet::traceMarked): Be sure to visit the remembered set
strongly, in order to prohibit jettisoning.

(JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks):
* heap/CodeBlockSet.h: Track the remembered set during eden GCs.

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

5 years ago[EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
gyuyoung.kim@webkit.org [Mon, 14 Sep 2015 13:55:10 +0000 (13:55 +0000)]
[EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
https://bugs.webkit.org/show_bug.cgi?id=149110

Reviewed by Csaba Osztrogonác.

It is not good implementation we support both create() factory function and public constructor.
In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
std::make_unique<> directly.

Source/WebCore:

* platform/graphics/efl/EvasGLContext.h:
(WebCore::EvasGLContext::create): Deleted.
* platform/graphics/efl/EvasGLSurface.h:
(WebCore::EvasGLSurface::create): Deleted.

Source/WebKit2:

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
(EwkView::createGLSurface):

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

5 years agomin-width/height should default to auto for grid items
svillar@igalia.com [Mon, 14 Sep 2015 10:40:55 +0000 (10:40 +0000)]
min-width/height should default to auto for grid items
https://bugs.webkit.org/show_bug.cgi?id=146021

Reviewed by Darin Adler.

Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.

Source/WebCore:

From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
"The auto value of min-width and min-height behaves on grid
items in the relevant axis analogously to its behavior on flex
items in the main axis."

From now on the default value for min-width and min-height for
grid items is auto, meaning that in general, grid items won't
shrink bellow their content.

The change is not exactly the same as the one in Blink because
this one takes into account vertical writting modes, something
that was not well handled in the original one.

Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
       fast/css-grid-layout/min-width-height-auto.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computeLogicalHeight):

LayoutTests:

Apart from the original tests this includes some extra ones to
verify that we behave correctly with vertical writing modes.

* fast/css-grid-layout/min-width-height-auto-expected.txt: Added.
* fast/css-grid-layout/min-width-height-auto-overflow-expected.html: Added.
* fast/css-grid-layout/min-width-height-auto-overflow.html: Added.
* fast/css-grid-layout/min-width-height-auto.html: Added.
* fast/css/auto-min-size-expected.txt:
* fast/css/auto-min-size.html:

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

5 years ago[css-grid] Percentage columns should remove scrollbar's width
rego@igalia.com [Mon, 14 Sep 2015 09:46:37 +0000 (09:46 +0000)]
[css-grid] Percentage columns should remove scrollbar's width
https://bugs.webkit.org/show_bug.cgi?id=149116

Reviewed by Sergio Villar Senin.

Source/WebCore:

Currently the calculation of percentage columns was not subtracting the
scrollbar's size.
Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
to avoid this problem.

Test: fast/css-grid-layout/grid-percent-track-scrollbar.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):

LayoutTests:

Added test to check the behavior for both columns and rows.
Note that rows (height) were already working fine.

* fast/css-grid-layout/grid-percent-track-scrollbar-expected.txt: Added.
* fast/css-grid-layout/grid-percent-track-scrollbar.html: Added.

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

5 years ago[Streams API] pipe-to writable stream tests
calvaris@igalia.com [Mon, 14 Sep 2015 08:47:39 +0000 (08:47 +0000)]
[Streams API] pipe-to writable stream tests
https://bugs.webkit.org/show_bug.cgi?id=148296

Reviewed by Darin Adler.

* streams/reference-implementation/pipe-to-expected.txt: Added.
* streams/reference-implementation/pipe-to.html: Added.

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

5 years ago[Streams API] Add readable stream templated tests for writable streams
calvaris@igalia.com [Mon, 14 Sep 2015 08:35:52 +0000 (08:35 +0000)]
[Streams API] Add readable stream templated tests for writable streams
https://bugs.webkit.org/show_bug.cgi?id=148304

Reviewed by Darin Adler.

* streams/reference-implementation/readable-stream-templated-expected.txt: Added new expectations.
* streams/reference-implementation/readable-stream-templated.html: New writable stream tests.

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

5 years ago[Streams API] Add pipe-to-options writable stream tests
calvaris@igalia.com [Mon, 14 Sep 2015 07:59:48 +0000 (07:59 +0000)]
[Streams API] Add pipe-to-options writable stream tests
https://bugs.webkit.org/show_bug.cgi?id=148297

Reviewed by Darin Adler.

* streams/reference-implementation/pipe-to-options-expected.txt: Added.
* streams/reference-implementation/pipe-to-options.html: Added.

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

5 years ago[Streams API] Add tests about abort on writable streams
calvaris@igalia.com [Mon, 14 Sep 2015 07:56:27 +0000 (07:56 +0000)]
[Streams API] Add tests about abort on writable streams
https://bugs.webkit.org/show_bug.cgi?id=148298

Reviewed by Darin Adler.

* streams/reference-implementation/writable-stream-abort-expected.txt: Added.
* streams/reference-implementation/writable-stream-abort.html: Added.

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

5 years ago[Streams API] Add general writable streams tests
calvaris@igalia.com [Mon, 14 Sep 2015 07:53:04 +0000 (07:53 +0000)]
[Streams API] Add general writable streams tests
https://bugs.webkit.org/show_bug.cgi?id=148299

Reviewed by Darin Adler.

* streams/reference-implementation/writable-stream-expected.txt: Added.
* streams/reference-implementation/writable-stream.html: Added.

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

5 years ago[GTK] Layout Test media/video-volume-slider.html is flaky
changseok.oh@collabora.com [Mon, 14 Sep 2015 07:47:41 +0000 (07:47 +0000)]
[GTK] Layout Test media/video-volume-slider.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=149032

Reviewed by Philippe Normand.

* platform/gtk/TestExpectations: media/video-volume-slider.html is removed.

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

5 years agoImprove Node pre-insertion validation when the parent is a Document
cdumez@apple.com [Mon, 14 Sep 2015 05:08:39 +0000 (05:08 +0000)]
Improve Node pre-insertion validation when the parent is a Document
https://bugs.webkit.org/show_bug.cgi?id=149109
<rdar://problem/22560436>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/nodes/Node-insertBefore-expected.txt:
* web-platform-tests/dom/nodes/Node-replaceChild-expected.txt:
* web-platform-tests/dom/nodes/append-on-Document-expected.txt:
* web-platform-tests/dom/nodes/prepend-on-Document-expected.txt:

Source/WebCore:

Improve Node pre-insertion validation when the parent is a Document to
match the specification:
https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
https://dom.spec.whatwg.org/#concept-node-replace

This affects the following API: Node.insertBefore(), Node.appendChild(),
Node.replaceChild().

WebKit current fails to do the following checks whenever the parent is a
Document from pre-insertion validation:
1. If the inserted Node is a DocumentFragment, we should make sure it
  contains only one Element.
-> This is because a Document can have only one child that is an
   Element [1].
2.a. If an Element is inserted, we should make sure it is not inserted
     before a DocumentType.
2.b. If a DocumentType is inserted, we should make sure it is not
     inserted after an Element.
-> This is because the DocType must come before the optional Element
   child [1].

Firefox and Chrome already match the specification here. This patch
aligns WebKit's behavior with those browsers and the specification.

[1] https://dom.spec.whatwg.org/#node-trees

No new tests, already covered by existing W3C tests.

* dom/ContainerNode.cpp:
(WebCore::checkAcceptChild):
(WebCore::checkAddChild):
(WebCore::checkReplaceChild):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::appendChild):
(WebCore::containsConsideringHostElements): Deleted.
(WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
* dom/Document.cpp:
(WebCore::Document::canAcceptChild):
(WebCore::Document::cloneNodeInternal): Deleted.
* dom/Document.h:

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

5 years agoDocument.adoptNode() should be able to explicitly adopt a DocumentType node
cdumez@apple.com [Mon, 14 Sep 2015 05:06:40 +0000 (05:06 +0000)]
Document.adoptNode() should be able to explicitly adopt a DocumentType node
https://bugs.webkit.org/show_bug.cgi?id=149097
LayoutTests/imported/w3c:

<rdar://problem/22549345>

Reviewed by Ryosuke Niwa.

Rebaseline W3C test now that a new check is passing.

* web-platform-tests/dom/nodes/Document-adoptNode-expected.txt:

Source/WebCore:

<rdar://problem/22549345>

Reviewed by Ryosuke Niwa.

Document.adoptNode() should be able to explicitly adopt a DocumentType
node as per the latest DOM specification:
https://dom.spec.whatwg.org/#dom-document-adoptnode

Chrome and Firefox match the specidicaiton but WebKit was throwing a
NotSupportedError.

No new tests, already covered by existing test.

* dom/Document.cpp:
(WebCore::Document::adoptNode): Deleted.

LayoutTests:

Reviewed by Ryosuke Niwa.

Rebaseline DOM3 tests, those seem to be outdated now.

* dom/xhtml/level3/core/documentadoptnode10-expected.txt:
* dom/xhtml/level3/core/documentadoptnode11-expected.txt:
* dom/xhtml/level3/core/documentadoptnode12-expected.txt:

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

5 years agoDocument.title does not behave according to specification
cdumez@apple.com [Mon, 14 Sep 2015 05:03:29 +0000 (05:03 +0000)]
Document.title does not behave according to specification
https://bugs.webkit.org/show_bug.cgi?id=149098

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-01-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-02-expected.txt:

Source/WebCore:

Update Document.title to behave according to the latest DOM specification:
https://html.spec.whatwg.org/multipage/dom.html#document.title

In particular, the following Web-Exposed changes were made:
1. The title Element should be the first title element in the document
   (in tree order) [1]. Previously, WebKit would use the first title
   Element *added* to the Document. Document.title returns the text
   content of the title Element so this change is web-exposed.
2. If the title Element is replaced after the title has been set by the
   JS (via the document.title setter), we should update the value
   returned by the document.title getter. Previously, WebKit would set
   a flag if the title was explicitly set by JS via document.title
   setter and later title element changes would not override the title
   set by the JS. This behavior isn't specified and does not match the
   behavior of other browsers.

The new behavior is also consistent with the behavior of Firefox and
Chrome.

Some refactoring was made for the sake of clarity now that our
implementation has changed. See details below.

[1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2

No new tests, already covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::updateTitleFromTitleElement):
New convenience method that calls updateTitle() with the text of the
document's current title Element. If there is no title Element, it
clears the title.

(WebCore::Document::updateTitleElement):
Method which updates the Document's title Element whenever a title
Element is added or removed from the Document. Once the title Element
is updated, it takes care of calling updateTitleFromTitleElement() to
update the Document's title.

(WebCore::Document::titleElementAdded):
(WebCore::Document::titleElementRemoved):
(WebCore::Document::titleElementTextChanged):
New Document public API called by HTMLTitleElement / SVGTitleElement
whenever a title Element is added / removed from the Document or
whenever the title element's text has changed. These methods will
take care of calling updateTitleElement() / updateTitleFromTitleElement()
as necessary.
Previously, we would only have 2 methods:
- setTitleElement() which would be called whenever a title Element was
  added to the document or when its text had changed. The name was
  confusing because it would not necessarily set the document's title
  Element and it would be used both for title element update and a
  simple title update. This method has been split into 2:
  titleElementAdded() and titleElementTextChanged().
- removeTitle() which would be called whenever a title Element was
  removed. The naming was confusing because it would not necessarily
  remove the Document's title Element. This is now called
  titleElementRemoved().

* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::insertedInto):
Call the new titleElementAdded() instead of setTitleElement().

(WebCore::HTMLTitleElement::removedFrom):
Call the new titleElementRemoved() instead of removeTitle().

(WebCore::HTMLTitleElement::childrenChanged):
Call the new titleElementTextChanged() instead of
setTitleElement() / removeTitle() as we don't really want
to remove or add a title Element. We merely want to notify
the document that the title element text has changed in
case it is the current title Element of the Document.

(WebCore::HTMLTitleElement::computedTextWithDirection):
Rename textWithDirection() to computedTextWithDirection() to
make it clear it is not a simple getter and make it private
as it is only used to set the m_title member which caches the
computed text.

* html/HTMLTitleElement.h:
Add new textWithDirection() getter which returns m_title. This
is needed so that Document can query the title of the Element.
Previously, HTMLTitleElement would pass directly m_title to
the Document when calling Document::setTitleElement().

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
Call the new titleElementAdded() instead of setTitleElement().

(WebCore::SVGTitleElement::removedFrom):
Call the new titleElementRemoved() instead of removeTitle().

(WebCore::SVGTitleElement::childrenChanged):
Call the new titleElementTextChanged() instead of
setTitleElement().

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

5 years agodocument.lastModified should use the user's local time zone
cdumez@apple.com [Mon, 14 Sep 2015 04:18:18 +0000 (04:18 +0000)]
document.lastModified should use the user's local time zone
https://bugs.webkit.org/show_bug.cgi?id=149092
LayoutTests/imported/w3c:

<rdar://problem/22567705>

Reviewed by Ryosuke Niwa.

Rebaseline a couple of W3C tests now that more checks are passing.

* web-platform-tests/html/dom/documents/resource-metadata-management/document-lastModified-01-expected.txt:
* web-platform-tests/html/dom/documents/resource-metadata-management/document-lastModified-expected.txt:

Source/WebCore:

<rdar://problem/22567705>

Reviewed by Ryosuke Niwa.

document.lastModified should use the user's local time zone:
https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified

Chrome and Firefox comply with the specification but WebKit was using
UTC. This patch aligns WebKit's behavior with the specification and
other browsers.

No new tests, already covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::lastModified):
(WebCore::Document::setCookieURL): Deleted.

LayoutTests:

Reviewed by Ryosuke Niwa.

Update test so that it converts document.lastModified to UTF before
printing it. This is so that we can consistent layout tests results, no
matter the system's timezone.

* http/tests/misc/last-modified-parsing-expected.txt:
* http/tests/resources/last-modified.php:

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

5 years agoUnreviewed EFL gardening.
gyuyoung.kim@webkit.org [Mon, 14 Sep 2015 03:07:48 +0000 (03:07 +0000)]
Unreviewed EFL gardening.

Mark fast/text/international/system-language/system-font-punctuation.html to *Missing* since r188377.
Additionally some tests have been passed since r188693. Removed the tests in TestExpectation.

* platform/efl/TestExpectations:

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

5 years agoNode.baseURI should not return null for detached nodes
cdumez@apple.com [Mon, 14 Sep 2015 03:04:47 +0000 (03:04 +0000)]
Node.baseURI should not return null for detached nodes
https://bugs.webkit.org/show_bug.cgi?id=149104
<rdar://problem/22559535>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/dom/nodes/Node-baseURI-expected.txt:

Source/WebCore:

Node.baseURI should not return null for detached nodes. It should return
the node document's base URL. The node document is set when the node is
created so it is valid even if the node is detached [1]:
https://dom.spec.whatwg.org/#dom-node-baseuri

WebKit was traversing the ancestors to find the base URL, which only
works if the node is attached. Also, WebKit was taking into account
the xml:base attribute when computing the baseURI.

Both Chrome and Firefox already dropped support for xml:base:
https://code.google.com/p/chromium/issues/detail?id=341854
https://bugzilla.mozilla.org/show_bug.cgi?id=903372

Firefox complies with the specification. Chrome's baseURI still only
works for attached Nodes as their implementation still traverses the
DOM tree, despite dropping support for xml:base.

This patch drops support xml:base when computing Node.baseURI, as
Firefox, Chrome and the latest DOM specification do. It also makes
Node.baseURI work for detached Nodes by returning the base URL of the
node Document. This means we no longer have to traverse the Node's
ancestors in the DOM tree. This is consistent with the behavior of
Firefox and the latest DOM specification.

This patch does not drop the SVGElement.xmlbase attribute yet. However,
we should probably consider making this change as well given that:
- The SVG2 specification dropped it
- Chrome dropped it.
- It no longers impacts Node.baseURI

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976

No new tests, already covered by existing test.

* dom/Document.cpp:
(WebCore::Document::setContent): Deleted.
* dom/Document.h:
(WebCore::Document::inputCursor): Deleted.
* dom/DocumentType.cpp:
(WebCore::DocumentType::nodeName): Deleted.
* dom/DocumentType.h:
* dom/Element.cpp:
(WebCore::Element::imageSourceURL): Deleted.
(WebCore::Element::rendererIsNeeded): Deleted.
(WebCore::Element::createElementRenderer): Deleted.
(WebCore::Element::insertedInto): Deleted.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::baseURI):
* dom/Node.h:
* svg/SVGElement.idl:

LayoutTests:

* dom/xhtml/level3/core/nodegetbaseuri03-expected.txt:
Rebaseline outdated DOM3 test.

* svg/custom/image-base-uri-expected.txt: Removed.
* svg/custom/image-base-uri.svg: Removed.
Drop outdated SVG test. SVG2 no longer support xml:base.

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

5 years agoCharacterData API parameters should not be optional
cdumez@apple.com [Mon, 14 Sep 2015 02:42:06 +0000 (02:42 +0000)]
CharacterData API parameters should not be optional
https://bugs.webkit.org/show_bug.cgi?id=149101
<rdar://problem/22546954>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt:

Source/WebCore:

CharacterData API parameters should not be optional as per the DOM
specification:
https://dom.spec.whatwg.org/#characterdata

The parameters are also mandatory in Firefox and Chrome. However,
those parameters are optional in WebKit. When DOMString parameters
were omitted, we would use the "undefined" string instead. When
unsigned long parameters were omitted, we would use 0 instead.
This patch aligns our behavior with the specification and other
major browsers.

No new tests, already covered by existing tests.

* dom/CharacterData.cpp:
(WebCore::CharacterData::appendData):
* dom/CharacterData.h:
* dom/CharacterData.idl:
* dom/Element.cpp:
(WebCore::Element::mergeWithNextTextNode):
* dom/Node.cpp:
(WebCore::Node::normalize):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::exitText):

LayoutTests:

Update existing test to reflect our web-exposed behavior change.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js:

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

5 years agoRemove all uses of PassRefPtr in crypto, storage, and history
gyuyoung.kim@webkit.org [Mon, 14 Sep 2015 02:36:37 +0000 (02:36 +0000)]
Remove all uses of PassRefPtr in crypto, storage, and history
https://bugs.webkit.org/show_bug.cgi?id=149091

Reviewed by Andreas Kling.

Source/WebCore:

* crypto/CryptoKeyPair.cpp:
(WebCore::CryptoKeyPair::CryptoKeyPair):
* crypto/CryptoKeyPair.h:
(WebCore::CryptoKeyPair::create):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::create):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::generate):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::generate):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::create):
* history/BackForwardController.cpp:
(WebCore::BackForwardController::BackForwardController):
* history/BackForwardController.h:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::setStateObject):
(WebCore::HistoryItem::setFormData):
* history/HistoryItem.h:
(WebCore::HistoryItem::stateObject):
* loader/EmptyClients.cpp:
* page/Page.cpp:
(WebCore::Page::Page):
* storage/Storage.cpp:
(WebCore::Storage::create):
(WebCore::Storage::Storage):
* storage/Storage.h:
* storage/StorageArea.h:
* storage/StorageMap.cpp:
(WebCore::StorageMap::copy):
(WebCore::StorageMap::setItem):
(WebCore::StorageMap::setItemIgnoringQuota):
(WebCore::StorageMap::removeItem):
* storage/StorageMap.h:
* storage/StorageNamespace.h:

Source/WebKit:

* Storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::storageArea):
* Storage/StorageNamespaceImpl.h:

Source/WebKit2:

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::storageArea):
* WebProcess/Storage/StorageNamespaceImpl.h:

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

5 years agoDefine HAVE_LINK_PREVIEW in WebKit2
mitz@apple.com [Sun, 13 Sep 2015 19:13:41 +0000 (19:13 +0000)]
Define HAVE_LINK_PREVIEW in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=149099

Reviewed by Sam Weinig.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/WKImagePreviewViewController.mm:
* config.h:

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

5 years agoWebkit Gujarati Translations
mcatanzaro@igalia.com [Sun, 13 Sep 2015 14:01:49 +0000 (14:01 +0000)]
Webkit Gujarati Translations
https://bugs.webkit.org/show_bug.cgi?id=139530

Unreviewed.

Patch by Ankit Patel <ankit@redhat.com> on 2015-09-13

* gu.po:

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

5 years agoAnother test fix after r189670.
mmaxfield@apple.com [Sun, 13 Sep 2015 06:46:30 +0000 (06:46 +0000)]
Another test fix after r189670.

Unreviewed.

* platform/mac-wk1/TestExpectations:

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

5 years agoTest fix after r189670.
mmaxfield@apple.com [Sun, 13 Sep 2015 06:19:01 +0000 (06:19 +0000)]
Test fix after r189670.

Unreviewed.

* platform/mac/TestExpectations:

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

5 years ago[Cocoa] Add system-language-specific tests
mmaxfield@apple.com [Sun, 13 Sep 2015 04:10:06 +0000 (04:10 +0000)]
[Cocoa] Add system-language-specific tests
https://bugs.webkit.org/show_bug.cgi?id=148775

Reviewed by Alexey Proskuryakov.

This patch adds (or rewrites) tests to take advantage of our new ability to mock
the system language for testing (https://bugs.webkit.org/show_bug.cgi?id=148671).

It tests these patches:
https://bugs.webkit.org/show_bug.cgi?id=148164
https://bugs.webkit.org/show_bug.cgi?id=147504
https://bugs.webkit.org/show_bug.cgi?id=147862
https://bugs.webkit.org/show_bug.cgi?id=147964

* fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html: Renamed from LayoutTests/fast/text/arabic-glyph-cache-fill-combine-expected.html.
* fast/text/international/system-language/arabic-glyph-cache-fill-combine.html: Renamed from LayoutTests/fast/text/arabic-glyph-cache-fill-combine.html.
* fast/text/international/system-language/han-quotes-expected-mismatch.html: Added.
* fast/text/international/system-language/han-quotes.html: Added.
* fast/text/international/system-language/hindi-system-font-punctuation-expected.html: Renamed from LayoutTests/fast/text/hindi-system-font-punctuation-expected.html.
* fast/text/international/system-language/hindi-system-font-punctuation.html: Renamed from LayoutTests/fast/text/hindi-system-font-punctuation.html.
* fast/text/international/system-language/system-font-punctuation.html: Renamed from LayoutTests/fast/text/system-font-punctuation.html.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/fast/text/international/system-language/system-font-punctuation-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/text/system-font-punctuation-expected.txt.
* platform/mac/TestExpectations:
* platform/mac/fast/text/international/system-language/system-font-punctuation-expected.txt: Renamed from LayoutTests/platform/mac/fast/text/system-font-punctuation-expected.txt.
* platform/win/TestExpectations:
* platform/win/fast/text/international/system-language/system-font-punctuation-expected.txt: Renamed from LayoutTests/platform/win/fast/text/system-font-punctuation-expected.txt.

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

5 years ago[Cocoa] Allow testing with the system language
mmaxfield@apple.com [Sun, 13 Sep 2015 03:47:56 +0000 (03:47 +0000)]
[Cocoa] Allow testing with the system language
https://bugs.webkit.org/show_bug.cgi?id=148671

Reviewed by Anders Carlsson and Alexey Proskuryakov.

Source/WebKit2:

This patch adds two new SPI functions for setting and retrieving a vector of
override languages to/from the WKContextConfiguration. The implementation of
these functions holds state inside WebProcessPoolConfiguration. Then, when
we launch a process, the WebProcessProxy will inject these override languages
into the ProcessLauncher::LaunchOptions so that the ProcessLauncher can
inject these languages into the XPC Bootstrap message. Then, in the Web
Process's main(), the XPC Boostrap message is read, and the platform
languages are set via NSUserDefaults setting a volatile domain.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
(main): Set the volatile domain with NSUserDefaults.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h: Hold state for the override
languages.
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationCopyOverrideLanguages): SPI.
(WKContextConfigurationSetOverrideLanguages): Ditto.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService): Inject the languages into the XPC Bootstrap
message.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions): Inject the override languages
into the ProcessLauncher::LaunchOptions.

Tools:

React to tests marked with language=lang1,lang2,etc in their header.
Once this information is parsed, pass it to
WKContextConfigurationSetOverrideLanguages().

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize): Don't clobber the language
list.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions): Call
WKContextConfigurationSetOverrideLanguages().
(WTR::updateTestOptionsFromTestHeader): Inspect the language option.
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions): Cause a differing language
option to restart the web process.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions): Ditto.

LayoutTests:

Add a test for the declarative form of setting the system language.

* fast/text/international/system-language/declarative-language-expected.txt: Added.
* fast/text/international/system-language/declarative-language.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

5 years ago[WKTR] Allow changing the WKContextConfiguration between successive tests
mmaxfield@apple.com [Sun, 13 Sep 2015 02:31:34 +0000 (02:31 +0000)]
[WKTR] Allow changing the WKContextConfiguration between successive tests
https://bugs.webkit.org/show_bug.cgi?id=148833

Reviewed by Tim Horton.

Previously, we were creating a single WKContext and it lived for the life of the entire test runner.
However, there are certain tests which require specifying options in this object. This patch makes
our existing code for recreating the test runner web view also recreate the WKContext.

As such, our options to the view are now options to the WKContextConfiguration. This patch renames the
class.

* WebKitTestRunner/ContextConfigurationOptions.h: Renamed from Tools/WebKitTestRunner/ViewOptions.h.
* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::options):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::generateContextConfiguration):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::ensureViewSupportsOptionsForTest):
(WTR::updateContextConfigurationOptionsFromTestHeader):
(WTR::TestController::contextConfigurationOptionsForTest):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::updateViewOptionsFromTestHeader): Deleted.
(WTR::TestController::viewOptionsForTest): Deleted.
* WebKitTestRunner/TestController.h:
(WTR::TestController::injectedBundlePath):
(WTR::TestController::testPluginDirectory):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.

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

5 years agoUpdated Spanish translation
mcatanzaro@igalia.com [Sun, 13 Sep 2015 01:14:08 +0000 (01:14 +0000)]
Updated Spanish translation
https://bugs.webkit.org/show_bug.cgi?id=145550

Unreviewed.

Patch by Francisco Serrador <fserrador@gmail.com> on 2015-09-12

* es.po:

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

5 years agoUpdated Slovenian translation
mcatanzaro@igalia.com [Sun, 13 Sep 2015 01:11:46 +0000 (01:11 +0000)]
Updated Slovenian translation
https://bugs.webkit.org/show_bug.cgi?id=123080

Unreviewed.

Patch by Matej Urbančič <mateju@svn.gnome.org> on 2015-09-12

* sl.po:

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

5 years agoWebkit Tamil translations updated
mcatanzaro@igalia.com [Sun, 13 Sep 2015 01:08:22 +0000 (01:08 +0000)]
Webkit Tamil translations updated
https://bugs.webkit.org/show_bug.cgi?id=139478

Unreviewed.

Patch by Shantha kumar <shkumar@redhat.com> on 2015-09-12

* ta.po:

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

5 years ago[l10n] Updated Bulgarian translation
mcatanzaro@igalia.com [Sat, 12 Sep 2015 23:56:21 +0000 (23:56 +0000)]
[l10n] Updated Bulgarian translation
https://bugs.webkit.org/show_bug.cgi?id=142611

Unreviewed.

Patch by Zahari Yurukov <zahari.yurukov@gmail.com> on 2015-09-12

* bg.po:

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