WebKit-https.git
3 years agoAdd comments to clarify feature enablement
mcatanzaro@igalia.com [Thu, 9 Jun 2016 20:09:21 +0000 (20:09 +0000)]
Add comments to clarify feature enablement
https://bugs.webkit.org/show_bug.cgi?id=158567

Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitFeatures.cmake:

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

3 years agoPerformanceTests:
fpizlo@apple.com [Thu, 9 Jun 2016 19:24:22 +0000 (19:24 +0000)]
PerformanceTests:
Unreviewed, teach the perf bots not to run JSAir.

* Skipped:

Tools:
Unreviewed, skip jsair tests while we figure out the debug timeouts.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):

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

3 years agoUnreviewed, rolling out r201815.
commit-queue@webkit.org [Thu, 9 Jun 2016 18:52:27 +0000 (18:52 +0000)]
Unreviewed, rolling out r201815.
https://bugs.webkit.org/show_bug.cgi?id=158570

This broke the cmake build. (Requested by lforschler on
#webkit).

Reverted changeset:

"Teach cmake about libWebKitSystemInterfaceOSX10.12"
http://trac.webkit.org/changeset/201815

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

3 years agoWorkerGlobalScope attributes / operations should be on the prototype
cdumez@apple.com [Thu, 9 Jun 2016 18:47:21 +0000 (18:47 +0000)]
WorkerGlobalScope attributes / operations should be on the prototype
https://bugs.webkit.org/show_bug.cgi?id=158568
<rdar://problem/26720079>

Reviewed by Geoffrey Garen.

Source/WebCore:

WorkerGlobalScope attributes / operations should be on the prototype
because WorkerGlobalScope is not marked as [Global] / [PrimaryGlobal]:
- https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
- http://heycam.github.io/webidl/#es-attributes
- http://heycam.github.io/webidl/#es-operations

DedicatedWorkerGlobalScope is the interface that is marked as [Global]
and whose attributes / operations should be on the instance.

This brings the number of failures on http://w3c-test.org/workers/interfaces.worker
from 65 to 34. It also aligns our behavior with Firefox and Chrome.

Test: fast/workers/WorkerGlobalScope-properties-prototype.html

* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstance):
(OperationShouldBeOnInstance):

LayoutTests:

* fast/workers/WorkerGlobalScope-properties-prototype-expected.txt: Added.
* fast/workers/WorkerGlobalScope-properties-prototype.html: Added.
Add layout test coverage.

* fast/workers/self-hasOwnProperty-expected.txt:
* fast/workers/self-hasOwnProperty.html:
Update test I added a couple of days ago because it wrongly expected
the 'navigator' property to be on the instance. This check was failing
in other browsers (Firefox and Chrome).

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

3 years agoWriting-mode-dependent properties don't apply if their value is a variable
timothy_horton@apple.com [Thu, 9 Jun 2016 18:33:02 +0000 (18:33 +0000)]
Writing-mode-dependent properties don't apply if their value is a variable
https://bugs.webkit.org/show_bug.cgi?id=158449
<rdar://problem/26662478>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/css/variables/direction-dependent-variable-properties.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseVariableDependentValue):
* css/CSSParser.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::resolvedVariableValue):
CSSVariableDependentValue stores the unresolved (direction-dependent) property ID,
because the property that it resolves to cannot be determined until style resolution time.
Plumb the requisite direction and writing mode information into parseVariableDependentValue
at style resolution time so that the property can be resolved to the correct
non-direction-dependent property for each use of the value.

LayoutTests:

* fast/css/variables/direction-dependent-variable-properties-expected.html: Added.
* fast/css/variables/direction-dependent-variable-properties.html: Added.
Add a test ensuring that direction-dependent properties work correctly,
including flipping when the direction is flipped.

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

3 years agoMarking editing/selection/selection-in-iframe-removed-crash.html as flaky on Mac
ryanhaddad@apple.com [Thu, 9 Jun 2016 18:27:32 +0000 (18:27 +0000)]
Marking editing/selection/selection-in-iframe-removed-crash.html as flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=158569

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoUnaddressed review feedback from r201872
beidson@apple.com [Thu, 9 Jun 2016 17:42:41 +0000 (17:42 +0000)]
Unaddressed review feedback from r201872

* wtf/CrossThreadTask.h:
(WTF::callFunctionForCrossThreadTask): Fix typo.

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

3 years agoGreatly simplify CrossThreadTask.h.
beidson@apple.com [Thu, 9 Jun 2016 17:34:55 +0000 (17:34 +0000)]
Greatly simplify CrossThreadTask.h.
https://bugs.webkit.org/show_bug.cgi?id=158542

Reviewed by Darin Adler.

Source/WTF:

* wtf/CrossThreadTask.h:
(WTF::crossThreadCopy):
(WTF::callFunctionForCrossThreadTaskImpl):
(WTF::callFunctionForCrossThreadTask):
(WTF::createCrossThreadTask):
(WTF::callMemberFunctionForCrossThreadTaskImpl):
(WTF::callMemberFunctionForCrossThreadTask):

Tools:

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

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

3 years agoLayoutTest storage/indexeddb/modern/handle-user-delete.html is a flaky failure.
beidson@apple.com [Thu, 9 Jun 2016 17:31:08 +0000 (17:31 +0000)]
LayoutTest storage/indexeddb/modern/handle-user-delete.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=158501

Reviewed by Darin Adler.

The order in which the transaction abort happens doesn't matter; It only matters that it happens.

Update the test to reflect this.

* storage/indexeddb/modern/handle-user-delete-expected.txt:
* storage/indexeddb/modern/resources/handle-user-delete.js:

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

3 years agoAttempt to fix the iOS build.
ryanhaddad@apple.com [Thu, 9 Jun 2016 17:12:53 +0000 (17:12 +0000)]
Attempt to fix the iOS build.

Unreviewed build fix.

* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError):

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

3 years agoUpdate properties for UIWKTextInteractionAssistant
ddkilzer@apple.com [Thu, 9 Jun 2016 17:07:06 +0000 (17:07 +0000)]
Update properties for UIWKTextInteractionAssistant
<https://webkit.org/b/158559>

Reviewed by Darin Adler.

* Platform/spi/ios/UIKitSPI.h:
(UIWKTextInteractionAssistant.loupeGesture):
(UIWKTextInteractionAssistant.singleTapGesture):
Change from retain to assign since UIWKTextInteractionAssistant
is not responsible for their lifetime.  Sort alphabetically.

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

3 years agoborder-radius with different width and height rendered wrong
simon.fraser@apple.com [Thu, 9 Jun 2016 16:59:17 +0000 (16:59 +0000)]
border-radius with different width and height rendered wrong
https://bugs.webkit.org/show_bug.cgi?id=158300
<rdar://problem/26672922>

Reviewed by Zalan Bujtas.
Source/WebCore:

Borders with border-radius close to 100% 100% got oddly clipped. This happened because
of the clipping we do to achieve the diagonal corner joins; RenderBoxModelObject::clipBorderSidePolygon()
created trapezoids for each side, but only extended them to the center of the inner border rect.
This clipped out parts of these borders.

Fix by computing the trapezoids by intersecting the corner diagonal line with a line that passes
through the adjacent corners of the inner rect, whose intersection is always going to be inside the
rounded border. Also fix the quads used to do the antialiased/non-antialiased clipping,
by adding a point rather than moving a corner point to ensure we don't mistakenly clip out any
parts of the border.

Finally, improve the rendering of non-renderable cases by actually doing the diagonal
corner joins rather than just giving up.

Tests: fast/borders/border-non-renderable-radius-inner-clip.html
       fast/borders/border-radius-inner-clip-vertical.html
       fast/borders/border-radius-inner-clip.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::calculateAdjustedInnerBorder): Moved up.
(WebCore::RenderBoxModelObject::paintOneBorderSide):
(WebCore::RenderBoxModelObject::clipBorderSidePolygon):
(WebCore::findInnerVertex): Deleted.
(WebCore::calculateSideRectIncludingInner): Deleted.
(WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath): Deleted.
* rendering/RenderBoxModelObject.h:

LayoutTests:

* fast/borders/border-non-renderable-radius-inner-clip-expected.html: Added.
* fast/borders/border-non-renderable-radius-inner-clip.html: Added.
* fast/borders/border-radius-inner-clip-expected-mismatch.html: Added.
* fast/borders/border-radius-inner-clip-vertical-expected-mismatch.html: Added.
* fast/borders/border-radius-inner-clip-vertical.html: Added.
* fast/borders/border-radius-inner-clip.html: Added.
* fast/borders/resources/border-radius-helpers.js: Added.
(createContainer):
(createReferenceContainer):

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

3 years agoUnreviewed test gardening.
peavo@outlook.com [Thu, 9 Jun 2016 16:49:19 +0000 (16:49 +0000)]
Unreviewed test gardening.

Unskip passing websocket tests.

* platform/win/TestExpectations:

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

3 years agoUnreviewed, rolling out r201836, r201845, and r201848.
cdumez@apple.com [Thu, 9 Jun 2016 16:31:38 +0000 (16:31 +0000)]
Unreviewed, rolling out r201836, r201845, and r201848.

Looks like a 1-2% PLT regression on iOS

Reverted changesets:

"[JSC] Change some parameters based on a random search"
https://bugs.webkit.org/show_bug.cgi?id=158514
http://trac.webkit.org/changeset/201836

"Tempory fix for the debug bots"
http://trac.webkit.org/changeset/201845

"Change thresholdForOptimizeSoon to match
thresholdForOptimizeAfterWarmUp"
http://trac.webkit.org/changeset/201848

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

3 years agoUnreviewed, rolling out r201842.
ryanhaddad@apple.com [Thu, 9 Jun 2016 15:56:07 +0000 (15:56 +0000)]
Unreviewed, rolling out r201842.

The change that prompted this rebaseline was rolled out.

Reverted changeset:

"Rebaseline js/dom/global-constructors-attributes.html for Mac
after r201810"
http://trac.webkit.org/changeset/201842

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

3 years agoUnreviewed, fixing compilation issue with WebRTC
calvaris@igalia.com [Thu, 9 Jun 2016 15:14:41 +0000 (15:14 +0000)]
Unreviewed, fixing compilation issue with WebRTC

The code dependencies of the SDP processor were not right.

* PlatformGTK.cmake:

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

3 years agoWebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters
msaboff@apple.com [Thu, 9 Jun 2016 14:54:50 +0000 (14:54 +0000)]
WebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters
https://bugs.webkit.org/show_bug.cgi?id=154863

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling
surrogates called WKStringGetUTF8CStringNonStrict().

* Shared/API/c/WKString.cpp:
(WKStringGetUTF8CStringImpl):
(WKStringGetUTF8CString):
(WKStringGetUTF8CStringNonStrict):
* Shared/API/c/WKString.h:

Tools:

Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling
surrogates.  Changed the extraction of inner text from frames in DumpRenderTree
to use the new WKStringGetUTF8CStringNonStrict() function instead of NSString
conversion since NSString doesn't have a way to handle dangling surrogates.
The code added in DumpRenderTree matches what was changed in WebKitTestRunner.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpFramesAsText):
* WebKitTestRunner/StringFunctions.h:
(WTR::toWTFString):

LayoutTests:

New tests.

* fast/text/dangling-surrogates-expected.txt: Added.
* fast/text/dangling-surrogates.html: Added.

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

3 years agoIntroduce MathOperator::Type
fred.wang@free.fr [Thu, 9 Jun 2016 14:50:19 +0000 (14:50 +0000)]
Introduce MathOperator::Type
https://bugs.webkit.org/show_bug.cgi?id=156950

Patch by Frederic Wang <fwang@igalia.com> on 2016-06-09
Reviewed by Sergio Villar Senin.

No new tests, behavior is not change.

An enum Type is introduced in MathOperator in order to indicate
which kind of stretching is requested. In follow-up work, this will
allow to just call setOperator and stretchTo without having to
explicitly call calculateDisplayStyleLargeOperator or calculateStretchyData.

* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::setOperator): Use Type instead of a boolean.
(WebCore::MathOperator::setGlyphAssembly): Add an assert to ensure that the function is correctly used.
(WebCore::MathOperator::calculateDisplayStyleLargeOperator): Ditto, this makes the assert more accurate.
(WebCore::MathOperator::calculateStretchyData): Ditto and replace m_isVertical with a local isVertical variable.
(WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
(WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
(WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
(WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
* rendering/mathml/MathOperator.h: Add the Type enum.
(WebCore::MathOperator::stretchSize): Use Type instead of a boolean and add an
assert to ensure that the function is correctly used.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Call setOperator with the correct value.
(WebCore::RenderMathMLOperator::updateStyle): Ditto.

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

3 years agoUnreviewed, rolling out r201810.
commit-queue@webkit.org [Thu, 9 Jun 2016 12:59:40 +0000 (12:59 +0000)]
Unreviewed, rolling out r201810.
https://bugs.webkit.org/show_bug.cgi?id=158563

breaks build without ENABLE_WEB_ANIMATION (Requested by
mcatanzaro on #webkit).

Reverted changeset:

"[web-animations] Add Animatable, AnimationEffect,
KeyframeEffect and Animation interface"
https://bugs.webkit.org/show_bug.cgi?id=156096
http://trac.webkit.org/changeset/201810

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

3 years ago[Threaded Compositor] Many layout tests crash when threaded compositor is enabled
carlosgc@webkit.org [Thu, 9 Jun 2016 12:09:22 +0000 (12:09 +0000)]
[Threaded Compositor] Many layout tests crash when threaded compositor is enabled
https://bugs.webkit.org/show_bug.cgi?id=158560

Reviewed by Žan Doberšek.

This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's
called. But the compositor is only present when GraphicsLayer::create() is called with a
GraphicsLayerFactory. When running the layout tests, layers are created without a factory because DrawingAreaImpl
is not entering AC mode as expected and the layer tree host is not created, making
DrawingAreaImpl::graphicsLayerFactory() always return nullptr. This happens because DrawingAreaImpl is checking
acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not, and WTR sets that
setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have
any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true
or false.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):

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

3 years ago[Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
carlosgc@webkit.org [Thu, 9 Jun 2016 12:07:38 +0000 (12:07 +0000)]
[Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
https://bugs.webkit.org/show_bug.cgi?id=158523

Reviewed by Michael Catanzaro.

ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
schedule a task to the update the timer in the compositing thread, we can do that directly in the main
thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
(WebKit::ThreadedCompositor::updateSceneState):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

3 years agoslotchange event should be fired at the end of microtask
rniwa@webkit.org [Thu, 9 Jun 2016 09:09:50 +0000 (09:09 +0000)]
slotchange event should be fired at the end of microtask
https://bugs.webkit.org/show_bug.cgi?id=157374
<rdar://problem/26154024>

Reviewed by Antti Koivisto.

Source/WebCore:

Dispatch slotchange event at the end of every microtask after delivering records to mutation observers
as specified in: https://dom.spec.whatwg.org/#notify-mutation-observers

Test: fast/shadow-dom/slotchange-event.html

* dom/Document.cpp:
(WebCore::Document::enqueueSlotchangeEvent): Deleted.
* dom/Document.h:
* dom/MutationObserver.cpp:
(WebCore::signalSlotList): Added.
(WebCore::MutationObserverMicrotask::run): mutationObserverCompoundMicrotaskQueuedFlag is now unset in
notifyMutationObservers to better match the concept to "notify mutation observers".
(WebCore::MutationObserver::enqueueSlotChangeEvent): Added.
(WebCore::MutationObserver::notifyMutationObservers): Renamed from deliverAllMutations. Added the code
to dispatch slotchange events as spec'ed, and also added comments for each step.
* dom/MutationObserver.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Use MutationObserver::enqueueSlotChangeEvent. Don't
create an event here since that is only needed when dispatching the event, and to keep track of whether
we've already scheduled an event or not. Use a boolean flag instead for the latter.
(WebCore::HTMLSlotElement::dispatchSlotChangeEvent): Added. Creates and dispatches an event.
(WebCore::HTMLSlotElement::dispatchEvent): Deleted.
* html/HTMLSlotElement.h:
(WebCore::HTMLSlotElement::didRemoveFromSignalSlotList): Added.

LayoutTests:

Added a test case to ensure slotchange event is dispatched at the end of a microtask.

* fast/shadow-dom/slotchange-event-expected.txt:
* fast/shadow-dom/slotchange-event.html:

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

3 years agoIncrease disk cache capacity when there is lots of free space
antti@apple.com [Thu, 9 Jun 2016 08:41:54 +0000 (08:41 +0000)]
Increase disk cache capacity when there is lots of free space
https://bugs.webkit.org/show_bug.cgi?id=158526

Reviewed by Chris Dumez.

Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.

This patch changes cache size for PrimaryWebBrowser cache model

>=16GB free: 175MB -> 500MB
8-16GB free: 150MB -> 250MB

and modestly for DocumentBrowser

>=16GB free: 50MB -> 75MB

Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
available disk space in scenarios like software installation.

* Shared/CacheModel.cpp:
(WebKit::calculateCacheSizes):

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

3 years agoIntroduce ResourceErrorBase::type
youenn.fablet@crf.canon.fr [Thu, 9 Jun 2016 06:55:26 +0000 (06:55 +0000)]
Introduce ResourceErrorBase::type
https://bugs.webkit.org/show_bug.cgi?id=158299

Reviewed by Alex Christensen.

Source/WebCore:

Introducing an enum type for ResourceErrorBase.
In most cases, the type is set at construction time.
By default, constructor with no parameters will set type to Null.
Constructor with parameters will set type to General.

Removed boolean state error fields.

Introduced a type setter. It should only be used to  make the type
more precise (when type is Null or General).

Updating related calling code.

No change of behavior.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingForPolicyChange):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::cancel):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::cancelledError):
(WebCore::FrameLoader::blockedError):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
* platform/network/ResourceErrorBase.cpp:
(WebCore::ResourceErrorBase::isolatedCopy):
(WebCore::ResourceErrorBase::setType):
(WebCore::ResourceErrorBase::compare):
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::isNull):
(WebCore::ResourceErrorBase::isCancellation):
(WebCore::ResourceErrorBase::isTimeout):
(WebCore::ResourceErrorBase::type):
(WebCore::ResourceErrorBase::ResourceErrorBase):
(WebCore::ResourceErrorBase::domain):
* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::cfError):
* platform/network/curl/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::m_platformError):
(WebCore::ResourceError::nsError):
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::platformLazyInit):
* platform/network/soup/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::timeoutError):

Source/WebKit2:

* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

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

3 years agoREGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
commit-queue@webkit.org [Thu, 9 Jun 2016 06:20:55 +0000 (06:20 +0000)]
REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
https://bugs.webkit.org/show_bug.cgi?id=158548
<rdar://problem/26708513>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-08
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Controllers/RuntimeManager.js:
(WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
Switch the many parameters to an options dictionary.
Include a new option for sourceURL appender, so that
Console evaluations can have its own append.

* UserInterface/Controllers/JavaScriptLogViewController.js:
(WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
Use the appendWebInspectorConsoleEvaluationSourceURL appender.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection.):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
Use the new options dictionary.

LayoutTests:

* inspector/console/addInspectedNode.html:
* inspector/console/command-line-api-copy.html:
* inspector/console/command-line-api.html:
* inspector/console/console-api.html:
* inspector/console/console-table.html:
* inspector/console/messagesCleared.html:
* inspector/controller/runtime-controller.html:
* inspector/debugger/command-line-api-exception-nested-catch.html:
* inspector/debugger/command-line-api-exception.html:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object-weak-collection.html:
* inspector/model/remote-object.html:
* inspector/timeline/exception-in-injected-script-while-recording.html:
Update evaluateInInspectedWindow callsites to use options dictionary.

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

3 years agoMove selection and drawing of stretchy operators into a separate MathOperator class
fred.wang@free.fr [Thu, 9 Jun 2016 06:17:40 +0000 (06:17 +0000)]
Move selection and drawing of stretchy operators into a separate MathOperator class
https://bugs.webkit.org/show_bug.cgi?id=156921

Patch by Frederic Wang <fwang@igalia.com> on 2016-06-08
Reviewed by Martin Robinson.

No new tests, behavior is not changed.

* CMakeLists.txt: Add the MathOperator files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* rendering/mathml/MathOperator.cpp: Added.
(WebCore::boundsForGlyph): Moved from RenderMathMLOperator.
(WebCore::heightForGlyph): Moved from RenderMathMLOperator.
(WebCore::advanceWidthForGlyph): Moved from RenderMathMLOperator.
(WebCore::MathOperator::MathOperator):
(WebCore::MathOperator::setOperator):
(WebCore::MathOperator::getBaseGlyph): Moved from RenderMathMLOperator.
(WebCore::MathOperator::setSizeVariant): Moved from RenderMathMLOperator.
(WebCore::MathOperator::setGlyphAssembly): Moved from RenderMathMLOperator.
(WebCore::MathOperator::calculateDisplayStyleLargeOperator): Moved from RenderMathMLOperator with additional style parameter.
(WebCore::MathOperator::calculateGlyphAssemblyFallBack): Ditto.
(WebCore::MathOperator::calculateStretchyData): Ditto.
(WebCore::MathOperator::paintGlyph): Ditto.
(WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
(WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
(WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
(WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
* rendering/mathml/MathOperator.h: Added.
(WebCore::MathOperator::italicCorrection):
(WebCore::MathOperator::isStretched):
(WebCore::MathOperator::unstretch):
(WebCore::MathOperator::GlyphAssemblyData::GlyphAssemblyData): Moved from RenderMathMLOperator.
(WebCore::MathOperator::stretchSize):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Updated to use MathOperator members.
For now we call setOperator to transmit information to m_mathOperator.
(WebCore::RenderMathMLOperator::updateStyle): Updated to use MathOperator members.
For now we set some m_mathOperator members to transmit it some information.
(WebCore::RenderMathMLOperator::firstLineBaseline): Updated to use MathOperator members.
(WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
(WebCore::RenderMathMLOperator::paint): Ditto.
For now we set some m_mathOperator members to transmit it some information.
(WebCore::RenderMathMLOperator::paintChildren): Updated to use MathOperator members.
(WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
(WebCore::RenderMathMLOperator::getBaseGlyph): Deleted.
(WebCore::RenderMathMLOperator::setSizeVariant): Deleted.
(WebCore::RenderMathMLOperator::setGlyphAssembly): Deleted.
(WebCore::RenderMathMLOperator::calculateGlyphAssemblyFallBack): Deleted.
(WebCore::RenderMathMLOperator::calculateDisplayStyleLargeOperator): Deleted.
(WebCore::RenderMathMLOperator::calculateStretchyData): Deleted.
(WebCore::RenderMathMLOperator::paintGlyph): Deleted.
(WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Deleted.
(WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Deleted.
(WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Deleted.
(WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Deleted.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::italicCorrection): Updated to use MathOperator members.
(WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): Deleted.

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

3 years agoJSObject::reifyAllStaticProperties cleanup
barraclough@apple.com [Thu, 9 Jun 2016 05:43:46 +0000 (05:43 +0000)]
JSObject::reifyAllStaticProperties cleanup
https://bugs.webkit.org/show_bug.cgi?id=158543

Reviewed by Mark Lam.

- JSObject & Structure contain fields labeled 'staticFunctionsReified', however reification now
  affects all properties, not just functions. Rename to 'staticPropertiesReified'.
- reifyAllStaticProperties relies on a 'hasStaticProperties' method on ClassInfo that walks the
  ClassInfo inheritance chain looking for static property tables. We can now more efficiently
  get this information from TypeInfo.
- reifyAllStaticProperties triggers a 'toUncacheableDictionaryTransition'; this is overzealous,
  cacheable dictionary is sufficient - this is what we do in the case of DOM prototype property
  reification (see 'reifyStaticProperties' in Lookup.h). (Changing this with an eye on switching
  DOM prototype property reification to use JSObject:: reifyAllStaticProperties, rather than
  having its own special purpose code path.)

* runtime/ClassInfo.h:
(JSC::ClassInfo::hasStaticProperties): Deleted.
    - deprecated by TypeInfo::hasStaticPropertyTable.
* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::getOwnNonIndexPropertyNames):
    - staticFunctionsReified -> staticPropertiesReified
(JSC::JSObject::reifyAllStaticProperties):
    - hasStaticProperties -> TypeInfo::hasStaticPropertyTable
    - toUncacheableDictionaryTransition -> toCacheableDictionaryTransition
    - staticFunctionsReified -> staticPropertiesReified
* runtime/JSObject.h:
(JSC::JSObject::staticPropertiesReified):
(JSC::JSObject::staticFunctionsReified): Deleted.
* runtime/Lookup.cpp:
(JSC::setUpStaticFunctionSlot):
* runtime/Lookup.h:
(JSC::getStaticPropertySlotFromTable):
(JSC::replaceStaticPropertySlot):
* runtime/Structure.cpp:
(JSC::Structure::Structure):
* runtime/Structure.h:
    - staticFunctionsReified -> staticPropertiesReified

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

3 years agoDedicatedWorkerGlobalScope prototype chain is incorrect
cdumez@apple.com [Thu, 9 Jun 2016 05:18:38 +0000 (05:18 +0000)]
DedicatedWorkerGlobalScope prototype chain is incorrect
https://bugs.webkit.org/show_bug.cgi?id=158544

Reviewed by Brady Eidson.

Source/WebCore:

There were several issues with the prototype chain of DedicatedWorkerGlobalScope:
1. Object.getPrototypeOf(DedicatedWorkerGlobalScope.prototype) was not
   WorkerGlobalScope.prototype.
2. WorkerGlobalScope.prototype was a DedicatedWorkerGlobalScopePrototype
   object and was equal to DedicatedWorkerGlobalScope.prototype.
3. Object.getPrototypeOf(WorkerGlobalScope.prototype) was not EventTarget.prototype.

Those issues were identified by the following W3C web-platform-test:
http://w3c-test.org/workers/interfaces.worker

This patch fixes the issue so that the prototype chain is now as per the
specification.

Test: fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html

* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
- Stop creating the WorkerGlobalScopePrototype and let JSWorkerGlobalScope
  create it.
- Set DedicatedWorkerGlobalScopePrototype's prototype to JSWorkerGlobalScope's
  prototype after creating the JSDedicatedWorkerGlobalScope object.

* bindings/scripts/CodeGeneratorJS.pm:
(ShouldUseGlobalObjectPrototype):
(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorHelperMethods):
- Do not use globalObject.getPrototypeDirect() as 'prototype' property for
  WorkerGlobalScope. The globalObject is a DedicatedWorkerGlobalScope, not
  a WorkerGlobalScope.
- Generate the code to create / get a prototype object for WorkerGlobalScope.

LayoutTests:

Add test coverage for the DedicatedWorkerGlobalScope prototype chain.

* fast/workers/DedicatedWorkerGlobalScope-prototype-chain-expected.txt: Added.
* fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html: Added.

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

3 years agoWebRTC: Imlement MediaEndpointPeerConnection::setRemoteDescription()
adam.bergkvist@ericsson.com [Thu, 9 Jun 2016 05:09:42 +0000 (05:09 +0000)]
WebRTC: Imlement MediaEndpointPeerConnection::setRemoteDescription()
https://bugs.webkit.org/show_bug.cgi?id=158467

Reviewed by Eric Carlson.

Source/WebCore:

Implement MediaEndpointPeerConnection::setRemoteDescription() which verifies a
remote offer or answer, configures the WebRTC backend and dispatches the 'track' events
that represent the incoming media [1].

This change also updates the RTCTrackEvent [2] with a streams and a transceiver attribute.

[1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-setremotedescription
[2] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#rtctrackevent

Tests: fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html
       fast/mediastream/RTCTrackEvent-constructor.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescription):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
Implemented.
(WebCore::MediaEndpointPeerConnection::remoteDescription):
(WebCore::MediaEndpointPeerConnection::currentRemoteDescription):
(WebCore::MediaEndpointPeerConnection::pendingRemoteDescription):
(WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::internalRemoteDescription):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::isDispatched):
(WebCore::RTCRtpReceiver::setDispatched):
* Modules/mediastream/RTCTrackEvent.cpp:
(WebCore::RTCTrackEvent::create):
(WebCore::RTCTrackEvent::RTCTrackEvent):
* Modules/mediastream/RTCTrackEvent.h:
(WebCore::RTCTrackEvent::streams):
(WebCore::RTCTrackEvent::transceiver):
* Modules/mediastream/RTCTrackEvent.idl:
Add streams and transceiver attributes.
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
* platform/mediastream/MediaEndpoint.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::filterPayloads):
(WebCore::MockMediaEndpoint::updateSendConfiguration):
* platform/mock/MockMediaEndpoint.h:

LayoutTests:

Add tests for RTCPeerConnection.setRemoteDescription() and the RTCTrackEvent constructor.

* fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html: Added.
Verify the description set, the expected RTCPeerConnection state changes and that the
'track' event is fired before the setRemoteDescription() promise fulfills.
* fast/mediastream/RTCTrackEvent-constructor-expected.txt: Added.
* fast/mediastream/RTCTrackEvent-constructor.html: Added.
This test has some expected failures since the bindings generator don't support 'required'
dictionary members for event init dictionaries.
* platform/mac/TestExpectations:
Skip tests for mac that require building with WEB_RTC enabled.

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

3 years agoPerform IDNA encoding on parameters for setHostAndPort and setHost
bfulgham@apple.com [Thu, 9 Jun 2016 05:07:24 +0000 (05:07 +0000)]
Perform IDNA encoding on parameters for setHostAndPort and setHost
https://bugs.webkit.org/show_bug.cgi?id=158371
<rdar://problem/16869342>

Patch by John Wilander <wilander@apple.com> on 2016-06-08
Reviewed by Brent Fulgham.

Source/WebCore:

Tests: fast/dom/set-document-location-host-to-unaccepted-values.html
       fast/dom/set-document-location-hostname-to-unaccepted-values.html
       http/tests/dom/set-document-location-host-to-accepted-values.html
       http/tests/dom/set-document-location-hostname-to-accepted-values.html

* platform/URL.cpp:
(WebCore::containsOnlyASCII):
    Moved up to enable usage in URL::setHost and URL::setHostAndPort.
(WebCore::appendEncodedHostname):
    Moved up to enable usage in URL::setHost and URL::setHostAndPort.
(WebCore::URL::setHost):
    Now disallows the colon character, does IDNA encoding, and uses StringBuilder.
(WebCore::URL::setHostAndPort):
    Now disallows multiple colons, disallows non-numeric ports, disallows the empty
    string, does IDNA encoding, and uses StringBuilder.

LayoutTests:

* fast/dom/resources/set-document-location-iframe.html: Added.
* fast/dom/set-document-location-host-to-unaccepted-values-expected.txt: Added.
* fast/dom/set-document-location-host-to-unaccepted-values.html: Added.
* fast/dom/set-document-location-hostname-to-unaccepted-values-expected.txt: Added.
* fast/dom/set-document-location-hostname-to-unaccepted-values.html: Added.
* http/tests/dom/resources/set-document-location-iframe.html: Added.
* http/tests/dom/set-document-location-host-to-accepted-values-expected.txt: Added.
* http/tests/dom/set-document-location-host-to-accepted-values.html: Added.
* http/tests/dom/set-document-location-hostname-to-accepted-values-expected.txt: Added.
* http/tests/dom/set-document-location-hostname-to-accepted-values.html: Added.

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

3 years agoTry to fix the EFL build.
hs85.jeong@samsung.com [Thu, 9 Jun 2016 02:41:01 +0000 (02:41 +0000)]
Try to fix the EFL build.

Unreviewed.

* TestWebKitAPI/CMakeLists.txt:

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

3 years agoChange thresholdForOptimizeSoon to match thresholdForOptimizeAfterWarmUp
benjamin@webkit.org [Thu, 9 Jun 2016 02:05:26 +0000 (02:05 +0000)]
Change thresholdForOptimizeSoon to match thresholdForOptimizeAfterWarmUp

Unreviewed.

This adds back the assertion removed in r201845.
Making those threshold equal is completely perf neutral
(on Haswell rMBP with 20 runs).

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-08

* runtime/Options.cpp:
(JSC::Options::initialize):
* runtime/Options.h:

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

3 years ago Fix WinCairo build
achristensen@apple.com [Thu, 9 Jun 2016 01:00:57 +0000 (01:00 +0000)]
   Fix WinCairo build

* DumpRenderTree/cairo/PixelDumpSupportCairo.h:

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

3 years agoFix WinCairo build.
achristensen@apple.com [Thu, 9 Jun 2016 00:49:38 +0000 (00:49 +0000)]
Fix WinCairo build.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::didReceiveResponse):

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

3 years agoTempory fix for the debug bots
benjamin@webkit.org [Thu, 9 Jun 2016 00:41:28 +0000 (00:41 +0000)]
Tempory fix for the debug bots

Unreviewed.

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-08

* runtime/Options.cpp:
(JSC::Options::initialize):
Weaken an assertion while I test values for thresholdForOptimizeSoon.

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

3 years agoSource/WebCore:
achristensen@apple.com [Wed, 8 Jun 2016 23:19:34 +0000 (23:19 +0000)]
Source/WebCore:
Fix WinCairo build.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::didReceiveResponse):

Tools:
Fix WinCairo build

* DumpRenderTree/cairo/PixelDumpSupportCairo.h:
(BitmapContext::createByAdoptingBitmapAndContext):
(BitmapContext::~BitmapContext):

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

3 years agoWeb Inspector: an error is encountered when trying to delete nodes that have children
bburg@apple.com [Wed, 8 Jun 2016 23:17:11 +0000 (23:17 +0000)]
Web Inspector: an error is encountered when trying to delete nodes that have children
https://bugs.webkit.org/show_bug.cgi?id=158541
<rdar://problem/26705901>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.adjustCollapsedRange):
Offset into the array variable instead of a variable holding its length.

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

3 years agoRebaseline js/dom/global-constructors-attributes.html for Mac after r201810
ryanhaddad@apple.com [Wed, 8 Jun 2016 23:11:23 +0000 (23:11 +0000)]
Rebaseline js/dom/global-constructors-attributes.html for Mac after r201810

Unreviewed test gardening.

* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

3 years agoWith audio user gesture restriction in place, video.src = 'file', video.play() succee...
jer.noble@apple.com [Wed, 8 Jun 2016 23:09:44 +0000 (23:09 +0000)]
With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
https://bugs.webkit.org/show_bug.cgi?id=158546

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-playback-restriction-play-before-load.html

Don't check that the media element isPlaying(); that will only return true if playback has begun.
Instead, check !paused(), as that will be true as soon as the play() method returns.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):
* rendering/RenderLayer.h:

LayoutTests:

* media/video-playback-restriction-play-before-load-expected.txt: Added.
* media/video-playback-restriction-play-before-load.html: Added.

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

3 years agoWeb Inspector: DOMTreeOutline selection areas should be created and updated lazily
bburg@apple.com [Wed, 8 Jun 2016 23:04:11 +0000 (23:04 +0000)]
Web Inspector: DOMTreeOutline selection areas should be created and updated lazily
https://bugs.webkit.org/show_bug.cgi?id=158513
<rdar://problem/26689646>

Reviewed by Timothy Hatcher.

Selection areas for DOMTreeElements are used for several things: drag markers,
element hover styles, element selection styles, and showing forced pseudo states
for an element. Fortunately it's easy to tell when any of these things is necessary.

Change DOMTreeOutline and DOMTreeElement so they don't create selection areas
unless they are needed for one of these tasks. This significantly reduces
forced layouts that are required to update the selection area height in case the
element has new attributes that cause the tag to become more or less wrapped.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.set hovered):
Modernize this method a bit.

(WebInspector.DOMTreeElement.prototype.updateSelectionArea):
If a selection area is not necessary, don't create one.
If one exists and it's not needed, then remove it.

(WebInspector.DOMTreeElement.prototype.onattach):
Remove redundant calls to updateSelection(). This is already called in
updateTitle().

(WebInspector.DOMTreeElement.prototype.onselect):
Ask the DOMTreeOutline to update the selection rather than forcing the
element to do it. This is consistent with other updates to user selection.

(WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
(WebInspector.DOMTreeElement.prototype._startEditingAsHTML.dispose):
(WebInspector.DOMTreeElement.prototype._startEditingAsHTML):
Use renamed method.

(WebInspector.DOMTreeElement.prototype.updateTitle):
Add a comment to explain why the selection area is nulled out here.

(WebInspector.DOMTreeElement.prototype.get pseudoClassesEnabled):
(WebInspector.DOMTreeElement.prototype._nodePseudoClassesDidChange):
Update the selection area in case one does not exist for this tree element.
The indicator for forced pseudo classes is a pseudo element of the selection area.

(WebInspector.DOMTreeElement.prototype.updateSelection): Renamed.
(WebInspector.DOMTreeElement.prototype.onexpand):
(WebInspector.DOMTreeElement.prototype.oncollapse):
Remove redundant calls to updateSelection(). This is already called in
updateTitle().

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li.hovered:not(.selected) .selection-area):
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li.selected .selection-area):
(.tree-outline.dom li.elements-drag-over .selection-area):
(.tree-outline.dom:focus li.selected .selection-area):
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
(.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection-area::before):
(.tree-outline.dom li.hovered:not(.selected) .selection): Deleted.
(.tree-outline.dom li .selection): Deleted.
(.tree-outline.dom li.selected .selection): Deleted.
(.tree-outline.dom li.elements-drag-over .selection): Deleted.
(.tree-outline.dom:focus li.selected .selection): Deleted.
(.tree-outline.dom li.pseudo-class-enabled > .selection::before): Deleted.
(.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection::before): Deleted.
Rename the selector to be less ambiguous.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype.updateSelection): Simplify. The call
to update the selection area will bail out if there is nothing to be done.

(WebInspector.DOMTreeOutline.prototype.findTreeElement):
(WebInspector.DOMTreeOutline.prototype._onmousemove):
(WebInspector.DOMTreeOutline.prototype._onmouseout):
Clean up and use let and arrow functions.

(WebInspector.DOMTreeOutline.prototype._ondragover):
(WebInspector.DOMTreeOutline.prototype._clearDragOverTreeElementMarker):
Clear the dragging element before updating the selection area since it looks at
the dragging element to determine whether anything needs to be done.

* UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom li.hovered:not(.selected) .selection-area):
(.formatted-node > .tree-outline.dom li.hovered:not(.selected) .selection): Deleted.
Rename the selector to be less ambiguous.

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

3 years agoUncaught Exception in TimelineDataGrid._updatePopoverForSelectedNode()
bburg@apple.com [Wed, 8 Jun 2016 23:02:39 +0000 (23:02 +0000)]
Uncaught Exception in TimelineDataGrid._updatePopoverForSelectedNode()
https://bugs.webkit.org/show_bug.cgi?id=158502
<rdar://problem/26687038>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):
It appears that this expression was moved around since it accesses
targetFrame before it's initialized. Check rect.size.height directly.

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

3 years ago_web_didAddMediaControlsManager should take a controlsManager as a parameter
bdakin@apple.com [Wed, 8 Jun 2016 22:35:09 +0000 (22:35 +0000)]
_web_didAddMediaControlsManager should take a controlsManager as a parameter
https://bugs.webkit.org/show_bug.cgi?id=158545

Reviewed by Tim Horton.

* UIProcess/Cocoa/WebViewImpl.h:

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

3 years agoModernize WebSocket code
achristensen@apple.com [Wed, 8 Jun 2016 22:27:46 +0000 (22:27 +0000)]
Modernize WebSocket code
https://bugs.webkit.org/show_bug.cgi?id=158539

Reviewed by Brady Eidson.

No new tests, no change in behavior.

* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create):
* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
(WebCore::ThreadableWebSocketChannelClientWrapper::create):
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::WebSocketChannel):
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::create):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
(WebCore::WorkerThreadableWebSocketChannel::subprotocol):
(WebCore::WorkerThreadableWebSocketChannel::extensions):
(WebCore::WorkerThreadableWebSocketChannel::resume):
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
(WebCore::WorkerThreadableWebSocketChannel::Peer::send):
(WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::~Bridge):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
(WebCore::WorkerThreadableWebSocketChannel::create):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::create):

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

3 years ago[JSC] Change some parameters based on a random search
commit-queue@webkit.org [Wed, 8 Jun 2016 22:22:49 +0000 (22:22 +0000)]
[JSC] Change some parameters based on a random search
https://bugs.webkit.org/show_bug.cgi?id=158514

Source/JavaScriptCore:

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-08
Reviewed by Filip Pizlo.

Over the weekend, I left an iMac running the JSC benchmarks
while changing a bunch of parameters.

The parameters were changed randomly, with a random deviation
from the original value.
To converge toward good values, the range was subject
to exponential annealing over time.

The values in this patch is the best outcome my iMac could
find over the weekend. It is about 1% better on the Haswell
machines I tested.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::optimizationThresholdScalingFactor):
* runtime/Options.h:

Tools:

Patch by Benjamin Poulain <benjamin@webkit.org> on 2016-06-08
Reviewed by Filip Pizlo.

* Scripts/run-jsc-stress-tests:

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

3 years agoFirst parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should...
cdumez@apple.com [Wed, 8 Jun 2016 22:14:55 +0000 (22:14 +0000)]
First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=158540

Reviewed by Geoffrey Garen.

Source/WebCore:

First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory:
- https://html.spec.whatwg.org/multipage/comms.html#messageport
- https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface

Previously, WebKit send a bogus MessageEvent whose data attribute is undefined. This would
cause a testharness error when running the following W3C test:
- http://w3c-test.org/workers/interfaces.worker

Firefox and Chrome already correctly throw in this case. Our Window.postMessage() API is also
already throwing in this case.

Test: fast/workers/postMessage-missing-parameter.html

* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):

LayoutTests:

Add test coverage.

* fast/files/workers/inline-worker-via-blob-url.html:
* fast/workers/postMessage-missing-parameter-expected.txt: Added.
* fast/workers/postMessage-missing-parameter.html: Added.
* fast/workers/worker-messageport-expected.txt:
* fast/workers/worker-messageport.html:

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

3 years agoRemove removeDirect
barraclough@apple.com [Wed, 8 Jun 2016 21:49:32 +0000 (21:49 +0000)]
Remove removeDirect
https://bugs.webkit.org/show_bug.cgi?id=158516

Reviewed by Ryosuke Niwa.

removeDirect is typically used as a subroutine of deleteProperty, but is also available to
call directly. Having this functionality factored out to a separate routine is a bad idea
on a couple of fronts:

- for the main use within deleteProperty there is redundancy (presence of the property
  was being checked twice) and inconsistency (the two functions returned different results
  in the case of a nonexistent property; the result from removeDirect was never observed).

- all uses of removeDirect are in practical terms incorrect. removeDirect had the
  advantage of ignoring the configurable (DontDelete) attributes, but this is achievable
  using the DeletePropertyMode setting - and the disadvantage of failing delete static
  table properties. Last uses were one that was removed in bug #158295 (where failure to
  delete static properties was a problem), and as addressed in this patch removeDirect is
  being used to implement runtime enabled features. This only works because we currently
  force reification of all properties on the DOM prototype objects, so in effect there are
  no static properties. In order to make the code robust such that runtime enabled
  features would still work even if we were not reifying static properties (a change we
  may want to make) we should be calling deleteProperty in this case too.

Source/JavaScriptCore:

* runtime/JSObject.cpp:
(JSC::JSObject::deleteProperty):
    - incorporated removeDirect functionality, added comments & ASSERT.
(JSC::JSObject::removeDirect): Deleted.
    - removed.
* runtime/JSObject.h:
    - removed removeDirect.

Source/WebCore:

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
    - changed to call deleteProperty instead of removeDirect.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
    - updated bindings test results.

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

3 years agoWeb Inspector: reduce redundant attribute modification updates in DOMTreeUpdater...
bburg@apple.com [Wed, 8 Jun 2016 21:17:54 +0000 (21:17 +0000)]
Web Inspector: reduce redundant attribute modification updates in DOMTreeUpdater and DOMTreeElement
https://bugs.webkit.org/show_bug.cgi?id=158504
<rdar://problem/25561452>

Reviewed by Timothy Hatcher.

When the frontend gets lots of DOM.attributeModified events, it forwards these on to
DOMTreeUpdater, which pushes a record for every single modification. It then updates
the DOM elements with the attibute changes on an animation frame. However, since it
doesn't do any deduplication of the modification records, a lot of time is wasted
on updating DOMTreeElements with intermediate (non-final) attribute values.

This patch rewrites DOMTreeUpdater to precisely track which nodes and attributes
of each node need to be updated on the next animation frame. This is done using
Sets and Maps that only hold onto the most recent attribute values rather than
pushing a record object for every single mutation.

This improves the performance of the Elements tab on an SVG particle simulator
dramatically so that the Inspector will not immediately hang. It still only achieves
a few updates per second in this case, so there is still optimization to be done on
the frontend and throttling to be done on the backend.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement):
(WebInspector.DOMTreeElement.prototype.attributeDidChange):
(WebInspector.DOMTreeElement.prototype._buildAttributeDOM):
(WebInspector.DOMTreeElement.prototype._markNodeChanged):
(WebInspector.DOMTreeElement.prototype._nodeChangedAnimationEnd):
(WebInspector.DOMTreeElement.prototype._fireDidChange):
(WebInspector.DOMTreeElement.prototype.nodeStateChanged): Deleted.
Simplify the list of modified attributes a little bit. This still uses a worklist
approach, so it's possible that duplicate updates for the same attribute could accumulate
if DOMTreeUpdater pushes updates faster than DOMTreeElement can render them.

* UserInterface/Views/DOMTreeUpdater.js:
(WebInspector.DOMTreeUpdater):
(WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
(WebInspector.DOMTreeUpdater.prototype._characterDataModified):
(WebInspector.DOMTreeUpdater.prototype._nodeAttributeModified):
(WebInspector.DOMTreeUpdater.prototype._nodeInserted):
(WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
(WebInspector.DOMTreeUpdater.prototype._childNodeCountUpdated):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
(WebInspector.DOMTreeUpdater.prototype._reset):
Rewrite this class to separately track insertions, deletions, and modifications. Use
Sets and Maps so redundant entries are not kept around. Split the main work loop
and use fewer enum-like properties to control how each DOM element change is handled.

Attempt to update all inserted children before modifying their attributes. This
wasn't done previously, but enough duplicate attribute modifications occurred that
usually some of them would be processed after being added to the tree. There is only
one chance to do this now.

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

3 years agoFor keyboard users, activating a fragment URL should transfer focus and caret to...
n_wang@apple.com [Wed, 8 Jun 2016 21:15:09 +0000 (21:15 +0000)]
For keyboard users, activating a fragment URL should transfer focus and caret to the destination
https://bugs.webkit.org/show_bug.cgi?id=116046

Reviewed by Ryosuke Niwa.

Source/WebCore:

Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
and there is no focused element, we start searching for next focus candidates at the sequential
focus navigation node.
Spec: https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point

Test: fast/events/sequential-focus-navigation-starting-point.html

* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::destroyRenderTree):
(WebCore::Document::styleResolverChanged):
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::hoveredElementDidDetach):
(WebCore::Document::setFocusedElement):
(WebCore::shouldResetFocusNavigationStartingNode):
(WebCore::Document::setFocusNavigationStartingNode):
(WebCore::Document::focusNavigationStartingNode):
(WebCore::Document::setCSSTarget):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
(WebCore::Document::removeFocusNavigationNodeOfSubtree):
(WebCore::Document::textInserted):
* dom/Document.h:
(WebCore::Document::userActionElements):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
* page/FrameView.cpp:
(WebCore::FrameView::scrollToAnchor):

LayoutTests:

Added a layout test to check that mouse pressing, fragment navigation, focusing an element and removing
the focused element will give us the expected focus navigation starting point.

Also updated the fragment activation test because now that navigating to an unfocusable fragment will
unfocus the current focused element.

* fast/dom/fragment-activation-focuses-target-expected.txt:
* fast/dom/fragment-activation-focuses-target.html:
* fast/events/sequential-focus-navigation-starting-point-expected.txt: Added.
* fast/events/sequential-focus-navigation-starting-point.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoHTMLMediaElement.prototype.canPlayType accounting for 250-750ms first loading theverg...
eric.carlson@apple.com [Wed, 8 Jun 2016 21:07:42 +0000 (21:07 +0000)]
HTMLMediaElement.prototype.canPlayType accounting for 250-750ms first loading theverge.com
https://bugs.webkit.org/show_bug.cgi?id=158335
<rdar://problem/26615416>

Reviewed by Brent Fulgham.

* WebCore.xcodeproj/project.pbxproj: Add AVFoundationMIMETypeCache.

* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h: Added.
* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: Added.
(WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache):
(WebCore::AVFoundationMIMETypeCache::loadTypes):
(WebCore::AVFoundationMIMETypeCache::types):
(WebCore::AVFoundationMIMETypeCache::singleton):

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Start MIME type loading.
(WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Use AVFoundationMIMETypeCache.
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
(WebCore::avfMIMETypes): Deleted.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Start MIME type loading.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Use AVFoundationMIMETypeCache.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Ditto.
(WebCore::mimeTypeCache): Deleted.

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

3 years agoSimplify Interpreter::StackFrame.
mark.lam@apple.com [Wed, 8 Jun 2016 20:59:49 +0000 (20:59 +0000)]
Simplify Interpreter::StackFrame.
https://bugs.webkit.org/show_bug.cgi?id=158498

Reviewed by Saam Barati.

Previously, Interpreter::StackFrame (which is used to capture info for
Error.stack) eagerly extracts info out of CodeBlock and duplicates the work that
CodeBlock does to compute line and column numbers (amongst other things).

This patch does away with the eager extraction and only stashes the CodeBlock
pointer in the Interpreter::StackFrame.  Instead, Interpreter::StackFrame will
provide methods for computing the desired values on request later.

One difference in implementation: the old StackFrame offers a sourceURL and a
friendlySourceURL().  The only difference between the 2 is that for native
functions, sourceURL returns an empty string, and friendlySourceURL() returns
"[native code]".  This is how it affects the clients of StackFrame:

    - In the old code, the Error object's addErrorInfoAndGetBytecodeOffset() and
      the inspector's createScriptCallStackFromException() would check if
      sourceURL is empty.  If so, they will use this as an indicator to use
      alternate source info in the Error object e.g. url and line numbers from
      the parser that produced a SyntaxError.

    - In the new implementation, StackFrame only has a sourceURL() function that
      behaves like the old friendlySourceURL().  The client code which were
      relying on sourceURL being empty, will now explicitly check if the
      StackFrame is for native code using a new isNative() query in addition to
      the sourceURL being empty.  This achieve functional parity with the old
      behavior.

Also fix Error.cpp's addErrorInfoAndGetBytecodeOffset() to take a bytecodeOffset
pointer instead of a reference.  The bytecodeOffset arg is supposed to be
optional, but was implemented in a unclear way.  This change clarifies it.

* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStackFromException):
* interpreter/Interpreter.cpp:
(JSC::StackFrame::sourceID):
(JSC::StackFrame::sourceURL):
(JSC::StackFrame::functionName):
(JSC::eval):
(JSC::Interpreter::isOpcode):
(JSC::StackFrame::computeLineAndColumn):
(JSC::StackFrame::toString):
(JSC::GetStackTraceFunctor::operator()):
(JSC::StackFrame::friendlySourceURL): Deleted.
(JSC::StackFrame::friendlyFunctionName): Deleted.
(JSC::getStackFrameCodeType): Deleted.
(JSC::StackFrame::expressionInfo): Deleted.
* interpreter/Interpreter.h:
(JSC::StackFrame::isNative):
* runtime/Error.cpp:
(JSC::addErrorInfoAndGetBytecodeOffset):
(JSC::addErrorInfo):
* runtime/Error.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::finishCreation):

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

3 years agoREGRESSION (r158219): Web Inspector: Border under the default Timeline content view...
nvasilyev@apple.com [Wed, 8 Jun 2016 20:56:11 +0000 (20:56 +0000)]
REGRESSION (r158219): Web Inspector: Border under the default Timeline content view is too thick
https://bugs.webkit.org/show_bug.cgi?id=158533

Reviewed by Timothy Hatcher.

* UserInterface/Views/OverviewTimelineView.css:
(.timeline-view.overview > .data-grid th): Deleted.

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

3 years agosync-buildbot.js should update the list of tests and platforms associated with a...
rniwa@webkit.org [Wed, 8 Jun 2016 20:43:01 +0000 (20:43 +0000)]
sync-buildbot.js should update the list of tests and platforms associated with a triggerable
https://bugs.webkit.org/show_bug.cgi?id=158406

Reviewed by Chris Dumez.

Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
but for which I forgot to run svn add.

* public/api/update-triggerable.php: Added.
(main):
* server-tests/api-update-triggerable.js: Added.

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

3 years agoWeb Inspector: Command-W should not close Web Inspector tabs; it should close the...
timothy@apple.com [Wed, 8 Jun 2016 20:21:40 +0000 (20:21 +0000)]
Web Inspector: Command-W should not close Web Inspector tabs; it should close the window
https://bugs.webkit.org/show_bug.cgi?id=158538
rdar://problem/26699215

Reviewed by Brian Burg.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser): Change shortcut to Command-Shift-W.

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

3 years agoImport new AddEventListenerOptions test from W3C web-platform-tests
cdumez@apple.com [Wed, 8 Jun 2016 19:50:20 +0000 (19:50 +0000)]
Import new AddEventListenerOptions test from W3C web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=158535

Reviewed by Ryosuke Niwa.

Import new AddEventListenerOptions test from W3C web-platform-tests.

* web-platform-tests/dom/events/AddEventListenerOptions-passive-expected.txt: Added.
* web-platform-tests/dom/events/AddEventListenerOptions-passive.html: Added.
* web-platform-tests/dom/events/EventListenerOptions-capture.html:

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

3 years agoWe should be able to lookup symbols by identifier in builtins
keith_miller@apple.com [Wed, 8 Jun 2016 19:40:34 +0000 (19:40 +0000)]
We should be able to lookup symbols by identifier in builtins
https://bugs.webkit.org/show_bug.cgi?id=158530

Reviewed by Mark Lam.

This patch allows us to lookup the value of a symbol property on a
object by identifier in builtins. Before, it was only possible to
do so if we were directly emitting the bytecodes, such as in a
for-of loop looking for Symbol.iterator. As we tier up we convert
the builtin's get_by_val symbol lookups into get_by_id
lookups. However, there is still a significant performance
difference between get_by_id and get_by_val in the LLInt, where
this transformation does not take place.

In order to make this work we hijack BuiltinNames'
m_publicToPrivateMap so that it points the @<symbol>Symbol to the
appropriate vm symbol. This way when we lex the identifier it will
become the appropriate symbol's identifier.  Currently, if the
symbol is used to name a property in an object literal we will not
keep a cache of the Symbol objects we have already seen. We could
add a map for symbols but since we can only load symbols by
identifier in builtins its likely not worth it. Additionally, even
in builtins it is extremely rare to use Symbols in object
literals.

* builtins/ArrayConstructor.js:
(from):
* builtins/ArrayPrototype.js:
(filter):
(map):
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames):
* builtins/BuiltinUtils.h:
* builtins/GlobalObject.js:
(speciesConstructor):
* builtins/StringPrototype.js:
(match):
(intrinsic.StringPrototypeReplaceIntrinsic.replace):
(search):
(split):
* builtins/TypedArrayConstructor.js:
(from):
* builtins/TypedArrayPrototype.js:
(map):
(filter):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): Deleted.
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):

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

3 years agoVersioning.
bshafiei@apple.com [Wed, 8 Jun 2016 19:20:52 +0000 (19:20 +0000)]
Versioning.

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

3 years agoREGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(...
rniwa@webkit.org [Wed, 8 Jun 2016 19:19:22 +0000 (19:19 +0000)]
REGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
https://bugs.webkit.org/show_bug.cgi?id=158373
Source/WebCore:

<rdar://problem/26690795>

Reviewed by Brent Fulgham.

The bug was caused by VisibleSelection::toNormalizedRange calling parentAnchoredEquivalent on an orphaned Position.
Fixed it by checking that condition and exiting early since we can't create a Range with a detached node anyway.

Also renamed isNonOrphanedCaretOrRange to isNoneOrOrphaned after negating the semantics for clarity.

Test: editing/selection/selection-in-iframe-removed-crash.html

* editing/EditorCommand.cpp:
(WebCore::valueFormatBlock):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/RemoveFormatCommand.cpp:
(WebCore::RemoveFormatCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SetSelectionCommand.cpp:
(WebCore::SetSelectionCommand::doApply):
(WebCore::SetSelectionCommand::doUnapply):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::doApply):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::firstRange): Also added a check for isNoneOrOrphaned since this function can hit the same
assertion when the selection end points are orphaned.
(WebCore::VisibleSelection::toNormalizedRange): Fixed the bug.
* editing/VisibleSelection.h:
(WebCore::VisibleSelection::isNoneOrOrphaned): Renamed from isNonOrphanedCaretOrRange and negated the semantics.

LayoutTests:

Reviewed by Brent Fulgham.

Fixed a test so that the assertion failure happens within the test instead of affecting the subsequent test.

* editing/selection/selection-in-iframe-removed-crash-expected.txt:
* editing/selection/selection-in-iframe-removed-crash.html:

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

3 years agotests fail if display sleeps while run-webkit-tests is running
aakash_jain@apple.com [Wed, 8 Jun 2016 19:17:52 +0000 (19:17 +0000)]
tests fail if display sleeps while run-webkit-tests is running
https://bugs.webkit.org/show_bug.cgi?id=153919

Reviewed by Alexey Proskuryakov.

* DumpRenderTree/mac/LayoutTestHelper.m:
(releaseSleepAssertions): Release both Display sleep and System sleep assertions.
(addSleepAssertions): Add sleep assertion for both Display sleep and System sleep.

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

3 years agoMarking css3/filters/backdrop/dynamic-backdrop-filter-change.html as flaky on Mac
ryanhaddad@apple.com [Wed, 8 Jun 2016 18:52:37 +0000 (18:52 +0000)]
Marking css3/filters/backdrop/dynamic-backdrop-filter-change.html as flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=158534

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoReverted changeset 201814.
lforschler@apple.com [Wed, 8 Jun 2016 18:47:42 +0000 (18:47 +0000)]
Reverted changeset 201814.

* Scripts/copy-webkitlibraries-to-product-directory:

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

3 years agoMultiple selectors break keyframes animation
dino@apple.com [Wed, 8 Jun 2016 18:46:43 +0000 (18:46 +0000)]
Multiple selectors break keyframes animation
https://bugs.webkit.org/show_bug.cgi?id=158199
<rdar://problem/26652591>

Reviewed by Simon Fraser.

Source/WebCore:

If we came across a duplicate key entry in a keyframe, we
were replacing the existing entry, instead of merging.

Test: animations/duplicate-keys.html

* css/CSSKeyframeRule.h:
(WebCore::StyleKeyframe::setKey): Add a way to set the key of a rule
as a number, rather than going through a string and the CSS parser.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::keyframeStylesForAnimation): Check if the rule
has duplicates, and if it does, merge all the common entries.
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::insert): Now that we've removed duplicates at
the processing time, we should never come across a duplicate while
building this list.

LayoutTests:

* animations/duplicate-keys-expected.html: Added.
* animations/duplicate-keys.html: Added.

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

3 years ago[Win] Shadow DOM tests are failing.
peavo@outlook.com [Wed, 8 Jun 2016 18:45:47 +0000 (18:45 +0000)]
[Win] Shadow DOM tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=158524

Reviewed by Brent Fulgham.

.:

Enable Shadow DOM.

* Source/cmake/OptionsWin.cmake:

Source/WebKit/win:

Add preference for enabling Shadow DOM.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::shadowDOMEnabled):
(WebPreferences::setShadowDOMEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Enable Shadow DOM when running tests.

* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):

LayoutTests:

Update test expectations for Shadow DOM.

* platform/win/TestExpectations:

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

3 years agoRebaseline bindings tests after r201808
ryanhaddad@apple.com [Wed, 8 Jun 2016 18:45:22 +0000 (18:45 +0000)]
Rebaseline bindings tests after r201808

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.h:

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

3 years agoTeach cmake about libWebKitSystemInterfaceOSX10.12
lforschler@apple.com [Wed, 8 Jun 2016 18:37:13 +0000 (18:37 +0000)]
Teach cmake about libWebKitSystemInterfaceOSX10.12
Source/WebCore:

Rubber-stamped by Matt Hanson and Alex Christensen.

* PlatformMac.cmake:

Tools:

This patch also removes duplicated logic inside DumpRenderTree/PlatformMac.cmake

Rubber-stamped by Alex Christensen.

* DumpRenderTree/PlatformMac.cmake:
* WebKitTestRunner/PlatformMac.cmake:

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

3 years ago<rdar://problem/26685782>
lforschler@apple.com [Wed, 8 Jun 2016 18:25:39 +0000 (18:25 +0000)]
<rdar://problem/26685782>
Teach the copy-webkitlibraries-to-product-directory script about WebKitSystemInterfaceOSX10.12

Rubber-stamped by Jessie Berlin.

* Scripts/copy-webkitlibraries-to-product-directory:

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

3 years agoUse more ES6 features in JSAir
fpizlo@apple.com [Wed, 8 Jun 2016 18:13:20 +0000 (18:13 +0000)]
Use more ES6 features in JSAir
https://bugs.webkit.org/show_bug.cgi?id=158497

Reviewed by Keith Miller.

This improves JSAir with the following ES6 features suggested by JoePeck:

- String interpolation.
- Destructuring inside PatchCustom.
- Default arguments.

All of these things are on hot paths.

Note that I didn't use string interpolation everywhere that I could, only in those places
where it made the code more readable. In Ruby, I used the style that if the interpolation
expression has any non-trivial stuff (like a ternary operator, a chain of calls, or embedded
strings) then it's better to use regular strcat. I think that's what I carried over to here.

Note that the previous change (Add result validation to JSAir) also made the Proxy code not
dead, though it's not necessarily on the hot path. The Proxy isn't called into frequently
but it's used from a function that is otherwise hot, so if calling into the Proxy prevents
that function from being optimized then it will hurt so good.

I also reenabled tail calls in a few places.

This change doesn't seem to change the performance of the benchmark for us. That's expected
since these ES6 features are cheap. Note that this claim doesn't include Proxy, which was
added in a separate change and that change did make the benchmark overall more expensive.

* JSAir/allocate_stack.js:
(allocateStack):
* JSAir/arg.js:
(Arg.createBitImm64):
(Arg.createAddr):
(Arg.createStack):
(Arg.logScale):
(Arg.createIndex):
* JSAir/basic_block.js:
(BasicBlock.get headerString):
(BasicBlock.prototype.get if):
(BasicBlock):
* JSAir/benchmark.js:
(benchmark):
* JSAir/code.js:
(Code):
(Code.prototype.addBlock):
(Code.prototype.addStackSlot):
(Code.prototype.newTmp):
(Code.prototype.get size):
(Code.prototype.get blocks):
(Code.prototype.get stackSlots):
(Code.prototype.tmps):
(Code.prototype.get callArgAreaSize):
(Code.prototype.toString):
* JSAir/custom.js:
(const.PatchCustom.forEachArg):
* JSAir/inst.js:
(Inst):
* JSAir/reg.js:
(Reg.prototype.toString):
* JSAir/util.js:
(symbolName):
(lowerSymbolName):

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

3 years agoDon't try to cleanup non-existing ios Simulators
aakash_jain@apple.com [Wed, 8 Jun 2016 18:03:08 +0000 (18:03 +0000)]
Don't try to cleanup non-existing ios Simulators
https://bugs.webkit.org/show_bug.cgi?id=158510

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.clean_up_test_run):
Check if simulator exists before trying to clean it up.

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

3 years agoTry to fix the Windows build.
beidson@apple.com [Wed, 8 Jun 2016 17:46:06 +0000 (17:46 +0000)]
Try to fix the Windows build.

Unreviewed.

* TestWebKitAPI/Tests/WTF/CrossThreadTask.cpp:
(TestWebKitAPI::LifetimeLogger::log):
(TestWebKitAPI::LifetimeLogger::takeLogStr):
(TestWebKitAPI::testFunction):
(TestWebKitAPI::TEST):
(TestWebKitAPI::log): Deleted. (VS was seeing it as a dupe symbol)
(TestWebKitAPI::takeLogStr): Deleted. (VS was seeing it as a dupe symbol)

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

3 years ago[web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
commit-queue@webkit.org [Wed, 8 Jun 2016 17:32:48 +0000 (17:32 +0000)]
[web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
https://bugs.webkit.org/show_bug.cgi?id=156096

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-06-08
Reviewed by Dean Jackson.

Adds:
Source/JavaScriptCore:

- Animatable interface and implementation of getAnimations in Element
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

* runtime/CommonIdentifiers.h:

Source/WebCore:

- Animatable interface and implementation of getAnimations in Element
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

Test: webanimations/Document.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/Animatable.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
* animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::setAnimation):
(WebCore::AnimationEffect::isCurrent):
(WebCore::AnimationEffect::isInEffect):
* animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
* animation/AnimationEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::destroy):
(WebCore::AnimationTimeline::attachAnimation):
(WebCore::AnimationTimeline::detachAnimation):
* animation/AnimationTimeline.h:
* animation/AnimationTimeline.idl:
* animation/DocumentAnimation.cpp:
(WebCore::DocumentAnimation::timeline):
(WebCore::DocumentAnimation::getAnimations):
(WebCore::DocumentAnimation::addAnimation):
(WebCore::DocumentAnimation::removeAnimation):
* animation/DocumentAnimation.h:
(WebCore::DocumentAnimation::getAnimations):
* animation/DocumentAnimation.idl:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::attach):
(WebCore::DocumentTimeline::detach):
* animation/DocumentTimeline.h:
* animation/DocumentTimeline.idl:
* animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::~KeyframeEffect):
* animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
* animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
* animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::~WebAnimation):
* animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
* animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
* bindings/scripts/CodeGeneratorGObject.pm:
* dom/Element.cpp:
(WebCore::Element::getAnimations):
* dom/Element.h:
* dom/Element.idl:

Source/WebKit/mac:

- Setup interface for enabling runtime flag for Web animations through preferences.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webAnimationsEnabled]):
(-[WebPreferences setWebAnimationsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

LayoutTests:

- Animatable interface and implementation of getAnimations in Element
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* webanimations/Document-expected.txt: Added.
* webanimations/Document.html: Added.
* webanimations/script-tests/Document.js: Added.

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

3 years agoMake CrossThreadCopier more efficient (fewer copies!).
beidson@apple.com [Wed, 8 Jun 2016 17:31:47 +0000 (17:31 +0000)]
Make CrossThreadCopier more efficient (fewer copies!).
https://bugs.webkit.org/show_bug.cgi?id=158456

Reviewed by Alex Christensen.

Source/WTF:

Previously, we'd run all arguments through CrossThreadCopier, then immediately make
an unnecessary copy of the result during lambda capture.

Instead, we should just put the CrossThreadCopier generated objects directly in lambdas,
which are then captured by NoncopyableFunctions.

This reduces the number of constructor calls per argument from 2 copies to 1 move.

* wtf/CrossThreadTask.h:
(WTF::CrossThreadTask::CrossThreadTask):
(WTF::createCrossThreadTask):

Tools:

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

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

3 years agoself.hasOwnProperty() does not work inside Web workers
cdumez@apple.com [Wed, 8 Jun 2016 17:31:12 +0000 (17:31 +0000)]
self.hasOwnProperty() does not work inside Web workers
https://bugs.webkit.org/show_bug.cgi?id=158446
<rdar://problem/26638397>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add a factory function to JSProxy to create a JSProxy without a target.
Also make the setTarget() method public so that the target can now be
set after creation. This is needed so that we can create a proxy for
JSWorkerGlobalScope, then create the JSWorkerGlobalScope object,
passing it the proxy and finally set the target on the proxy.

* runtime/JSProxy.h:
(JSC::JSProxy::create):

Source/WebCore:

W3C tests for workers were severely broken on WebKit because
self.hasOwnProperty() did not work inside workers. The reason is that
hasOwnProperty() (and other methods like toString()) call toThis() in
StrictMode on thisValue. However, in the case of 'self' in workers,
self was a DedicatedWorkerGlobalScope, which is a JSGlobalObject.
JSGlobalObject::toThis() returns jsUndefined() when called in strict
mode. As a result, we would end up with exceptions such as "undefined
is not an object" when calling self.hasOwnProperty() in workers.

To address the problem, this patch introduces a JSProxy whose proxy
type is PureForwardingProxyType and whose target is the
WorkerGlobalScope. This JSProxy is what we expose to the JavaScript,
instead of the JSWorkerGlobalScope itself. As a result, toThis() now
behaves as expected and self.hasOwnProperty() works inside workers.

This patch greatly improves our pass rate on several W3C tests:
http://w3c-test.org/workers/interfaces.worker: 20 passes -> 50 passes (out of 128)
http://w3c-test.org/IndexedDB/interfaces.worker 0 passes -> 145 passes (out of 156)

Tests: fast/workers/self-hasOwnProperty.html
       fast/workers/self-toString.html

* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::finishCreation):
(WebCore::JSWorkerGlobalScopeBase::visitChildren):
(WebCore::toJS):
* bindings/js/JSWorkerGlobalScopeBase.h:
(WebCore::JSWorkerGlobalScopeBase::proxy):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):

LayoutTests:

Add tests to make sure that self.toString() and self.hasOwnProperty()
now work in workers.

* fast/workers/self-hasOwnProperty-expected.txt: Added.
* fast/workers/self-hasOwnProperty.html: Added.
* fast/workers/self-toString-expected.txt: Added.
* fast/workers/self-toString.html: Added.

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

3 years agoAdd result validation to JSAir
fpizlo@apple.com [Wed, 8 Jun 2016 17:21:52 +0000 (17:21 +0000)]
Add result validation to JSAir
https://bugs.webkit.org/show_bug.cgi?id=158493

Reviewed by Saam Barati.

PerformanceTests:

This adds the ability to hash a Code in a way that matches the C++ code's hashing of Code.
This allows us to check if the Code that JSAir sees is the code that C++ saw. We use this to
check the Code before and after allocateStack, and compare against hashes we got from C++.

Doing this uncovered bugs. roundUpToMultipleOf wasn't doing anything. allocateStack was not
allocating things correctly because I was concatting a Set to an Array, which doesn't really
work. Now these bugs are fixed.

The checking step adds to the running time so I reduced the number of iterations. The
benchmark spends a decent amount of its time computing Code hashes; I think it's around 1/3
total. This is probably OK. It's better to verify the results even if the running time is
not all in the "core" of the algorithm.

Also add a run-jsc-stress-tests yaml file to allow this to run as a test.

* JSAir/allocate_stack.js:
* JSAir/arg.js:
(Arg.createImm):
(Arg.createBigImm):
(Arg.createBitImm):
(Arg.createBitImm64):
(Arg.createWidth):
(Arg.createSpecial):
(Arg.prototype.get kind):
(Arg.prototype.get isTmp):
(Arg.prototype.get isImm):
(Arg.prototype.get isSomeImm):
(Arg.prototype.get isSomeBigImm):
(Arg.prototype.get isCondition):
(Arg.prototype.get isWidth):
(Arg.prototype.get isSpecial):
(Arg.prototype.get isAlive):
(Arg.prototype.get tmp):
(Arg.prototype.get value):
(Arg.prototype.get lowValue):
(Arg.prototype.get highValue):
(Arg.prototype.get base):
(Arg.prototype.get isGP):
(Arg.prototype.get isFP):
(Arg.prototype.isValidForm):
(Arg.prototype.get isInvertible):
(Arg.kindCode):
(Arg.prototype.hash):
(Arg.prototype.toString):
(Arg):
* JSAir/basic_block.js:
(BasicBlock.get successorBlocks):
* JSAir/benchmark.js:
(benchmark):
* JSAir/code.js:
(Code.prototype.setFrameSize):
(Code.prototype.hash):
(Code.prototype.toString):
(Code):
* JSAir/inst.js:
(Inst.prototype.get hasNonArgEffects):
(Inst.prototype.hash):
(Inst.prototype.toString):
(Inst):
* JSAir/jsair-tests.yaml: Added.
* JSAir/opcode.js:
(Inst_forEachArg):
(Inst_hasNonArgEffects):
(opcodeCode):
* JSAir/payload-gbemu-executeIteration.js:
(createPayloadGbemuExecuteIteration):
* JSAir/payload-imaging-gaussian-blur-gaussianBlur.js:
(createPayloadImagingGaussianBlurGaussianBlur):
* JSAir/payload-jsair-ACLj8C.js:
(createPayloadJSAirACLj8C):
* JSAir/payload-typescript-scanIdentifier.js:
(createPayloadTypescriptScanIdentifier):
* JSAir/reg.js:
(Reg.prototype.get isReg):
(Reg.prototype.hash):
(Reg.prototype.toString):
* JSAir/stack_slot.js:
(StackSlot.prototype.setOffsetFromFP):
(StackSlot.prototype.hash):
(StackSlot.prototype.toString):
* JSAir/symbols.js:
(relCondCode):
(resCondCode):
(doubleCondCode):
* JSAir/test.html:
* JSAir/tmp.js:
(Tmp.prototype.get isReg):
(Tmp.prototype.hash):
(Tmp.prototype.toString):
* JSAir/util.js:
(roundUpToMultipleOf):
(symbolName):

Source/JavaScriptCore:

Add a ::jsHash() method to some things, to compute a hash code that is suitable for
comparing a C++ Code to a JSAir Code. This is different from existing hashing functionality
because it errs on the side of easy reproducibility from JS rather than speed.

* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::isCompatibleType):
(JSC::B3::Air::Arg::jsHash):
(JSC::B3::Air::Arg::dump):
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::asDoubleCondition):
(JSC::B3::Air::Arg::isInvertible):
(JSC::B3::Air::Arg::isUnsignedCond):
(JSC::B3::Air::Arg::Arg):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::addFastTmp):
(JSC::B3::Air::Code::jsHash):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::lastPhaseName):
* b3/air/AirDumpAsJS.cpp:
(JSC::B3::Air::dumpAsJS):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirInst.cpp:
(JSC::B3::Air::Inst::hasArgEffects):
(JSC::B3::Air::Inst::jsHash):
(JSC::B3::Air::Inst::dump):
* b3/air/AirInst.h:
* b3/air/AirStackSlot.cpp:
(JSC::B3::Air::StackSlot::setOffsetFromFP):
(JSC::B3::Air::StackSlot::jsHash):
(JSC::B3::Air::StackSlot::dump):
* b3/air/AirStackSlot.h:
* b3/air/opcode_generator.rb:

Tools:

Run JSAir.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):

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

3 years agoAdd an API test that confirms object constructor/destructor calls during creation...
beidson@apple.com [Wed, 8 Jun 2016 16:48:28 +0000 (16:48 +0000)]
Add an API test that confirms object constructor/destructor calls during creation of a CrossThreadTask.
https://bugs.webkit.org/show_bug.cgi?id=158528

Reviewed by Alex Christensen.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/CrossThreadTask.cpp: Added.
(TestWebKitAPI::log):
(TestWebKitAPI::takeLogStr):
(TestWebKitAPI::LifetimeLogger::LifetimeLogger):
(TestWebKitAPI::LifetimeLogger::~LifetimeLogger):
(TestWebKitAPI::LifetimeLogger::isolatedCopy):
(TestWebKitAPI::testFunction):
(TestWebKitAPI::TEST):

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

3 years agoWebKit memory cache doesn't respect Vary header
antti@apple.com [Wed, 8 Jun 2016 13:37:04 +0000 (13:37 +0000)]
WebKit memory cache doesn't respect Vary header
https://bugs.webkit.org/show_bug.cgi?id=71509
<rdar://problem/26651033>

Reviewed by Sam Weinig.

Source/WebCore:

Implement Vary header support in WebCore memory cache.

The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
verify the headers for CachedResources.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::failBeforeStarting):
(WebCore::addAdditionalRequestHeadersToRequest):

    Factor into standalone function so we can use it from varyHeaderValuesMatch.

(WebCore::CachedResource::addAdditionalRequestHeaders):
(WebCore::CachedResource::load):
(WebCore::CachedResource::setResponse):

    Collect the Vary header values when we receive a response.

(WebCore::CachedResource::responseReceived):
(WebCore::CachedResource::redirectChainAllowsReuse):
(WebCore::CachedResource::varyHeaderValuesMatch):

    Test for Vary match.

(WebCore::CachedResource::overheadSize):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isCacheValidator):
(WebCore::CachedResource::resourceToRevalidate):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):

    Reload on Vary mismatch.

* platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):

    Vary header collection and validation code moves here.

* platform/network/CacheValidation.h:

Source/WebKit2:

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::cachePolicyAllowsExpired):
(WebKit::NetworkCache::makeUseDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::storeRedirect):
(WebKit::NetworkCache::Cache::update):
(WebKit::NetworkCache::headerValueForVary): Deleted.
(WebKit::NetworkCache::collectVaryingRequestHeaders): Deleted.
(WebKit::NetworkCache::verifyVaryingRequestHeaders): Deleted.

    These move to WebCore.

LayoutTests:

* http/tests/cache/disk-cache/disk-cache-vary-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt:

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

3 years agoTestWebKitAPI: Removed redunandant check PLATFORM(GTK) && !defined(BUILDING_WEBKIT2__)
annulen@yandex.ru [Wed, 8 Jun 2016 12:56:36 +0000 (12:56 +0000)]
TestWebKitAPI: Removed redunandant check PLATFORM(GTK) && !defined(BUILDING_WEBKIT2__)
https://bugs.webkit.org/show_bug.cgi?id=158521

Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/config.h:

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

3 years agoUnreviewed. Fix GTK+ build with threaded compositor enabled after r201802.
carlosgc@webkit.org [Wed, 8 Jun 2016 12:48:38 +0000 (12:48 +0000)]
Unreviewed. Fix GTK+ build with threaded compositor enabled after r201802.

* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::create):

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

3 years agoLayerTreeHost should be created with a WebPage reference instead of a pointer
carlosgc@webkit.org [Wed, 8 Jun 2016 12:13:11 +0000 (12:13 +0000)]
LayerTreeHost should be created with a WebPage reference instead of a pointer
https://bugs.webkit.org/show_bug.cgi?id=158520

Reviewed by Žan Doberšek.

We are indeed creating the LayerTreeHost always from a WebPage reference but getting its address to pass it to
the LayerTreeHost create() function.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::create):
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
(WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
(WebKit::CoordinatedLayerTreeHost::commitSceneState):
(WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::create):
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
(WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers):
(WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged):
(WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
(WebKit::LayerTreeHost::LayerTreeHost):
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::create):
(WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
(WebKit::LayerTreeHostGtk::makeContextCurrent):
(WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHostGtk::paintContents):
(WebKit::LayerTreeHostGtk::deviceScaleFactor):
(WebKit::LayerTreeHostGtk::pageScaleFactor):
(WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
(WebKit::LayerTreeHostGtk::flushAndRenderLayers):
(WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
(WebKit::LayerTreeHostGtk::initialize): Deleted.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:

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

3 years agoUnreviewed, rolling out r201800.
commit-queue@webkit.org [Wed, 8 Jun 2016 09:06:07 +0000 (09:06 +0000)]
Unreviewed, rolling out r201800.
https://bugs.webkit.org/show_bug.cgi?id=158518

Missing WebKit2 pieces (Requested by anttik on #webkit).

Reverted changeset:

"WebKit memory cache doesn't respect Vary header"
https://bugs.webkit.org/show_bug.cgi?id=71509
http://trac.webkit.org/changeset/201800

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

3 years agoWebKit memory cache doesn't respect Vary header
antti@apple.com [Wed, 8 Jun 2016 09:01:07 +0000 (09:01 +0000)]
WebKit memory cache doesn't respect Vary header
https://bugs.webkit.org/show_bug.cgi?id=71509
<rdar://problem/26651033>

Reviewed by Sam Weinig.

Implement Vary header support in WebCore memory cache.

The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
verify the headers for CachedResources.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::failBeforeStarting):
(WebCore::addAdditionalRequestHeadersToRequest):

    Factor into standalone function so we can use it from varyHeaderValuesMatch.

(WebCore::CachedResource::addAdditionalRequestHeaders):
(WebCore::CachedResource::load):
(WebCore::CachedResource::setResponse):

    Collect the Vary header values when we receive a response.

(WebCore::CachedResource::responseReceived):
(WebCore::CachedResource::redirectChainAllowsReuse):
(WebCore::CachedResource::varyHeaderValuesMatch):

    Test for Vary match.

(WebCore::CachedResource::overheadSize):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isCacheValidator):
(WebCore::CachedResource::resourceToRevalidate):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):

    Reload on Vary mismatch.

* platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):

    Vary header collection and validation code moves here.

* platform/network/CacheValidation.h:

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

3 years agoExtend CSSFontSelector's lifetime to be longer than the Document's lifetime
mmaxfield@apple.com [Wed, 8 Jun 2016 08:00:22 +0000 (08:00 +0000)]
Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
https://bugs.webkit.org/show_bug.cgi?id=154101

Reviewed by Darin Adler.

Rather than destroying the Document's CSSFontSelector, instead, the object should
live for the lifetime of the document, and it should instead be asked to clear its
contents.

This is important for the CSS Font Loading API, where the identity of objects the
CSSFontSelector references needs to persist throughout the lifetime of the
Document. This patch represents the first step to implementing this correctly.
The second step is for the CSSFontSelector to perform a diff instead of a
wholesale clear of its contents. Once this is done, font loading objects can
survive through a call to Document::clearStyleResolver().

This patch gives the CSSFontSelector two states: building underway and building not
underway. The state is building underway in between calls to clearStyleResolver()
and when the style resolver gets built back up. Otherwise, the state is building
not underway. Because of this new design, creation of all FontFace objects can be
postponed until a state transition from building underway to building not underway.
A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
we never service a font lookup request while Building.

No new tests because there is no behavior change.

* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::clear):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::buildStarted):
(WebCore::CSSFontSelector::buildCompleted):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::CSSFontSelector): Deleted.
(WebCore::CSSFontSelector::clearDocument): Deleted.
* css/CSSFontSelector.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::appendAuthorStyleSheets):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::clearStyleResolver):
(WebCore::Document::fontSelector): Deleted.
* dom/Document.h:
(WebCore::Document::fontSelector):

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

3 years agoWebRTC: Imlement MediaEndpointPeerConnection::setLocalDescription()
adam.bergkvist@ericsson.com [Wed, 8 Jun 2016 07:37:08 +0000 (07:37 +0000)]
WebRTC: Imlement MediaEndpointPeerConnection::setLocalDescription()
https://bugs.webkit.org/show_bug.cgi?id=158190

Reviewed by Eric Carlson.

Source/WebCore:

Add implementation for MediaEndpointPeerConnection::setLocalDescription. This function
parses the input SDP, configures the media backend and updates the
RTCPeerConnection state.

This change adds MediaEndpointSessionDescription which is an object representation
of an RTCSessionDescription (which contains an SDP string).

Test: fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html

* CMakeLists.txt:
Add MediaEndpointSessionDescription.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::hasUnassociatedTransceivers):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::setLocalDescription):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
Add implementation.
(WebCore::MediaEndpointPeerConnection::localDescription):
(WebCore::MediaEndpointPeerConnection::currentLocalDescription):
(WebCore::MediaEndpointPeerConnection::pendingLocalDescription):
(WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::internalLocalDescription):
(WebCore::MediaEndpointPeerConnection::createRTCSessionDescription):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/MediaEndpointSessionDescription.cpp: Added.
(WebCore::MediaEndpointSessionDescription::create):
(WebCore::MediaEndpointSessionDescription::toRTCSessionDescription):
(WebCore::MediaEndpointSessionDescription::typeString):
(WebCore::MediaEndpointSessionDescription::isLaterThan):
* Modules/mediastream/MediaEndpointSessionDescription.h: Added.
(WebCore::MediaEndpointSessionDescription::~MediaEndpointSessionDescription):
(WebCore::MediaEndpointSessionDescription::type):
(WebCore::MediaEndpointSessionDescription::configuration):
(WebCore::MediaEndpointSessionDescription::MediaEndpointSessionDescription):
* WebCore.xcodeproj/project.pbxproj:
Add MediaEndpointSessionDescription.

LayoutTests:

Add new test for RTCPeerConnection.setLocalDescription.

* fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html: Added.
Set two local offers as local descriptions and inspect the state changes. Also set some
descriptions with bad types.
* platform/mac/TestExpectations:
Skip the above test for mac (not building with WEB_RTC)

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

3 years ago[GTK] Enable IndexedDB in workers
carlosgc@webkit.org [Wed, 8 Jun 2016 06:54:11 +0000 (06:54 +0000)]
[GTK] Enable IndexedDB in workers
https://bugs.webkit.org/show_bug.cgi?id=158475

Reviewed by Antonio Gomes.

This is working now and many tests are failing only because we don't enable it.

* Source/cmake/OptionsGTK.cmake:

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

3 years ago[GLIB] Implement hardLinkOrCopyFile() in FileSystemGlib
carlosgc@webkit.org [Wed, 8 Jun 2016 06:51:51 +0000 (06:51 +0000)]
[GLIB] Implement hardLinkOrCopyFile() in FileSystemGlib
https://bugs.webkit.org/show_bug.cgi?id=158473

Reviewed by Michael Catanzaro.

It was added in r199230 to be used by IndexedDB blob support, but never implemented for GLib.

* platform/glib/FileSystemGlib.cpp:
(WebCore::hardLinkOrCopyFile):

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

3 years ago[GTK] Use a longer timeout for glib unit tests
carlosgc@webkit.org [Wed, 8 Jun 2016 06:49:36 +0000 (06:49 +0000)]
[GTK] Use a longer timeout for glib unit tests
https://bugs.webkit.org/show_bug.cgi?id=158476

Reviewed by Darin Adler.

The timeout is supposed to be per test case, but in the case of GLib tests it affects all the tests cases of the
same test program. Some test programs like TestLoaderClient, that have a lot of test cases, often time out in
the bots because the timeout is not enough to run all the tests cases. So, we should use a longer timeout for
GLib tests.

* Scripts/run-gtk-tests:
(TestRunner._run_test_glib):

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

3 years agoWebRTC: Refactor: Use captures with initializers in MediaEndpointPeerConnection:...
adam.bergkvist@ericsson.com [Wed, 8 Jun 2016 06:30:47 +0000 (06:30 +0000)]
WebRTC: Refactor: Use captures with initializers in MediaEndpointPeerConnection::createOffer()
https://bugs.webkit.org/show_bug.cgi?id=158486

Reviewed by Eric Carlson.

Use initializers for the capture list when scheduling the "create offer task".

No change in behavior.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOffer):
(WebCore::WrappedSessionDescriptionPromise::create): Deleted.
(WebCore::WrappedSessionDescriptionPromise::promise): Deleted.
(WebCore::WrappedSessionDescriptionPromise::WrappedSessionDescriptionPromise): Deleted.
Not needed anymore.

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

3 years agoTouchList::append() should take a Ref instead of RefPtr
nael.ouedraogo@crf.canon.fr [Wed, 8 Jun 2016 06:11:20 +0000 (06:11 +0000)]
TouchList::append() should take a Ref instead of RefPtr
https://bugs.webkit.org/show_bug.cgi?id=158469

Reviewed by Chris Dumez.

RefPtr<Touch> items handled in TouchList cannot be null. Thus
RefPtr<Touch> is replaced by Ref<Touch> objects.

* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::createTouchList):
* dom/TouchList.cpp:
(WebCore::TouchList::item):
* dom/TouchList.h:
(WebCore::TouchList::append):

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

3 years agoEFL build has been broken since r201761
gyuyoung.kim@webkit.org [Wed, 8 Jun 2016 05:42:47 +0000 (05:42 +0000)]
EFL build has been broken since r201761
https://bugs.webkit.org/show_bug.cgi?id=158512

Unreviewed build fix.

* platform/posix/SharedBufferPOSIX.cpp:
(WebCore::SharedBuffer::createFromReadingFile):
Do not use ? operand in return line. Additionally return nullptr instead of 0.

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

3 years agoExpose Event / EventTarget properties on WorkerGlobalScope
cdumez@apple.com [Wed, 8 Jun 2016 05:28:37 +0000 (05:28 +0000)]
Expose Event / EventTarget properties on WorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=158511

Reviewed by Sam Weinig.

Source/WebCore:

Expose Event / EventTarget properties on WorkerGlobalScope, as per the
latest DOM specification:
- https://dom.spec.whatwg.org/#interface-event
- https://dom.spec.whatwg.org/#interface-eventtarget

No new tests, rebaselined existing test.

* dom/Event.idl:
* dom/EventTarget.idl:

LayoutTests:

Rebaseline existing test.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

3 years ago[EFL] Build fix related with SharedBuffer::createFromReadingFile in SharedBufferPosix.cpp
jh718.park@samsung.com [Wed, 8 Jun 2016 04:27:45 +0000 (04:27 +0000)]
[EFL] Build fix related with SharedBuffer::createFromReadingFile in SharedBufferPosix.cpp
https://bugs.webkit.org/show_bug.cgi?id=158515

* platform/posix/SharedBufferPOSIX.cpp:
(WebCore::SharedBuffer::createFromReadingFile):

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

3 years agoNeed an exception check after constructEmptyArray().
mark.lam@apple.com [Wed, 8 Jun 2016 02:53:32 +0000 (02:53 +0000)]
Need an exception check after constructEmptyArray().
https://bugs.webkit.org/show_bug.cgi?id=158411

Reviewed by Saam Barati.

Source/JavaScriptCore:

Added an exception check after each call to constructEmptyArray().

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::addSequenceProperties):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::toJS):
* profiler/ProfilerOSRExitSite.cpp:
(JSC::Profiler::OSRExitSite::toJS):
* profiler/ProfilerOriginStack.cpp:
(JSC::Profiler::OriginStack::toJS):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/ModuleLoaderObject.cpp:
(JSC::moduleLoaderObjectRequestedModules):
* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):
* runtime/RegExpObject.cpp:
(JSC::collectMatches):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncSplitFast):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplitFast):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):

* tests/stress/regress-158411.js: Added.

Source/WebCore:

A stress test for this was added in JavaScriptCore.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::buildJSONForRSAComponents):
(WebCore::addBoolToJSON):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::deserialize):

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

3 years agoThe backdrop-filter property does not respect border-radius
commit-queue@webkit.org [Wed, 8 Jun 2016 02:07:34 +0000 (02:07 +0000)]
The backdrop-filter property does not respect border-radius
https://bugs.webkit.org/show_bug.cgi?id=158483
<rdar://problem/24210257>

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

Source/WebCore:

In order to correctly support border-radius and backdrop-filter together, we change
the value set as the m_backdropFiltersRect from a FloatRect to FloatRoundedRect so
that it accounts for values set by the border-radius property. Then we add a new
m_backdropClippingLayer PlatformCALayer member to clip the backdrop layer in the
event that the border-radius is non-zero in updateBackdropFiltersRect(). Finally,
we follow the same pattern used for other PlatformCALayers owned by a GraphicsLayerCA
to support cloning of the new m_backdropClippingLayer.

Tests: css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-add.html
       css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-remove.html
       css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection.html
       css3/filters/backdrop/backdrop-filter-with-border-radius-value-change.html
       css3/filters/backdrop/backdrop-filter-with-border-radius-value-remove.html
       css3/filters/backdrop/backdrop-filter-with-border-radius.html

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setBackdropFiltersRect):
(WebCore::GraphicsLayer::backdropFiltersRect):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::willBeDestroyed):
(WebCore::GraphicsLayerCA::setBackdropFiltersRect):
(WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
Use a rounded rect if there is no clip and we have non-zero border-radius set on the renderer.

LayoutTests:

Adding new tests checking that border-radius correctly affects clipping of the backdrop layer
in a basic scenario, when we change border-radius to a different value, when we set border-radius
back to 0 and when we add a reflection.

* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-add-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-add.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-remove-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-remove.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-value-change-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-value-change.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-value-remove-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius-value-remove.html: Added.
* css3/filters/backdrop/backdrop-filter-with-border-radius.html: Added.

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

3 years agoCachedScript should avoid recomputing its hash multiple times.
akling@apple.com [Wed, 8 Jun 2016 01:53:44 +0000 (01:53 +0000)]
CachedScript should avoid recomputing its hash multiple times.
<https://webkit.org/b/158506>

Reviewed by Saam Barati.

JSBench was hitting CachedScript::script() hard and spending lots of time hashing scripts.
Since we're already caching the hash in a member variable, don't bother rehashing if we've
already done it before.

This takes total time spent in StringImpl::hashSlowCase() from 1600ms to 77ms on my MBP.

* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):

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

3 years agoImplement Air::allocateStack() in ES6 to see how much of a bad idea that is
fpizlo@apple.com [Wed, 8 Jun 2016 01:43:35 +0000 (01:43 +0000)]
Implement Air::allocateStack() in ES6 to see how much of a bad idea that is
https://bugs.webkit.org/show_bug.cgi?id=158318

Reviewed by Saam Barati.
PerformanceTests:

This adds a new benchmark for us to play with called JSAir. It's a complete ES6
implementation of Air's allocateStack() phase along with all of Air needed to run that
phase. This includes things like stack slots, registers, temporaries, basic blocks,
instructions, and all of the code for iterating over, inspecting, and modifying those
things.

To make this work, JSC can now dump Air just before allocateStack() in the form of JS code
that creates a Code object that matches exactly what C++ Air saw. This benchmark comprises
four Air IRs:

- Octane/gbemu's largest function, executeIteration.
- Kraken/imaging-gaussian-blur's largest function in OSR entry mode, gaussuanBlur.
- Octane/typescript's largest function that is actually hot, scanIdentifier.
- JSAir's largest hot function, which is anonymous, so we call it by its hash (ACLj8C).

This runs in about 2 seconds on my machine in JSC trunk. It includes both a commandline
harness and a web harness. JSAir is almost exactly 100x slower in ES6 in WebKit than the
C++ Air::allocateStack() phase on which it is based.

JSAir uses the following ES6 features:

- Symbol.
- for-of.
- arrow functions.
- Map/Set.
- let/const.
- classes.

All of these things are used in anger and should end up on the hot path. There is also code
that uses Proxies, but it ends up being dead.

We can improve this even more:
I still need to add result validation: https://bugs.webkit.org/show_bug.cgi?id=158493
I want to make it use more ES6 features: https://bugs.webkit.org/show_bug.cgi?id=158497

* JSAir: Added.
* JSAir/all.js: Added.
* JSAir/allocate_stack.js: Added.
(allocateStack.attemptAssignment):
(allocateStack.assign):
(allocateStack.interfere):
(allocateStack.):
(allocateStack):
* JSAir/arg.js: Added.
(Arg):
(Arg.isAnyUse):
(Arg.isColdUse):
(Arg.isWarmUse):
(Arg.cooled):
(Arg.isEarlyUse):
(Arg.isLateUse):
(Arg.isAnyDef):
(Arg.isEarlyDef):
(Arg.isLateDef):
(Arg.isZDef):
(Arg.typeForB3Type):
(Arg.widthForB3Type):
(Arg.conservativeWidth):
(Arg.minimumWidth):
(Arg.bytes):
(Arg.widthForBytes):
(Arg.createTmp):
(Arg.fromReg):
(Arg.createImm):
(Arg.createBigImm):
(Arg.createBitImm):
(Arg.createBitImm64):
(Arg.createAddr):
(Arg.createStack):
(Arg.createCallArg):
(Arg.createStackAddr):
(Arg.isValidScale):
(Arg.logScale):
(Arg.createIndex):
(Arg.createRelCond):
(Arg.createResCond):
(Arg.createDoubleCond):
(Arg.createWidth):
(Arg.prototype.get kind):
(Arg.prototype.get isTmp):
(Arg.prototype.get isImm):
(Arg.prototype.get isBigImm):
(Arg.prototype.get isBitImm):
(Arg.prototype.get isBitImm64):
(Arg.prototype.get isSomeImm):
(Arg.prototype.get isAddr):
(Arg.prototype.get isStack):
(Arg.prototype.get isCallArg):
(Arg.prototype.get isIndex):
(Arg.prototype.get isMemory):
(Arg.prototype.get isStackMemory):
(Arg.prototype.get isRelCond):
(Arg.prototype.get isResCond):
(Arg.prototype.get isDoubleCond):
(Arg.prototype.get isCondition):
(Arg.prototype.get isWidth):
(Arg.prototype.get isAlive):
(Arg.prototype.get tmp):
(Arg.prototype.get value):
(Arg.prototype.get base):
(Arg.prototype.get hasOffset):
(Arg.prototype.get offset):
(Arg.prototype.get stackSlot):
(Arg.prototype.get index):
(Arg.prototype.get scale):
(Arg.prototype.get logScale):
(Arg.prototype.get width):
(Arg.prototype.get isGPTmp):
(Arg.prototype.get isFPTmp):
(Arg.prototype.get isGP):
(Arg.prototype.get isFP):
(Arg.prototype.get hasType):
(Arg.prototype.get type):
(Arg.prototype.isType):
(Arg.prototype.isCompatibleType):
(Arg.prototype.get isGPR):
(Arg.prototype.get gpr):
(Arg.prototype.get isFPR):
(Arg.prototype.get fpr):
(Arg.prototype.get isReg):
(Arg.prototype.get reg):
(Arg.isValidImmForm):
(Arg.isValidBitImmForm):
(Arg.isValidBitImm64Form):
(Arg.isValidAddrForm):
(Arg.isValidIndexForm):
(Arg.prototype.isValidForm):
(Arg.prototype.forEachTmpFast):
(Arg.prototype.usesTmp):
(Arg.prototype.forEachTmp):
(Arg.prototype.is):
(Arg.prototype.as):
(Arg.prototype.forEachFast):
(Arg.prototype.forEach):
(Arg.extract):
(Arg.forEachFast):
(Arg.forEach):
(Arg.prototype.get condition):
(Arg.prototype.get isInvertible):
(Arg.prototype.toString):
* JSAir/basic_block.js: Added.
(BasicBlock):
(BasicBlock.prototype.get index):
(BasicBlock.prototype.get size):
(BasicBlock.prototype.Symbol.iterator):
(BasicBlock.prototype.at):
(BasicBlock.get last):
(BasicBlock.get insts):
(BasicBlock.get numSuccessors):
(BasicBlock.get successors):
(BasicBlock.get successorBlocks.):
(BasicBlock.get successorBlocks):
(BasicBlock.set get numPredecessors):
(BasicBlock.get predecessors):
(BasicBlock.get frequency):
(BasicBlock.get headerString):
(BasicBlock.get footerString):
* JSAir/benchmark.js: Added.
(benchmark):
* JSAir/code.js: Added.
(Code):
(Code.prototype.addBlock):
(Code.prototype.addStackSlot):
(Code.prototype.newTmp):
(Code.prototype.get size):
(Code.prototype.at):
(Code.prototype.Symbol.iterator):
(Code.prototype.get blocks):
(Code.prototype.get stackSlots):
(Code.prototype.tmps):
(Code.prototype.get callArgAreaSize):
(Code.prototype.requestCallArgAreaSize):
(Code.prototype.get frameSize):
(Code.prototype.setFrameSize):
(Code.prototype.toString):
* JSAir/custom.js: Added.
(const.ShuffleCustom.forEachArg):
(const.ShuffleCustom.hasNonArgNonControlEffects):
(const.PatchCustom.forEachArg):
(const.PatchCustom.hasNonArgNonControlEffects):
(const.CCallCustom.forEachArg):
(const.CCallCustom.hasNonArgNonControlEffects):
(const.ColdCCallCustom.forEachArg):
(const.ColdCCallCustom.hasNonArgNonControlEffects):
* JSAir/frequented_block.js: Added.
(FrequentedBlock):
(FrequentedBlock.prototype.toString):
* JSAir/insertion_set.js: Added.
(Insertion):
(Insertion.prototype.get index):
(Insertion.prototype.get element):
(Insertion.prototype.lessThan):
(InsertionSet):
(InsertionSet.prototype.appendInsertion):
(InsertionSet.prototype.append):
(InsertionSet.prototype.execute):
* JSAir/inst.js: Added.
(Inst):
(Inst.prototype.append):
(Inst.prototype.clear):
(Inst.prototype.get opcode):
(Inst.prototype.get args):
(Inst.prototype.visitArg):
(Inst.prototype.forEachTmpFast):
(Inst.prototype.forEachArg):
(Inst.prototype.forEachTmp):
(Inst.prototype.forEach):
(Inst.forEachDef):
(Inst.forEachDefWithExtraClobberedRegs):
(Inst.prototype.get hasNonArgEffects):
(Inst.prototype.toString):
* JSAir/liveness.js: Added.
(Liveness):
(Liveness.prototype.get thing):
(Liveness.prototype.get code):
(Liveness.prototype.get liveAtHead):
(Liveness.prototype.get liveAtTail):
(Liveness.prototype.localCalc.LocalCalc):
(Liveness.prototype.localCalc.LocalCalc.prototype.get liveSet):
(Liveness.prototype.localCalc.LocalCalc.prototype.execute):
(Liveness.prototype.localCalc):
* JSAir/opcode.js: Added.
(Inst_forEachArg):
(Inst_hasNonArgEffects):
* JSAir/payload-gbemu-executeIteration.js: Added.
(createPayloadGbemuExecuteIteration):
* JSAir/payload-imaging-gaussian-blur-gaussianBlur.js: Added.
(createPayloadImagingGaussianBlurGaussianBlur):
* JSAir/payload-jsair-ACLj8C.js: Added.
(createPayloadJSAirACLj8C):
* JSAir/payload-typescript-scanIdentifier.js: Added.
(createPayloadTypescriptScanIdentifier):
* JSAir/reg.js: Added.
(Reg):
(Reg.fromReg):
(Reg.prototype.get index):
(Reg.prototype.get type):
(Reg.prototype.get name):
(Reg.prototype.get isCalleeSave):
(Reg.prototype.get isReg):
(Reg.prototype.toString):
(Reg.extract):
(Reg.forEachFast):
(Reg.forEach):
(newGPR):
(Reg.gprs.Reg.fprs.Reg.calleeSaveGPRs.Reg.calleeSaveFPRs.Reg.calleeSaves):
* JSAir/stack_slot.js: Added.
(StackSlot):
(StackSlot.prototype.get byteSize):
(StackSlot.prototype.get kind):
(StackSlot.prototype.get isLocked):
(StackSlot.prototype.get isSpill):
(StackSlot.prototype.get index):
(StackSlot.prototype.ensureSize):
(StackSlot.prototype.get alignment):
(StackSlot.prototype.get offsetFromFP):
(StackSlot.prototype.setOffsetFromFP):
(StackSlot.prototype.toString):
(StackSlot.extract):
(StackSlot.forEachFast):
(StackSlot.forEach):
* JSAir/symbols.js: Added.
* JSAir/test.html: Added.
* JSAir/test.js: Added.
* JSAir/tmp.js: Added.
(Tmp):
(Tmp.fromReg):
(Tmp.prototype.get index):
(Tmp.prototype.get type):
(Tmp.prototype.get isReg):
(Tmp.prototype.toString):
(Tmp.extract):
(Tmp.forEachFast):
(Tmp.forEach):
* JSAir/tmp_base.js: Added.
(TmpBase.prototype.get isGP):
(TmpBase.prototype.get isFP):
(TmpBase.prototype.get isGPR):
(TmpBase.prototype.get isFPR):
(TmpBase.prototype.get reg):
(TmpBase.prototype.get gpr):
(TmpBase.prototype.get fpr):
(TmpBase):
* JSAir/util.js: Added.
(isRepresentableAsInt32):
(addIndexed):
(roundUpToMultipleOf):
(symbolName):
(mergeIntoSet):
(nonEmptyRangesOverlap):
(rangesOverlap):
(removeAllMatching):
(swap):
(bubble):
(bubbleSort):
(currentTime):
(else.currentTime):

Source/JavaScriptCore:

Most of these changes are to support dumpAsJS(). But I also found some duplicate and dead
code while rewriting it to JS.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirAllocateStack.cpp:
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::isSomeImm):
(JSC::B3::Air::Arg::isAddr):
(JSC::B3::Air::Arg::tmpIndex):
(JSC::B3::Air::Arg::isValidImmForm):
(JSC::B3::Air::Arg::withOffset): Deleted. This was dead code.
* b3/air/AirArgInlines.h: It turns out that Inst has a ForEach thing that duplicated some of the logic of ArgThingHelper, so I just made ArgThingHelper more powerful.
(JSC::B3::Air::ArgThingHelper<Arg>::forEach):
(JSC::B3::Air::ArgThingHelper<Reg>::is):
(JSC::B3::Air::ArgThingHelper<Reg>::as):
(JSC::B3::Air::ArgThingHelper<Reg>::forEachFast):
(JSC::B3::Air::ArgThingHelper<Reg>::forEach):
(JSC::B3::Air::Arg::is):
* b3/air/AirDumpAsJS.cpp: Added.
(JSC::B3::Air::dumpAsJS):
* b3/air/AirDumpAsJS.h: Added.
* b3/air/AirFixObviousSpills.cpp:
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::forEach):
(JSC::B3::Air::Inst::extraClobberedRegs):
(JSC::B3::Air::ForEach<Tmp>::forEach): Deleted. This was doing what ArgThingHelper would have done but not as well.
(JSC::B3::Air::ForEach<Arg>::forEach): Deleted.
(JSC::B3::Air::ForEach<Reg>::forEach): Deleted.
* b3/air/AirLogRegisterPressure.cpp:
* b3/air/AirReportUsedRegisters.cpp:
* b3/air/AirSpillEverything.cpp:
* b3/air/opcode_generator.rb: Make this dump opcode.js, which is like what it dumps for C++.
* jit/Reg.cpp:
(JSC::Reg::debugName):
(JSC::Reg::dump):
* jit/Reg.h:
(JSC::Reg::hash):
* jsc.cpp: Fix jsc so that it reports the filename and line number of parser errors.
(dumpException):
* parser/ParserError.h: Make it easier to debug this code.
(WTF::printInternal):
* runtime/Options.h:

Source/WTF:

* wtf/Insertion.h:
(WTF::executeInsertions): I found a bug while rewriting this code in JS.
* wtf/PrintStream.h:
(WTF::PrintStream::print):
(WTF::PrintStream::println): This is useful to have.

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

3 years agoRemove all uses of PassRefPtr in WTF
krollin@apple.com [Wed, 8 Jun 2016 01:31:17 +0000 (01:31 +0000)]
Remove all uses of PassRefPtr in WTF
https://bugs.webkit.org/show_bug.cgi?id=157596
<rdar://problem/26234391>

Reviewed by Chris Dumez.

Source/JavaScriptCore:

Update calls to interfaces that no longer take or return PassRefPtrs.

* runtime/JSString.cpp:
(JSC::JSRopeString::resolveRope):
* runtime/JSString.h:
(JSC::JSString::JSString):
(JSC::jsSubstring):
* runtime/PrivateName.h:
(JSC::PrivateName::PrivateName):
* runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::SmallStringsStorage):
* runtime/StringConstructor.cpp:
(JSC::stringFromCharCodeSlowCase):
* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstrings):
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::replaceUsingStringSearch):
(JSC::repeatCharacter):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncLink):
(JSC::normalize):

Source/WebCore:

Update calls to interfaces that no longer take or return PassRefPtrs.

No new tests: no new functionality so changes are covered by existing
tests.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):
* dom/Document.cpp:
(WebCore::Document::displayStringModifiedByEncoding):
* xml/XPathGrammar.y:

Source/WTF:

Remove/update most interfaces that take or return PassRefPtrs.
Remaining references include those in non-Cocoa implementations and
those required for continued compatibility with modules that still use
PassRefPtrs (specifically: Forward.h, RefPtr interoperability,
SizeLimits.h, WorkQueue (Windows) DispatchQueueEfl,
DispatchWorkItemEfl, and PassRefPtr itself).

Update calls to interfaces that no longer take or return PassRefPtrs.

Update adoptRef(T*) to return a RefPtr instead of a PassRefPtr and
move it to RefPtr.h from PassRefPtr.h.

* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::allocate):
* wtf/MetaAllocator.h:
* wtf/ParallelJobsGeneric.h:
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/text/AtomicStringImpl.cpp:
(WTF::HashAndUTF8CharactersTranslator::translate):
(WTF::SubstringTranslator::translate):
* wtf/text/CString.cpp:
(WTF::CStringBuffer::createUninitialized):
* wtf/text/CString.h:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reifyString):
(WTF::StringBuilder::resize):
(WTF::StringBuilder::reallocateBuffer<LChar>):
(WTF::StringBuilder::reallocateBuffer<UChar>):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::reallocateInternal):
(WTF::StringImpl::reallocate):
(WTF::StringImpl::create8BitIfPossible):
(WTF::StringImpl::createSymbol):
(WTF::StringImpl::createNullSymbol):
(WTF::StringImpl::convertToLowercaseWithoutLocale):
(WTF::StringImpl::convertToUppercaseWithoutLocale):
(WTF::StringImpl::convertToLowercaseWithLocale):
(WTF::StringImpl::convertToUppercaseWithLocale):
(WTF::StringImpl::convertASCIICase):
* wtf/text/StringImpl.h:
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createSubstringSharingImpl):
(WTF::StringImpl::tryCreateUninitialized):
(WTF::StringImpl::extractFoldedStringInSymbol):
* wtf/text/SymbolRegistry.cpp:
(WTF::SymbolRegistry::symbolForKey):
* wtf/text/WTFString.cpp:
(WTF::String::substringSharingImpl):
* wtf/text/WTFString.h:
(WTF::String::String): Deleted.
* wtf/text/cf/StringImplCF.cpp:

Tools:

Update calls to interfaces that no longer take or return PassRefPtrs.

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

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

3 years agoUpdate tests to work around https://bugs.webkit.org/show_bug.cgi?id=158507.
weinig@apple.com [Wed, 8 Jun 2016 01:30:49 +0000 (01:30 +0000)]
Update tests to work around https://bugs.webkit.org/show_bug.cgi?id=158507.

* TestExpectations:
Re-enable now passing test.

* animations/script-tests/spring-computed-style.js:
* animations/script-tests/spring-parsing.js:
Use a non-body element to do the testing.

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

3 years agoMark animations/spring-computed-style.html as failing temporarily.
weinig@apple.com [Wed, 8 Jun 2016 00:44:52 +0000 (00:44 +0000)]
Mark animations/spring-computed-style.html as failing temporarily.

* TestExpectations:

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

3 years agoRebaseline fast/events/touch/document-create-touch-list-ios.html
ryanhaddad@apple.com [Wed, 8 Jun 2016 00:36:05 +0000 (00:36 +0000)]
Rebaseline fast/events/touch/document-create-touch-list-ios.html

Unreviewed test gardening.

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

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

3 years agoWeb Inspector: reduce timer churn when processing many DOM.attributeModified messages
bburg@apple.com [Wed, 8 Jun 2016 00:32:08 +0000 (00:32 +0000)]
Web Inspector: reduce timer churn when processing many DOM.attributeModified messages
https://bugs.webkit.org/show_bug.cgi?id=158491
<rdar://problem/25561452>

Reviewed by Timothy Hatcher.

When the backend sends thousands of DOM.attributeModified events to the frontend, it
slows to a crawl. This is partly because redundant messages are being sent, and
because the frontend is taking too long to render attribute updates in the elements tab.

This patch is a first step to improve performance by reducing unnecessary work. It
coalesces all attribute state updates to only happen once per animation frame. This
reduces timer churn because we previously used a debouncing timer with interval of 0ms,
and that had to be cleared and restarted on every call. This change also eliminates
forced layouts when updating the selection highlights, since the DOM tree outline has
been reflowed by the time we start updating selections in a requestAnimationFrame callback.

There is still a lot of optimization to be done here, but this reduces the problem
considerably by keeping the event loop clear and making it obvious which selection
update operations are still too expensive.

* UserInterface/Base/Utilities.js:
Add a 'onNextFrame' proxy to Object. It works like debounce, except it coalesces calls
up until the next animation frame rather than a fixed timeout. It also does not extend
the timeout interval for each call.

* UserInterface/Views/DOMTreeUpdater.js:
(WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
(WebInspector.DOMTreeUpdater.prototype._characterDataModified):
(WebInspector.DOMTreeUpdater.prototype._nodeInserted):
(WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
Update on the next frame rather than on a zero delay timeout.

* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.WebInspector.TreeElement.prototype.didChange):
(WebInspector.TreeOutline.WebInspector.TreeElement.prototype._fireDidChange):
Update on the next frame rather than on a zero delay timeout.

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

3 years agoText-decoration-style: dashed / dotted rendered as solid
mmaxfield@apple.com [Wed, 8 Jun 2016 00:06:28 +0000 (00:06 +0000)]
Text-decoration-style: dashed / dotted rendered as solid
https://bugs.webkit.org/show_bug.cgi?id=134336

Reviewed by Dean Jackson.

Source/WebCore:

We already had most of the infrastructure for dotted / dashed underlines.
Previously, we were setting the stroke style for the underlines, but then
filling the underlines (which means the stroke styles is irrelevant).
Instead, we should just compute the individual dots / dashes to fill.

The implementation of this is done inside GraphicsContext because
GraphicsContext is already responsible for handling the single / double
underline distinction. Extending it to be responsible for dotted / dashed
is the natural thing to do.

Tests: fast/css3-text/css3-text-decoration/text-decoration-dashed.html
       fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html
       fast/css3-text/css3-text-decoration/text-decoration-dotted.html

* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* rendering/TextDecorationPainter.cpp:
(WebCore::drawSkipInkUnderline):
(WebCore::TextDecorationPainter::paintTextDecoration):

LayoutTests:

Make sure that the dotted / dashed / solid renderings are all distinct.

* fast/css3-text/css3-text-decoration/text-decoration-dashed-expected-mismatch.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-dashed.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed-expected-mismatch.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-dotted-expected-mismatch.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-dotted.html: Added.

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

3 years agoInvalidationPointInjectionPhase creates bogus InvalidationPoints that may even be...
sbarati@apple.com [Tue, 7 Jun 2016 23:45:53 +0000 (23:45 +0000)]
InvalidationPointInjectionPhase creates bogus InvalidationPoints that may even be inserted when it's not OK to exit
https://bugs.webkit.org/show_bug.cgi?id=158499
<rdar://problem/26647473>

Reviewed by Mark Lam and Benjamin Poulain.

InvalidationPointInjectionPhase forgot to clear m_originThatHadFire
before analyzing the current block it's analyzing. This meant that
the phase allowed a residual m_originThatHadFire that was set from the
previous block to effect a completely unrelated block. This is usually
harmless, but sometimes we would insert an InvalidationPoint at a point
in the graph when exiting is invalid. This would cause a crash.

* dfg/DFGInvalidationPointInjectionPhase.cpp:
(JSC::DFG::InvalidationPointInjectionPhase::run):
* tests/stress/dont-crash-on-bad-invalidation-point.js: Added.
(dontCrash):

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