WebKit-https.git
4 years agoWeb Inspector: scrolled Snapshot list is reset to top and drawn blank after switching...
timothy@apple.com [Thu, 7 Jul 2016 21:26:33 +0000 (21:26 +0000)]
Web Inspector: scrolled Snapshot list is reset to top and drawn blank after switching back from Snapshot Comparison view
https://bugs.webkit.org/show_bug.cgi?id=158218
rdar://problem/26545000

Reviewed by Brian Burg.

* UserInterface/Views/ClusterContentView.js:
(WebInspector.ClusterContentView.prototype.get scrollableElements): Added.
A default implementation for all cluster views.

* UserInterface/Views/DOMStorageContentView.js:
(WebInspector.DOMStorageContentView.prototype.get scrollableElements): Deleted.
This was duplicated in the class, removed one.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView): Initialize _snapshotListScrollTop.
(WebInspector.HeapAllocationsTimelineView.prototype.get scrollableElements): Added. Return elements
based on what is showing.

(WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotList): Restore the scroll position
of the DataGrid after it is added to the view.

(WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord): Save the scroll position
of the DataGrid before it is removed from the view.

* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView.prototype.get scrollableElements): Deleted. Handled by the base class now.

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

4 years agoREGRESSION (r199054): CrashTracer: [USER] parseWebKit at WebCore: WebCore::RenderBloc...
antti@apple.com [Thu, 7 Jul 2016 21:24:45 +0000 (21:24 +0000)]
REGRESSION (r199054): CrashTracer: [USER] parseWebKit at WebCore: WebCore::RenderBlockFlow::checkFloatsInCleanLine + 107
https://bugs.webkit.org/show_bug.cgi?id=159519

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/inline/trailing-floats-inline-crash.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::checkFloatsInCleanLine):

    Use the existing deletionHasBegun bit in RenderStyle to assert against this reliably.

* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):

    In some cases a special TrailingFloatsRootInlineBox may be added as the last root linebox of a flow.
    If it is combined with br the existing invalidation that invalidates the next and previous line may
    not be sufficient. Test for this case and invalidate the TrailingFloatsRootInlineBox too if it exists.

* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::isTrailingFloatsRootInlineBox):
* rendering/TrailingFloatsRootInlineBox.h:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::deletionHasBegun):

    Expose the bit in debug.

LayoutTests:

* fast/inline/trailing-floats-inline-crash-expected.txt: Added.
* fast/inline/trailing-floats-inline-crash.html: Added.

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

4 years agoUse SocketProvider to create WebSocketChannels
commit-queue@webkit.org [Thu, 7 Jul 2016 21:09:14 +0000 (21:09 +0000)]
Use SocketProvider to create WebSocketChannels
https://bugs.webkit.org/show_bug.cgi?id=158776

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-07
Reviewed by Brent Fulgham.

Source/WebCore:

This patch should have no change in behavior except making an InvalidStateError in
conditions where we should not be able to do networking, like in a detached frame.
It just replaces ThreadableWebSocketChannel::create with SocketProvider::createWebSocketChannel
which does the same thing as ThreadableWebSocketChannel::create for Mac and
Windows WebKit1.  The WebKit2 implementation is the same right now, but it will
be replaced by a proxy that will do the WebSocket operations in the NetworkProcess.

* Modules/websockets/ThreadableWebSocketChannel.cpp: Removed.
* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::idbConnectionProxy):
(WebCore::Document::socketProvider):
(WebCore::Document::canNavigate):
* dom/Document.h:
(WebCore::Document::notifyRemovePendingSheetIfNeeded):
* dom/ScriptExecutionContext.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::EmptyEditorClient::registerRedoStep):
(WebCore::EmptySocketProvider::createWebSocketChannel):
* loader/EmptyClients.h:
* page/Page.h:
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* page/SocketProvider.h:
(WebCore::SocketProvider::~SocketProvider):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
(WebCore::DedicatedWorkerThread::runEventLoop):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::disableEval):
(WebCore::WorkerGlobalScope::socketProvider):
(WebCore::WorkerGlobalScope::idbConnectionProxy):
* workers/WorkerGlobalScope.h:
(WebCore::WorkerGlobalScope::script):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::idbConnectionProxy):
(WebCore::WorkerThread::socketProvider):
* workers/WorkerThread.h:
(WebCore::WorkerThread::workerGlobalScope):

Source/WebKit:

* PlatformMac.cmake:
* PlatformWin.cmake:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* Misc/WebSocketProvider.mm: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
(WebSocketProvider::createWebSocketChannel):
(WebCore::ThreadableWebSocketChannel::create): Deleted.
* Misc/WebSocketProvider.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit/win:

* WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
(WebSocketProvider::createWebSocketChannel):
(WebCore::ThreadableWebSocketChannel::create): Deleted.
* WebSocketProvider.h:

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
(WebKit::WebSocketProvider::createWebSocketChannel):
(WebCore::ThreadableWebSocketChannel::create): Deleted.
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldDispatchFakeMouseMoveEvents):

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

4 years agoUnreviewed, rolling out r202905 and r202911.
ryanhaddad@apple.com [Thu, 7 Jul 2016 20:53:41 +0000 (20:53 +0000)]
Unreviewed, rolling out r202905 and r202911.
https://bugs.webkit.org/show_bug.cgi?id=159522

This test is fails on El Capitan and Sierra WK1 (Requested by
ryanhaddad on #webkit).

Reverted changesets:

"Add a test for media control dropoff"
https://bugs.webkit.org/show_bug.cgi?id=151287
http://trac.webkit.org/changeset/202905

"Add a test for media control dropoff"
https://bugs.webkit.org/show_bug.cgi?id=151287
http://trac.webkit.org/changeset/202911

Patch by Commit Queue <commit-queue@webkit.org> on 2016-07-07

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

4 years ago<img> with a wide gamut PDF does not display using a wide gamut color space
commit-queue@webkit.org [Thu, 7 Jul 2016 19:32:33 +0000 (19:32 +0000)]
<img> with a wide gamut PDF does not display using a wide gamut color space
https://bugs.webkit.org/show_bug.cgi?id=158983
<rdar://problem/25720247>

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

Source/WebCore:

Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit
color space will now infer the color space from the provided graphics context
on platforms using CG. The method signature that takes in a GraphicsContext
without a color space is now split into a CG-specified implementation and a
Cairo one to avoid having diverging platform code in ImageBuffer.cpp.

Some call sites need to provide an explicit color space still, so we add a new
ImageBuffer::createCompatibleBuffer() that allows for that while inferring
sizing and scaling from a GraphicsContext.

All signatures of ImageBuffer::createCompatibleBuffer() are losing the
hasAlpha parameter which was always ignored. All call sites that were using
hasAlpha have been updated.

In addition, we make all the IOSurface and IOSurfacePool code, which is
CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace
so that we may pick up on the color space copied over from the graphics context
in the CG-specific implementation of ImageBuffer::createCompatibleBuffer().

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/ImageBuffer.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::takeSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::surfaceFromPool):
(WebCore::IOSurface::create):
(WebCore::IOSurface::createFromSendRight):
(WebCore::IOSurface::createFromSurface):
(WebCore::IOSurface::createFromImage):
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* platform/spi/cg/CoreGraphicsSPI.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintProgressBar):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::bufferForeground):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):

Source/WebKit2:

ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::decode):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

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

4 years ago[JSC] Array.prototype.includes uses ToInt32 instead of ToInteger on the index argument
benjamin@webkit.org [Thu, 7 Jul 2016 19:03:27 +0000 (19:03 +0000)]
[JSC] Array.prototype.includes uses ToInt32 instead of ToInteger on the index argument
https://bugs.webkit.org/show_bug.cgi?id=159505

Reviewed by Mark Lam.

Source/JavaScriptCore:

The code was using (value)|0 which is effectively a ToInt32.
This fails on large integers and +-Infinity.

Spec: https://tc39.github.io/ecma262/#sec-array.prototype.includes

* builtins/ArrayPrototype.js:
(includes):

LayoutTests:

* js/array-includes-expected.txt:
* js/script-tests/array-includes.js:

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

4 years agoUse the correct radar number.
andersca@apple.com [Thu, 7 Jul 2016 19:00:45 +0000 (19:00 +0000)]
Use the correct radar number.

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

4 years agoAll fullscreen videos should be able the control the controls manager
bdakin@apple.com [Thu, 7 Jul 2016 18:57:42 +0000 (18:57 +0000)]
All fullscreen videos should be able the control the controls manager
https://bugs.webkit.org/show_bug.cgi?id=159496
-and corresponding-
rdar://problem/27009446

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::fullscreenModeChanged):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canControlControlsManager):

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

4 years agoCrash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
jer.noble@apple.com [Thu, 7 Jul 2016 18:53:19 +0000 (18:53 +0000)]
Crash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
https://bugs.webkit.org/show_bug.cgi?id=159517
<rdar://problem/27221109>

Reviewed by Eric Carlson.

When WebKit on iOS gets a notification that the UIProcess has been backgrounded, it sends an
interruption event to the WebProcess to pause any playing HTMLMediaElements. When the
elements which get this interruption have pending promises created during a previous call to
play(), these promises get rejected.

However, if the HTMLMediaElement's document has already been destroyed, the pending Promises
are in an inconsistent state: their script execution context (the document) has been
destroyed, leading to the crash in JSLockHolder.

When HTMLMediaElement is notified that its ScriptExecutionContext has been destroyed, also
clear the list of pending Promises.

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

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

4 years agoMemory corruption destroying PaymentCoordinator
andersca@apple.com [Thu, 7 Jul 2016 18:47:51 +0000 (18:47 +0000)]
Memory corruption destroying PaymentCoordinator
https://bugs.webkit.org/show_bug.cgi?id=159516
rdar://problem/27222857

Reviewed by Tim Horton.

Introduce a new MessageReceiverMap::removeMessageReceiver that takes a MessageReceiver
and removes all traces of it in the message receiver map. Use it in the WebPaymentCoordinator destructor.

* Platform/IPC/MessageReceiverMap.cpp:
(IPC::MessageReceiverMap::removeMessageReceiver):
* Platform/IPC/MessageReceiverMap.h:
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::removeMessageReceiver):
* Shared/ChildProcess.h:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::~WebPaymentCoordinator):

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

4 years agoUnreviewed: add myself to the reviewers list.
pvollan@apple.com [Thu, 7 Jul 2016 18:26:40 +0000 (18:26 +0000)]
Unreviewed: add myself to the reviewers list.

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

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

4 years agoFacebook videos without audio tracks will sometimes cause playback controls to appear.
jer.noble@apple.com [Thu, 7 Jul 2016 18:00:49 +0000 (18:00 +0000)]
Facebook videos without audio tracks will sometimes cause playback controls to appear.
https://bugs.webkit.org/show_bug.cgi?id=159437

Reviewed by Eric Carlson.

Because updatePlaybackControlsManager() will cause the session manager to walk through all
the outstanding sessions asking if it canControlControlsManager(), some sessions will say
they can control the controls manager if we are currently processing a user gesture. This is
obviously not intended (there may be a user gesture to un-mute video 1, but an unrelated
video 2 should not be allowed to use that use gesture to fulfill its own requirements.)

So in those situations where conditions may have changed and updatePlaybackControlsManager()
needs to be called, instead schedule the update for the next run loop.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::layoutSizeChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
* html/HTMLMediaElement.h:

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

4 years agoUnreviewed build fix after r202908. Fix the webPlaybackSessionInterfaceMac @property.
jer.noble@apple.com [Thu, 7 Jul 2016 17:30:14 +0000 (17:30 +0000)]
Unreviewed build fix after r202908. Fix the webPlaybackSessionInterfaceMac @property.

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:

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

4 years ago[JSC] String.prototype.normalize should have a length of zero
benjamin@webkit.org [Thu, 7 Jul 2016 17:27:17 +0000 (17:27 +0000)]
[JSC] String.prototype.normalize should have a length of zero
https://bugs.webkit.org/show_bug.cgi?id=159506

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Spec: https://tc39.github.io/ecma262/#sec-string.prototype.normalize
The argument is optional, the length should be zero.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

LayoutTests:

* js/script-tests/string-normalize.js: Added.
(listener.toString):
* js/string-normalize-expected.txt: Added.
* js/string-normalize.html: Added.

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

4 years agoVersioning.
bshafiei@apple.com [Thu, 7 Jul 2016 17:23:25 +0000 (17:23 +0000)]
Versioning.

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

4 years ago[Win] The test http/tests/loading/main-resource-delegates-on-back-navigation.html...
pvollan@apple.com [Thu, 7 Jul 2016 17:19:56 +0000 (17:19 +0000)]
[Win] The test http/tests/loading/main-resource-delegates-on-back-navigation.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=159509

Reviewed by Alex Christensen.

We should always insert the url in the url map when identifierForInitialRequest
is called. Otherwise we can end up with identifiers not having an entry in the
url map when urls are written to the test output file.

* DumpRenderTree/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::identifierForInitialRequest):

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

4 years agoAdd a test for media control dropoff
eric.carlson@apple.com [Thu, 7 Jul 2016 16:24:27 +0000 (16:24 +0000)]
Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
<rdar://problem/23544666>

Unreviewed El Capitan-specific test results after r202905.

* platform/mac-elcapitan/media/controls: Added.
* platform/mac-elcapitan/media/controls/inline-elements-dropoff-order-expected.txt: Added.

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

4 years ago[Fetch API] Response constructor should throw in case of bad reason phrase
commit-queue@webkit.org [Thu, 7 Jul 2016 16:24:14 +0000 (16:24 +0000)]
[Fetch API] Response constructor should throw in case of bad reason phrase
https://bugs.webkit.org/show_bug.cgi?id=159508

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-07
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-error-expected.txt:

Source/WebCore:

Covered by rebased test.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::initializeWith): Validating reason phrase with new routine.
Throwing a TypeError in case of error.
* platform/network/HTTPParsers.cpp:
(WebCore::isValidReasonPhrase): Added to validate reason phrase according
https://tools.ietf.org/html/rfc7230#section-3.1.2
* platform/network/HTTPParsers.h:

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

4 years ago[Fetch API] Response.redirect should throw a RangeError in case of bad status code
commit-queue@webkit.org [Thu, 7 Jul 2016 16:03:18 +0000 (16:03 +0000)]
[Fetch API] Response.redirect should throw a RangeError in case of bad status code
https://bugs.webkit.org/show_bug.cgi?id=159507

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-07
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-static-redirect-expected.txt:

Source/WebCore:

Covered by rebased test.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect): Throw a RangeError in case of bad status.

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

4 years agoOwnership between WebPlaybackSessionInterfaceMac and WebPlaybackControlsManager is...
jer.noble@apple.com [Thu, 7 Jul 2016 16:00:20 +0000 (16:00 +0000)]
Ownership between WebPlaybackSessionInterfaceMac and WebPlaybackControlsManager is backwards.
https://bugs.webkit.org/show_bug.cgi?id=159441

Reviewed by Eric Carlson.

The WebPlaybackControlsManager should own the WebPlaybackSessionInterfaceMac, and not
vice versa.

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
(-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):

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

4 years agoReplace reftest scripts-height.html with script tests
fred.wang@free.fr [Thu, 7 Jul 2016 14:29:25 +0000 (14:29 +0000)]
Replace reftest scripts-height.html with script tests
https://bugs.webkit.org/show_bug.cgi?id=159423

We import a test from the MathML in HTML5 test suite to replace the test scripts-height.html
and make results more reliable, explicit and accurate. This avoids the failure on iOS.

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

* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html: Added.
* mathml/presentation/scripts-height.html: Removed.
* platform/ios-simulator/TestExpectations: Remove failure expectation.

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

4 years agoReplace multiscripts-positions.html reftest with script tests
fred.wang@free.fr [Thu, 7 Jul 2016 14:26:08 +0000 (14:26 +0000)]
Replace multiscripts-positions.html reftest with script tests
https://bugs.webkit.org/show_bug.cgi?id=159418

We import more tests from the MathML in HTML5 test suite to replace
and extend the reftest testing metrics in the mmultiscripts element.
This allows to make such tests work on OS X and iOS.

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

* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-2-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-2.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-3-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-3.html: Added.
* mathml/presentation/multiscripts-positions.html: Removed.
* platform/ios-simulator/TestExpectations: Remove failure for multiscripts-positions.
* platform/mac/TestExpectations: Ditto.

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

4 years agoAdd a test for media control dropoff
eric.carlson@apple.com [Thu, 7 Jul 2016 14:21:29 +0000 (14:21 +0000)]
Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
<rdar://problem/23544666>

Reviewed by Antoine Quint.

Source/WebCore:

Test: media/controls/inline-elements-dropoff-order.html

* Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.

LayoutTests:

* media/controls/inline-elements-dropoff-order-expected.txt: Added.
* media/controls/inline-elements-dropoff-order.html: Added.
* platform/mac-yosemite/media/controls: Added.
* platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt: Added.

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

4 years agoRewrite the tests of scripts-subsup.html
fred.wang@free.fr [Thu, 7 Jul 2016 14:20:20 +0000 (14:20 +0000)]
Rewrite the tests of scripts-subsup.html
https://bugs.webkit.org/show_bug.cgi?id=159202

The tests for script metrics in scripts-subsup.html are very unreliable and difficult to
debug. They currently fail on all platforms. We remove them and import a test from the
MathML in HTML5 test suite that verifies equivalent features in a more reliable and
understandable way. The equivalence test for msubsup and empty script is not preserved as
the current code does not actually try to achieve this equivalence.

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

* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-1.html: Added.
* mathml/presentation/scripts-subsup-expected.html: Remove the tests for metrics.
* mathml/presentation/scripts-subsup.html: Ditto.
* platform/gtk/TestExpectations: Remove failure for scripts-subsup.html.
* platform/ios-simulator-wk1/TestExpectations: Ditto.
* platform/ios-simulator/TestExpectations: Ditto.
* platform/mac/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.

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

4 years agoImprove test mathml/presentation/tokenElements-background-color.html
fred.wang@free.fr [Thu, 7 Jul 2016 14:09:22 +0000 (14:09 +0000)]
Improve test mathml/presentation/tokenElements-background-color.html
https://bugs.webkit.org/show_bug.cgi?id=130693

We use the Ahem font to make tokenElements-background-color.html more reliable. However, we
remove the case of italic m because Ahem does not contain the required character U+1D45A.

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

* mathml/presentation/tokenElements-background-color-expected.html:
* mathml/presentation/tokenElements-background-color.html:
* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

4 years agoFix the name of mathml-in-dashboard-expected.txt for iOS.
fred.wang@free.fr [Thu, 7 Jul 2016 14:01:00 +0000 (14:01 +0000)]
Fix the name of mathml-in-dashboard-expected.txt for iOS.

Unreviewed test gardening.

* platform/ios-simulator/mathml/mathml-in-dashboard-expected.txt: Renamed from LayoutTests/platform/ios-simulator/mathml/mathml-in-dashboard-actual.txt.

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

4 years ago[GTK] Painting a video into a canvas doesn't work when accelerated compositing is...
commit-queue@webkit.org [Thu, 7 Jul 2016 13:04:00 +0000 (13:04 +0000)]
[GTK] Painting a video into a canvas doesn't work when accelerated compositing is enabled
https://bugs.webkit.org/show_bug.cgi?id=159405

Patch by Miguel Gomez <magomez@igalia.com> on 2016-07-07
Reviewed by Xabier Rodriguez-Calvar.

Implement video frame painting to the canvas when accelerated compositing is enabled.

Already covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
Replace custom enumeration for the video rotation with the ImageOrientation class.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
Replace the orientation value comparison with ImageOrientation::usesWidthAsHeight().
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
Perform the frame painting taking into account the video orientation tag.
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
Rotate the native image before returning it.
(WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
Replace custom enumeration for the video rotation with the ImageOrientation class.
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted.
Remove orientation initialization.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Remove custom enumeration for the video orientation.

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

4 years agoTweak mathml/presentation/semantics.html to make it pass on iOS
fred.wang@free.fr [Thu, 7 Jul 2016 11:57:22 +0000 (11:57 +0000)]
Tweak mathml/presentation/semantics.html to make it pass on iOS
https://bugs.webkit.org/show_bug.cgi?id=159457

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

* mathml/presentation/semantics-expected.html: Force a line break between the two tests.
* mathml/presentation/semantics.html: Ditto.
* platform/ios-simulator-wk1/TestExpectations: Remove failure expectation.
* platform/ios-simulator-wk2/TestExpectations: Ditto.

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

4 years ago[ARMv7] REGRESSION(r197655): ASSERTION FAILED: (cond == Zero) || (cond == NonZero)
ossy@webkit.org [Thu, 7 Jul 2016 08:32:50 +0000 (08:32 +0000)]
[ARMv7] REGRESSION(r197655): ASSERTION FAILED: (cond == Zero) || (cond == NonZero)
https://bugs.webkit.org/show_bug.cgi?id=159419

Reviewed by Benjamin Poulain.

Allow Signed and PositiveOrZero conditions too because tst instruction updates N and Z flags.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchTest32):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branchTest32): Add assertions to avoid possible bugs in the future.

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

4 years ago[Mac][cmake] Unreviewed buildfix after r202889. Just for fun.
ossy@webkit.org [Thu, 7 Jul 2016 08:09:15 +0000 (08:09 +0000)]
[Mac][cmake] Unreviewed buildfix after r202889. Just for fun.

* PlatformMac.cmake:

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

4 years ago[GStreamer][GL] switch to appsink
philn@webkit.org [Thu, 7 Jul 2016 06:58:19 +0000 (06:58 +0000)]
[GStreamer][GL] switch to appsink
https://bugs.webkit.org/show_bug.cgi?id=159466

Reviewed by Carlos Garcia Campos.

Fakesink is mostly used for tests. Appsink provides the same
functionality and is actually meant to be used on application
side.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::newSampleCallback):
(WebCore::newPrerollCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
(WebCore::MediaPlayerPrivateGStreamerBase::drawCallback): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

4 years agoBuiltin generator should use pragma once for header files
commit-queue@webkit.org [Thu, 7 Jul 2016 06:22:23 +0000 (06:22 +0000)]
Builtin generator should use pragma once for header files
https://bugs.webkit.org/show_bug.cgi?id=159462

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-06
Reviewed by Alex Christensen.

* Scripts/builtins/builtins_generate_combined_header.py:
(BuiltinsCombinedHeaderGenerator.generate_output):
* Scripts/builtins/builtins_generate_separate_header.py:
(BuiltinsSeparateHeaderGenerator.generate_output):
* Scripts/builtins/builtins_templates.py:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:

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

4 years agoDocument.title setter does not work for SVG documents
cdumez@apple.com [Thu, 7 Jul 2016 05:55:30 +0000 (05:55 +0000)]
Document.title setter does not work for SVG documents
https://bugs.webkit.org/show_bug.cgi?id=159503
<rdar://problem/27212313>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that all checks are passing.

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

Source/WebCore:

Document.title setter should work for SVG documents:
- https://html.spec.whatwg.org/multipage/dom.html#document.title

This patch aligns our behavior with the specification
and with Firefox / Chrome.

No new tests, rebaselined existing test.

* dom/Document.cpp:
(WebCore::Document::setTitle):
- Reverse the if conditions for clarity.
- If the document element is an SVG svg element, create a
  SVGTitleElement and insert it as first child of the
  document element.
- Call SVGTitleElement::setText() instead of
  HTMLTitleElement::setText() at the end of the method if
  m_titleElement is a SVGTitleElement.

(WebCore::Document::updateTitleElement):
- If document element is an SVG svg element, use the first
  child of the document element that is a SVGTitleElement.

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::setText):
* svg/SVGTitleElement.h:
Add SVGTitleElement::setText() method that does the same
thing as HTMLTitleElement::setText().

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

4 years agoSome API tests started failing after r202889
timothy_horton@apple.com [Thu, 7 Jul 2016 05:41:01 +0000 (05:41 +0000)]
Some API tests started failing after r202889
https://bugs.webkit.org/show_bug.cgi?id=159498

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadHTMLString):
Fix a typo; this is a MIME type, not an encoding :|

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

4 years agoAlign Document.body setter with the HTML specification
cdumez@apple.com [Thu, 7 Jul 2016 04:14:28 +0000 (04:14 +0000)]
Align Document.body setter with the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=159490

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline existing W3C test now that one more check is passing.

* web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body-expected.txt:

Source/WebCore:

Align Document.body setter with the HTML specification:
- https://html.spec.whatwg.org/multipage/dom.html#dom-document-body

In particular, the following web-exposed changes were made:
- It is now possible to set document.body to a frameset element.
- We no longer call importNode() on the passed in body. Therefore,
  if the body comes from another document, its will be adopted /
  transferred rather than cloned.

Both changes match the behavior of Firefox and Chrome.

No new tests, updated / rebaselined existing tests.

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

LayoutTests:

Update existing test that was setting a document's body to another frame's body
as it was expecting the body element to get cloned rather than adopted / transferred.

* fast/dom/document-set-body-expected.txt:
* fast/dom/document-set-body.html:

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

4 years agoFix my bogus json I landed earlier today.
beidson@apple.com [Thu, 7 Jul 2016 03:38:48 +0000 (03:38 +0000)]
Fix my bogus json I landed earlier today.

* features.json:

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

4 years agoWeb Inspector: REGRESSION: Hitting ⌘T in Web Inspector no longer opens in new tab...
timothy@apple.com [Thu, 7 Jul 2016 03:25:51 +0000 (03:25 +0000)]
Web Inspector: REGRESSION: Hitting ⌘T in Web Inspector no longer opens in new tab in Safari
https://bugs.webkit.org/show_bug.cgi?id=159487
rdar://problem/27188047

Change Command-T to Command-Option-T to open a new tab.

I also changed Command-1, etc. to Command-Option-1, etc. to switch tabs. The number commands
conflicted similarly with Safari and didn't work for me as a Web Inspector shortcut at all.
We can't use Command-Shift because of Command-Shift-3 and Command-Shift-4 for screenshots.

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):

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

4 years ago[JSC] Unify how we throw TypeError from C++
benjamin@webkit.org [Thu, 7 Jul 2016 03:12:37 +0000 (03:12 +0000)]
[JSC] Unify how we throw TypeError from C++
https://bugs.webkit.org/show_bug.cgi?id=159500

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-06
Reviewed by Saam Barati.

Source/JavaScriptCore:

Throwing a TypeError is an uncommon case. We should minimize the impact
on the call sites.

This patch does that by:
-Replace the 2 calls createTypeError()->throwException() by throwTypeError().
-Use ASCIILiteral when possible.
-Add an overload of throwTypeError() taking ASCIILiteral directly
 (that way, the String creation and destruction is done by the callee).

On x86_64, this reduces the __TEXT__ segment by 29kb.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* jit/JITOperations.cpp:
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToJSON):
* runtime/Error.cpp:
(JSC::throwConstructorCannotBeCalledAsFunctionTypeError):
(JSC::throwTypeError):
* runtime/Error.h:
(JSC::throwVMTypeError):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::toStringSlowCase):
* runtime/JSCJSValueInlines.h:
(JSC::toPreferredPrimitiveType):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncSet):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoFuncSubarray):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoGetter):
(JSC::globalFuncProtoSetter):
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::ordinaryToPrimitive):
(JSC::JSObject::defaultHasInstance):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::constructTypedArrayView):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncLength):
(JSC::typedArrayViewProtoFuncSet):
(JSC::typedArrayViewProtoFuncCopyWithin):
(JSC::typedArrayViewProtoFuncFill):
(JSC::typedArrayViewProtoFuncLastIndexOf):
(JSC::typedArrayViewProtoFuncIndexOf):
(JSC::typedArrayViewProtoFuncJoin):
(JSC::typedArrayViewProtoGetterFuncBuffer):
(JSC::typedArrayViewProtoGetterFuncLength):
(JSC::typedArrayViewProtoGetterFuncByteLength):
(JSC::typedArrayViewProtoGetterFuncByteOffset):
(JSC::typedArrayViewProtoFuncReverse):
(JSC::typedArrayViewProtoFuncSubarray):
(JSC::typedArrayViewProtoFuncSlice):
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::objectConstructorDefineProperties):
(JSC::objectConstructorCreate):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
* runtime/Symbol.cpp:
(JSC::Symbol::toNumber):

Source/WebCore:

* bindings/js/JSBiquadFilterNodeCustom.cpp:
(WebCore::JSBiquadFilterNode::setType):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getBigIntegerVectorFromJSON):
(WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
(WebCore::tryJWKKeyOpsValue):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::JSCryptoKeySerializationJWK::keyData):
(WebCore::addJWKAlgorithmToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue):
* bindings/js/JSDOMBinding.cpp:
(WebCore::enforceRange):
(WebCore::throwTypeError):
(WebCore::throwArgumentMustBeEnumError):
(WebCore::throwArgumentMustBeFunctionError):
(WebCore::throwArgumentTypeError):
(WebCore::throwArrayElementTypeError):
(WebCore::throwGetterTypeError):
(WebCore::throwThisTypeError):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::defineElement):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSModuleLoader.cpp:
(WebCore::JSModuleLoader::evaluate):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSOscillatorNodeCustom.cpp:
(WebCore::JSOscillatorNode::setType):
* bindings/js/JSPannerNodeCustom.cpp:
(WebCore::JSPannerNode::setPanningModel):
(WebCore::JSPannerNode::setDistanceModel):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamController):
(WebCore::constructJSReadableStreamReader):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::importKey):
(WebCore::exportKey):
* bindings/js/ReadableStreamController.cpp:
(WebCore::ReadableStreamController::invoke):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::throwValidationError):
(WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::setValueAt):

Source/WebKit/mac:

* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::invokeMethod):

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

4 years agoEmail from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
timothy_horton@apple.com [Thu, 7 Jul 2016 03:03:42 +0000 (03:03 +0000)]
Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
https://bugs.webkit.org/show_bug.cgi?id=159498
<rdar://problem/26719903>

Reviewed by Sam Weinig.

Source/WebCore:

New API test: WebKit2.DataDetectionReferenceDate

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Extract the reference date from the DataDetectors context dictionary if it exists,
and pass it along to DataDetectors.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/FrameLoaderClient.h:
Plumb the DataDetectors context dictionary through from WebPage.

Source/WebKit2:

* Shared/Cocoa/LoadParametersCocoa.mm: Added.
(WebKit::LoadParameters::platformEncode):
(WebKit::LoadParameters::platformDecode):
* Shared/LoadParameters.cpp: Added.
(WebKit::LoadParameters::encode):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h: Added.
Add a struct that knows how to encode all of the different parameters
to all of the Load* messages, including the platform-specific DataDetectors parameters.

* Shared/mac/ArgumentCodersMac.h:
* Shared/mac/ArgumentCodersMac.mm:
(IPC::typeFromObject):
(IPC::encode):
(IPC::decode):
Add NSURL coders that defer to the CFURL coders.

* UIProcess/API/APIUIClient.h:
(API::UIClient::dataDetectionContext):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::dataDetectionContext):
Add APIUIClient methods to retrieve the DataDetectors context dictionary.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::addPlatformLoadParameters):
Add the DataDetectors context dictionary to the given LoadParameters.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dataDetectionContext):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::dataDetectionContext):
Store the dataDetectionContext on WebPage, and make it accessible to WebCore
via the FrameLoaderClient (it is used in FrameLoader when the load completes).

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadHTMLString):
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::loadStringImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadString):
(WebKit::WebPage::loadAlternateHTMLString):
(WebKit::WebPage::loadHTMLString): Deleted.
(WebKit::WebPage::loadPlainTextString): Deleted.
(WebKit::WebPage::loadWebArchiveData): Deleted.
* WebProcess/WebPage/WebPage.messages.in:
Adopt LoadParameters, taking this opportunity to reduce the number of very similar messages.
We can take this further (we should be able to get it down to just LoadRequest
and LoadData) in the future. When any load occurs, grab the client's DataDetectorse
context dictionary and send it along with the load request, storing it in WebPage.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm: Added.
(-[DataDetectionNavigationDelegate webView:didFinishNavigation:]):
(-[DataDetectionUIDelegate _dataDetectionContextForWebView:]):
(expectLinkCount):
(TEST):
Add a test ensuring that ReferenceDate in the DataDetectors context is respected
when deciding what to linkify.

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

4 years ago[WK2][Cocoa] Disable ResourceResponse lazy initialization
cdumez@apple.com [Thu, 7 Jul 2016 01:32:43 +0000 (01:32 +0000)]
[WK2][Cocoa] Disable ResourceResponse lazy initialization
https://bugs.webkit.org/show_bug.cgi?id=159497
<rdar://problem/27209066>

Reviewed by Alex Christensen.

Source/WebCore:

Add method to Cocoa's ResponseResponse header to disable
lazy initialization.

* platform/network/cf/ResourceResponse.h:
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::disableLazyInitialization):

Source/WebKit2:

Disable ResourceResponse lazy initialization for WebKit2 as
we always end up initializing all the fields anyway when
sending the response to the WebContent process via IPC.

Even worse, we always do a partial lazy initialization (common
fields only) before the IPC so we always do the initialization
in 2 steps. This normally would not be an issue but the 2 steps
actually have some overlap because both call
CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
<rdar://problem/26796059>) to first get the common HTTP headers,
then ALL the HTTP headers.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):

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

4 years agoReturn values of JSArray::createUninitialized (and related) are not consistently...
bfulgham@apple.com [Thu, 7 Jul 2016 01:02:57 +0000 (01:02 +0000)]
Return values of JSArray::createUninitialized (and related) are not consistently checked for nullptr
https://bugs.webkit.org/show_bug.cgi?id=159495
<rdar://problem/26075433>

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/canvas/canvas-getImageData-invalid-result-buffer-crash.html

* html/ImageData.cpp:
(WebCore::ImageData::ImageData): Assert at construction if we could not create a valid
buffer.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::createArrayBuffer): Check for a null buffer before using it.
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData): Ditto.
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware): Ditto.
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::copyImageBytes): Ditto.
(WebCore::FilterEffect::copyUnmultipliedImage): Ditto.
(WebCore::FilterEffect::copyPremultipliedImage): Ditto.

LayoutTests:

* fast/canvas/canvas-getImageData-invalid-result-buffer-crash.html: Added.
* fast/canvas/canvas-getImageData-invalid-result-buffer-crash-expected.txt: Added.

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

4 years agoMarking media/restore-from-page-cache.html as a flaky crash on mac-wk2 debug
ryanhaddad@apple.com [Thu, 7 Jul 2016 00:33:51 +0000 (00:33 +0000)]
Marking media/restore-from-page-cache.html as a flaky crash on mac-wk2 debug
https://bugs.webkit.org/show_bug.cgi?id=159430

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoMore test gardening after r202835.
ryanhaddad@apple.com [Thu, 7 Jul 2016 00:20:40 +0000 (00:20 +0000)]
More test gardening after r202835.

Unreviewed test gardening.

* platform/mac-elcapitan/fast/attachment/attachment-select-on-click-expected.txt: Copied from LayoutTests/platform/mac/fast/attachment/attachment-select-on-click-expected.txt.
* platform/mac/fast/attachment/attachment-select-on-click-expected.png:
* platform/mac/fast/attachment/attachment-select-on-click-expected.txt:

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

4 years ago[iOS] Text suggestions should be cleared when form input session is invalidated
commit-queue@webkit.org [Wed, 6 Jul 2016 23:37:58 +0000 (23:37 +0000)]
[iOS] Text suggestions should be cleared when form input session is invalidated
https://bugs.webkit.org/show_bug.cgi?id=159477

Patch by Chelsea Pugh <cpugh@apple.com> on 2016-07-06
Reviewed by Dan Bernstein.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession invalidate]): Set input delegate's suggestions to nil when a form input session is
invalidated. This will set the keyboard QuickType suggestions back to their default values.

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

4 years agoBuild fix - work around rdar://problem/27196668.
ap@apple.com [Wed, 6 Jul 2016 23:13:29 +0000 (23:13 +0000)]
Build fix - work around rdar://problem/27196668.

* LayoutTestRelay/Configurations/Base.xcconfig:

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

4 years agoCall continueCanAuthenticateAgainstProtectionSpace when cancelling loads waiting...
achristensen@apple.com [Wed, 6 Jul 2016 22:39:43 +0000 (22:39 +0000)]
Call continueCanAuthenticateAgainstProtectionSpace when cancelling loads waiting for the callback
https://bugs.webkit.org/show_bug.cgi?id=159492
<rdar://problem/26921670>

Reviewed by Brady Eidson.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkLoad.h:

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

4 years agoDocument.body should return the first child of the html element that is either a...
cdumez@apple.com [Wed, 6 Jul 2016 22:13:18 +0000 (22:13 +0000)]
Document.body should return the first child of the html element that is either a body / frameset element
https://bugs.webkit.org/show_bug.cgi?id=159488

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Import corresponding W3C test.

* web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body-expected.txt: Added.
* web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html: Added.

Source/WebCore:

Document.body should return the first child of the html element that is
either a body / frameset element:
- https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
- https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2

We used the first child of the *document* element that is either a
body / frameset element, even if the document element is not an html
element.

Firefox and Chrome match the specification.

Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html

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

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

4 years agoAdopt new PiP glyph
dino@apple.com [Wed, 6 Jul 2016 21:54:45 +0000 (21:54 +0000)]
Adopt new PiP glyph
https://bugs.webkit.org/show_bug.cgi?id=159494
<rdar://problem/27061084>

Reviewed by Ada Chan.

We got new artwork for Picture-in-Picture on macOS from
our designers.

* Modules/mediacontrols/mediaControlsApple.css:
(video::-webkit-media-controls-panel .picture-in-picture-button):
(video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):

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

4 years agoRebaseline inspector/model/remote-object.html after r202873
ryanhaddad@apple.com [Wed, 6 Jul 2016 21:39:40 +0000 (21:39 +0000)]
Rebaseline inspector/model/remote-object.html after r202873

Unreviewed test gardening.

* platform/mac/inspector/model/remote-object-expected.txt:

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

4 years ago[RTL Scrollbars] RTL Scrollbars broken with clients creating Web Views via [WKView...
mmaxfield@apple.com [Wed, 6 Jul 2016 21:23:13 +0000 (21:23 +0000)]
[RTL Scrollbars] RTL Scrollbars broken with clients creating Web Views via [WKView initWithFrame:contextRef:pageGroupRef:]
https://bugs.webkit.org/show_bug.cgi?id=159383
<rdar://problem/26921117>

Reviewed by Anders Carlsson.

The code which consults with the userInterfaceLayoutDirection of the view is
inside [WKWebView _initializeWithConfiguration:]. However, some clients create
Web Views via [WKView initWithFrame:contextRef:pageGroupRef:] which doesn't
call this code. Therefore, this codepath should do the same kind of direction
consulting.

* UIProcess/API/mac/WKView.mm:
(toUserInterfaceLayoutDirection):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):

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

4 years agoUnreviewed, rolling out r202867.
ryanhaddad@apple.com [Wed, 6 Jul 2016 21:10:28 +0000 (21:10 +0000)]
Unreviewed, rolling out r202867.
https://bugs.webkit.org/show_bug.cgi?id=159491

This change caused an existing LayoutTest to crash on ios-
simulator (Requested by ryanhaddad on #webkit).

Reverted changeset:

"<img> with a wide gamut PDF does not display using a wide
gamut color space"
https://bugs.webkit.org/show_bug.cgi?id=158983
http://trac.webkit.org/changeset/202867

Patch by Commit Queue <commit-queue@webkit.org> on 2016-07-06

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

4 years agoWeb Inspector: sometimes reloading a page with main resource selected will show an...
joepeck@webkit.org [Wed, 6 Jul 2016 20:23:36 +0000 (20:23 +0000)]
Web Inspector: sometimes reloading a page with main resource selected will show an empty content view
https://bugs.webkit.org/show_bug.cgi?id=158069
<rdar://problem/26516710>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
Continue until we get one that works.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
Avoid showing a content view for a background tab if it could steal
the content view from a foreground tab. This is a targeted fix for
reload + tab content view loading behavior. A more general fix would
be reducing the work done by non-foreground tabs.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser.prototype._tabBarItemSelected):
Update navigation sidebar first so it is set when showing the TabContentView.

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

4 years agoWeb Inspector: Uncaught Exception reporter should include the currently dispatching...
bburg@apple.com [Wed, 6 Jul 2016 20:22:46 +0000 (20:22 +0000)]
Web Inspector: Uncaught Exception reporter should include the currently dispatching protocol event or request/response if applicable
https://bugs.webkit.org/show_bug.cgi?id=159320
<rdar://problem/27117754>

Reviewed by Timothy Hatcher and Joseph Pecoraro.

Keep track of the currently dispatched protocol response or protocol event and make
them available to the uncaught exception reporter. If an internal exception is reported
while dispatching an event or response, dump the protocol message(s) into the pre-filled
bug report.

* UserInterface/Debug/UncaughtExceptionReporter.js:
(stringifyAndTruncateObject): Added.
Rearrange the code that generates the pre-filled report so it's easier to add optional sections.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.get currentDispatchState): Expose the dispatching state.
(InspectorBackendClass.prototype._sendCommandToBackendWithCallback):
(InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise):
Store the originating command request with the pendingResponse data so that we can examine
the originating request if the response causes an error. This will cause request message objects
to be garbage-collected after their responses are dispatched rather than when the request is sent.
But, I don't forsee this being a performance problem since we should always get a command response
and pending command responses do not typically accumulate except when the inspector first loads.

(InspectorBackendClass.prototype._dispatchResponse): Save the response being dispatched.
(InspectorBackendClass.prototype._dispatchResponseToCallback): Simplify exception reporting.
(InspectorBackendClass.prototype._dispatchEvent): Save the event being dispatched.

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

4 years agoCorrect a typo in the Mac TestExpectations file.
ryanhaddad@apple.com [Wed, 6 Jul 2016 20:14:38 +0000 (20:14 +0000)]
Correct a typo in the Mac TestExpectations file.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years ago[ShadowDOM] assignedSlot property should be on Text, not CharacterData
cdumez@apple.com [Wed, 6 Jul 2016 20:09:32 +0000 (20:09 +0000)]
[ShadowDOM] assignedSlot property should be on Text, not CharacterData
https://bugs.webkit.org/show_bug.cgi?id=159482
<rdar://problem/27201687>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

assignedSlot property should be on Text, not CharacterData as per:
- https://dom.spec.whatwg.org/#mixin-slotable

Align with the latest specification.

No new tests, rebaselined existing test.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.idl:
* dom/NonDocumentTypeChildNode.idl:
* dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
* dom/Text.idl:

LayoutTests:

Update / rebaseline a couple of existing tests.

* fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt.
* fast/shadow-dom/Slotable-interface-assignedSlot.html: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html.
* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

4 years agoDo not animate video fullscreen exit when page has navigated away.
commit-queue@webkit.org [Wed, 6 Jul 2016 20:03:09 +0000 (20:03 +0000)]
Do not animate video fullscreen exit when page has navigated away.
https://bugs.webkit.org/show_bug.cgi?id=159479

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-07-06
Reviewed by Eric Carlson.

No new tests there is no effect on the DOM. The only effect is to video fullscreen window animation.

When the page has been navigated away, the fullscreen or picture-in-picture window should
not animate back inline in the page, since the page has already navigated to a new page.
Instead exit the fullscreen mode without animating.

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

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

4 years agoSignal that media element is prepared for inline when being stopped since script...
commit-queue@webkit.org [Wed, 6 Jul 2016 20:02:11 +0000 (20:02 +0000)]
Signal that media element is prepared for inline when being stopped since script won't be able to.
https://bugs.webkit.org/show_bug.cgi?id=159163
rdar://problem/26844557

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-07-06
Reviewed by Jer Noble.

No new tests since this don't change behavior in the DOM. It prevents a race that could cause
fullscreen and picture in picture to fail to tear down completely.

When an element exits a fullscreen mode and is immediately removed from the DOM by the page,
its JavaScript stops running. The fullscreen code is then blocked waiting for JS to signal
that it has updated its state in preparation for inline mode. This change explicitly signals
this since JS wont be able to.

Additionally, when going from PiP back to inline, don't go through fullscreen first, when the
request comes from the DOM. This was causing the presentation mode to become confused. The
page requests inline. PiP would exit back to fullscreen and set the presentation mode to
fullscreen. Then it would exit fullscreen back to inline, but the DOM still had the wrong
presentation mode. Skipping this removes an unnecessary step in the animation and keeps the
presentation mode state consistent.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Set prepared for inline.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Return directly to inlne.

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

4 years agoAdd support for Node.isConnected
cdumez@apple.com [Wed, 6 Jul 2016 19:54:07 +0000 (19:54 +0000)]
Add support for Node.isConnected
https://bugs.webkit.org/show_bug.cgi?id=159474
<rdar://problem/27197947>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/dom/interfaces-expected.txt:
Rebaseline now that more checks are passing.

* web-platform-tests/dom/nodes/Node-isConnected-expected.txt: Added.
* web-platform-tests/dom/nodes/Node-isConnected.html: Added.
Import W3C test for Node.isConnected.

Source/WebCore:

Add support for Node.isConnected as per:
- https://dom.spec.whatwg.org/#dom-node-isconnected

Chrome already supports this.

Test: imported/w3c/web-platform-tests/dom/nodes/Node-isConnected.html

* dom/Node.idl:

LayoutTests:

Rebaseline test now that a new property is exposed on nodes.

* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

4 years agoUpdate IndexedDB's status on the feature page (How had we not done this already?)
beidson@apple.com [Wed, 6 Jul 2016 19:17:25 +0000 (19:17 +0000)]
Update IndexedDB's status on the feature page (How had we not done this already?)

Rubberstamped by Sam Weinig.

* features.json:

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

4 years agoLimit touch distance for two finger tap.
enrica@apple.com [Wed, 6 Jul 2016 19:04:50 +0000 (19:04 +0000)]
Limit touch distance for two finger tap.
https://bugs.webkit.org/show_bug.cgi?id=159476
rdar://problem/26439052

Reviewed by Beth Dakin.

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

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

4 years ago<img> with a wide gamut PDF does not display using a wide gamut color space
commit-queue@webkit.org [Wed, 6 Jul 2016 18:46:51 +0000 (18:46 +0000)]
<img> with a wide gamut PDF does not display using a wide gamut color space
https://bugs.webkit.org/show_bug.cgi?id=158983
<rdar://problem/25720247>

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

Source/WebCore:

Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit
color space will now infer the color space from the provided graphics context
on platforms using CG. The method signature that takes in a GraphicsContext
without a color space is now split into a CG-specified implementation and a
Cairo one to avoid having diverging platform code in ImageBuffer.cpp.

Some call sites need to provide an explicit color space still, so we add a new
ImageBuffer::createCompatibleBuffer() that allows for that while inferring
sizing and scaling from a GraphicsContext.

All signatures of ImageBuffer::createCompatibleBuffer() are losing the
hasAlpha parameter which was always ignored. All call sites that were using
hasAlpha have been updated.

In addition, we make all the IOSurface and IOSurfacePool code, which is
CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace
so that we may pick up on the color space copied over from the graphics context
in the CG-specific implementation of ImageBuffer::createCompatibleBuffer().

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/ImageBuffer.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::takeSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::surfaceFromPool):
(WebCore::IOSurface::create):
(WebCore::IOSurface::createFromSendRight):
(WebCore::IOSurface::createFromSurface):
(WebCore::IOSurface::createFromImage):
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* platform/spi/cg/CoreGraphicsSPI.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintProgressBar):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::bufferForeground):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):

Source/WebKit2:

ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::decode):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

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

4 years agoInlineAccess::sizeForLengthAccess() is wrong on some platforms because it should...
sbarati@apple.com [Wed, 6 Jul 2016 18:23:38 +0000 (18:23 +0000)]
InlineAccess::sizeForLengthAccess() is wrong on some platforms because it should also consider "length" not being array length
https://bugs.webkit.org/show_bug.cgi?id=159429

Reviewed by Filip Pizlo.

The calculation inside sizeForLengthAccess() was not taking into
account that an access to a "length" property might not be an
array length access. sizeForLengthAccess() should always have enough
room for a regular self property accesses. This only changes how
much of a nop sled we emit if array length access size is smaller
than self access size. This matters on ARM64.

* bytecode/InlineAccess.h:
(JSC::InlineAccess::sizeForPropertyAccess):
(JSC::InlineAccess::sizeForPropertyReplace):
(JSC::InlineAccess::sizeForLengthAccess):

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

4 years agoUnreviewed, rolling out r198928 and r198985.
commit-queue@webkit.org [Wed, 6 Jul 2016 18:22:17 +0000 (18:22 +0000)]
Unreviewed, rolling out r198928 and r198985.
https://bugs.webkit.org/show_bug.cgi?id=159478

"It's breaking some websites" (Requested by saamyjoon on
#webkit).

Reverted changesets:

"[ES6] Disallow var assignments in for-in loops"
https://bugs.webkit.org/show_bug.cgi?id=155451
http://trac.webkit.org/changeset/198928

"Unreviewed, turn ES6 for-in loop test success"
https://bugs.webkit.org/show_bug.cgi?id=155451
http://trac.webkit.org/changeset/198985

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

4 years agoMarking inspector/debugger/tail-deleted-frames-from-vm-entry.html as flaky on mac...
ryanhaddad@apple.com [Wed, 6 Jul 2016 18:15:23 +0000 (18:15 +0000)]
Marking inspector/debugger/tail-deleted-frames-from-vm-entry.html as flaky on mac-wk2 debug
https://bugs.webkit.org/show_bug.cgi?id=159447

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoLong spin editing text at top of message containing Reader version of web page with...
timothy_horton@apple.com [Wed, 6 Jul 2016 17:34:19 +0000 (17:34 +0000)]
Long spin editing text at top of message containing Reader version of web page with many GIFs
https://bugs.webkit.org/show_bug.cgi?id=159444
<rdar://problem/26790386>

Reviewed by Sam Weinig.

* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement):
Instead of looking up the image's data in the cache by URL, just use the
CachedImage on the HTMLImageElement. There are situations (which seem to involve
cloning the DOM then having the cloned DOM get garbage collected) where the image
can be removed from the cache, but still be live in the document.

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

4 years agoRename VM stack limit fields to better describe their purpose.
mark.lam@apple.com [Wed, 6 Jul 2016 17:19:20 +0000 (17:19 +0000)]
Rename VM stack limit fields to better describe their purpose.
https://bugs.webkit.org/show_bug.cgi?id=159451

Reviewed by Keith Miller.

This is in preparation for an upcoming patch that changes what stack limit values
are used under various circumstances.  This patch aims to do some minimal work to
rename the fields so that it will be easier to reason about the upcoming patch.

In this patch, we make the following changes:

1. Rename VM::m_stackLimit to VM::m_jsCPUStackLimit.

2. VM::m_jsStackLimit used to have an overloaded meaning:
   a. For JIT builds, m_jsStackLimit is synonymous with m_stackLimit.
   b. For C Loop builds, m_jsStackLimit is a separate pointer that points to the
      emulated JS stack that the C Loop uses.

   In place of m_jsStackLimit, this patch introduces 2 new fields:
   VM::m_jsEmulatedStackLimit and VM::m_llintStackLimit.

   m_llintStackLimit is the limit that the LLInt assembly uses for its stack
   check.  m_llintStackLimit behaves like the old m_jsStackLimit in that:
   a. For JIT builds, m_llintStackLimit is synonymous with m_jsCPUStackLimit.
   b. For C Loop builds, m_llintStackLimit is synonymous with m_jsEmulatedStackLimit.

   m_jsEmulatedStackLimit is used for the emulated stack that the C Loop uses.

3. Rename the following methods to match the above:
     VM::stackLimit() ==> VM::jsCPUStackLimit()
     VM::addressOfStackLimit() ==> VM::addressOfJSCPUStackLimit()
     VM::jsStackLimit() ==> VM::jsEmulatedStackLimit()
     VM::setJSStackLimit() ==> VM::setJSEmulatedStackLimit()
     JSStack::setStackLimit() ==> JSStack::setEmulatedStackLimit()

4. With change (2) and (3), the limits will be used as follows:
   a. VM code doing stack recursion checks will only use m_jsCPUStackLimit.
   b. JIT code will only use m_jsCPUStackLimit.
   c. C Loop emulated stack code in JSStack will only use m_jsEmulatedStackLimit.
      Note: the part of JSStack that operates on a JIT build will use
            m_jsCPUStackLimit as expected.
   d. LLINT assembly code will only use m_llintStackLimit.

This patch only contains the above refactoring changes.  There is no behavior
change.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* interpreter/JSStack.cpp:
(JSC::JSStack::JSStack):
(JSC::JSStack::growSlowCase):
(JSC::JSStack::lowAddress):
(JSC::JSStack::highAddress):
* interpreter/JSStack.h:
* interpreter/JSStackInlines.h:
(JSC::JSStack::ensureCapacityFor):
(JSC::JSStack::shrink):
(JSC::JSStack::grow):
(JSC::JSStack::setJSEmulatedStackLimit):
(JSC::JSStack::setStackLimit): Deleted.
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateStackLimit):
* runtime/VM.h:
(JSC::VM::reservedZoneSize):
(JSC::VM::jsCPUStackLimit):
(JSC::VM::addressOfJSCPUStackLimit):
(JSC::VM::jsEmulatedStackLimit):
(JSC::VM::setJSEmulatedStackLimit):
(JSC::VM::isSafeToRecurse):
(JSC::VM::jsStackLimit): Deleted.
(JSC::VM::setJSStackLimit): Deleted.
(JSC::VM::stackLimit): Deleted.
(JSC::VM::addressOfStackLimit): Deleted.
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):

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

4 years ago[Win] Add null pointer check in gesture handling.
pvollan@apple.com [Wed, 6 Jul 2016 17:04:28 +0000 (17:04 +0000)]
[Win] Add null pointer check in gesture handling.
https://bugs.webkit.org/show_bug.cgi?id=159454

Reviewed by Brent Fulgham.

* WebView.cpp:
(WebView::gesture):

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

4 years agoHold RefPtr<>'s to UniqueIDBDatabases while performing user delete.
beidson@apple.com [Wed, 6 Jul 2016 16:58:37 +0000 (16:58 +0000)]
Hold RefPtr<>'s to UniqueIDBDatabases while performing user delete.
https://bugs.webkit.org/show_bug.cgi?id=159471

Reviewed by Brent Fulgham.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):

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

4 years agoLand test expectations for rdar://problem/27187013.
ryanhaddad@apple.com [Wed, 6 Jul 2016 16:57:41 +0000 (16:57 +0000)]
Land test expectations for rdar://problem/27187013.

* platform/mac/TestExpectations:

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

4 years agoUnreviewed, rolling out r202725.
commit-queue@webkit.org [Wed, 6 Jul 2016 16:57:25 +0000 (16:57 +0000)]
Unreviewed, rolling out r202725.
https://bugs.webkit.org/show_bug.cgi?id=159473

didn't reduce coreui memory usage (Requested by kling on
#webkit).

Reverted changeset:

"[Mac] Get rid of the old timey rubber-banding linen pattern."
https://bugs.webkit.org/show_bug.cgi?id=159329
http://trac.webkit.org/changeset/202725

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

4 years ago[GStreamer] duration query improvements
philn@webkit.org [Wed, 6 Jul 2016 13:27:40 +0000 (13:27 +0000)]
[GStreamer] duration query improvements
https://bugs.webkit.org/show_bug.cgi?id=159458

Reviewed by Carlos Garcia Campos.

Currently the player caches the result of the duration query but
this is overkill because it's cached by playbin already. The only
time where the player needs to cache the duration is when EOS was
reached because in that situation the query would fail.

No new tests, existing media tests cover this patch.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Member variables update.
(WebCore::MediaPlayerPrivateGStreamer::load): Stop the fill timer
before loading a new URL, the same player can be used for
different assets.
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition): Perform
a duration query, the duration value is no longer locally cached.
(WebCore::MediaPlayerPrivateGStreamer::duration): Return cached value only after EOS was reached.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Perform
a duration query, the duration value is no longer locally cached.
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Remove duration caching support.
(WebCore::MediaPlayerPrivateGStreamer::didEnd): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::durationChanged): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::cacheDuration): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

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

4 years ago[css-grid] Height percentages are not properly resolved for item's children
rego@igalia.com [Wed, 6 Jul 2016 13:02:43 +0000 (13:02 +0000)]
[css-grid] Height percentages are not properly resolved for item's children
https://bugs.webkit.org/show_bug.cgi?id=159258

Reviewed by Sergio Villar Senin.

Source/WebCore:

When grid items are vertically stretched (default behavior)
they store their height on RenderBox::overrideLogicalContentHeight().
In order to resolve the percentage height on the grid item's children
we need to use that size.

Test: fast/css-grid-layout/percent-resolution-grid-item-children.html

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

LayoutTests:

* fast/css-grid-layout/percent-resolution-grid-item-children-expected.txt: Added.
* fast/css-grid-layout/percent-resolution-grid-item-children.html: Added.

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

4 years agoDuplicated code in DrawingAreaImpl and CoordinatedDrawingArea
carlosgc@webkit.org [Wed, 6 Jul 2016 11:32:07 +0000 (11:32 +0000)]
Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
https://bugs.webkit.org/show_bug.cgi?id=159259

Reviewed by Žan Doberšek.

It seems that CoordinatedDrawingArea is just a copy paste of DrawingAreaImpl with non-accelerated code path
removed. There's actually nothing (or very little) specific to coordinated graphics in the
CoordinatedDrawingArea implementation. This patch renames CoordinatedDrawingArea as AcceleratedDrawingArea and
makes DrawingAreaImpl inherit from it, so that in case of accelerated compositing the parent class is used, and
DrawingAreaImpl only adds the non accelerated code path.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp.
(WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea):
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
(WebKit::AcceleratedDrawingArea::setNeedsDisplay):
(WebKit::AcceleratedDrawingArea::setNeedsDisplayInRect):
(WebKit::AcceleratedDrawingArea::scroll):
(WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged):
(WebKit::AcceleratedDrawingArea::setLayerTreeStateIsFrozen):
(WebKit::AcceleratedDrawingArea::forceRepaint):
(WebKit::AcceleratedDrawingArea::forceRepaintAsync):
(WebKit::AcceleratedDrawingArea::setPaintingEnabled):
(WebKit::AcceleratedDrawingArea::updatePreferences):
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
(WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
(WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
(WebKit::AcceleratedDrawingArea::setRootCompositingLayer):
(WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlush):
(WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlushImmediately):
(WebKit::AcceleratedDrawingArea::updateBackingStoreState):
(WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
(WebKit::AcceleratedDrawingArea::suspendPainting):
(WebKit::AcceleratedDrawingArea::resumePainting):
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
(WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage):
(WebKit::AcceleratedDrawingArea::viewStateDidChange):
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h.
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModePending):
(WebKit::AcceleratedDrawingArea::didUpdateBackingStoreState):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingMode):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::forceRepaint):
(WebKit::DrawingAreaImpl::setRootCompositingLayer):
(WebKit::DrawingAreaImpl::updateBackingStoreState):
(WebKit::DrawingAreaImpl::didUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::suspendPainting):
(WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaImpl::~DrawingAreaImpl): Deleted.
(WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Deleted.
(WebKit::DrawingAreaImpl::updatePreferences): Deleted.
(WebKit::DrawingAreaImpl::didUpdate): Deleted.
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Deleted.
(WebKit::DrawingAreaImpl::scheduleDisplay): Deleted.
(WebKit::DrawingAreaImpl::displayTimerFired): Deleted.
(WebKit::DrawingAreaImpl::display): Deleted.
(WebKit::shouldPaintBoundsRect): Deleted.
(WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): Deleted.
* WebProcess/WebPage/DrawingAreaImpl.h:

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

4 years ago[GTK] Better guard TextureMapper header and CMake includes
zandobersek@gmail.com [Wed, 6 Jul 2016 09:48:01 +0000 (09:48 +0000)]
[GTK] Better guard TextureMapper header and CMake includes
https://bugs.webkit.org/show_bug.cgi?id=159415

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake: Only include TextureMapper.cmake if USE_TEXTURE_MAPPER is enabled.
* platform/graphics/GraphicsContext3DPrivate.h: Guard texmap header inclusions with USE(TEXTURE_MAPPER).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto, but wrap it around
the existing USE(TEXTURE_MAPPER_GL) block.

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

4 years agoLayoutTests/imported/w3c:
commit-queue@webkit.org [Wed, 6 Jul 2016 06:54:52 +0000 (06:54 +0000)]
LayoutTests/imported/w3c:
Refresh WPT tests up to 03916af
https://bugs.webkit.org/show_bug.cgi?id=159420

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-05
Reviewed by Alex Christensen.

Rrefreshing tests.
Used clean option to remove obsolete tests.

* resources/ImportExpectations:
* resources/TestRepositories:
* web-platform-tests/XMLHttpRequest/resources/last-modified.py: Added.
(main):
* web-platform-tests/XMLHttpRequest/resources/w3c-import.log:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties.htm:
* web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type.html: Added.
* web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
* web-platform-tests/XMLHttpRequest/w3c-import.log:
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-scripts-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-scripts.html: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html: Added.
* web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html: Added.
* web-platform-tests/common/entities.json: Added.
* web-platform-tests/common/form-submission.py:
(main):
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt: Removed.
* web-platform-tests/dom/nodes/Node-contains-xhtml.xhtml: Removed.
* web-platform-tests/dom/nodes/rootNode-expected.txt: Removed.
* web-platform-tests/dom/nodes/rootNode.html: Removed.
* web-platform-tests/fetch/api/basic/integrity.js:
* web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt:
* web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt:
* web-platform-tests/fetch/api/basic/mode-no-cors.js:
* web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* web-platform-tests/fetch/api/cors/cors-basic.js:
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies.js:
* web-platform-tests/fetch/api/cors/cors-filtering.js:
* web-platform-tests/fetch/api/cors/cors-multiple-origins.js:
(corsMultipleOrigins):
* web-platform-tests/fetch/api/cors/cors-preflight-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.js:
(corsPreflight):
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js:
* web-platform-tests/fetch/api/redirect/redirect-schemes-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-schemes.html: Added.
* web-platform-tests/fetch/api/request/request-idl.html:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.body-getter-expected.txt: Removed.
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.body-getter.html: Removed.
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.body-setter-01-expected.txt: Removed.
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.body-setter-01.html: Removed.
* web-platform-tests/html/dom/elements-microdata.js: Removed.
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html:
* web-platform-tests/html/semantics/embedded-content/media-elements/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.png: Removed.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:
* web-platform-tests/html/semantics/forms/the-form-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/the-input-element/input-textselection-01-expected.txt: Removed.
* web-platform-tests/html/semantics/forms/the-input-element/input-textselection-01.html: Removed.
* web-platform-tests/html/syntax/html-element-list.js: Added.
* web-platform-tests/html/syntax/w3c-import.log: Renamed from LayoutTests/imported/w3c/web-platform-tests/service-workers/service-workers/resources/w3c-import.log.
* web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/service-workers/service-workers/resources/test-helpers.js.
(service_worker_unregister_and_register):
(service_worker_unregister):
(service_worker_unregister_and_done):
(unreached_fulfillment):
(with_iframe.):
(wait_for_update):
(wait_for_state):
(base_path):
(test_login):
(login_https):
(websocket):
(get_websocket_url):
* web-platform-tests/streams/OWNERS: Added.
* web-platform-tests/streams/byte-length-queuing-strategy.https.html:
* web-platform-tests/streams/count-queuing-strategy.https.html:
* web-platform-tests/streams/readable-streams/bad-strategies.https.html:
* web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html:
* web-platform-tests/streams/readable-streams/brand-checks.https.html:
* web-platform-tests/streams/readable-streams/cancel.https.html:
* web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html:
* web-platform-tests/streams/readable-streams/garbage-collection-1-expected.txt: Removed.
* web-platform-tests/streams/readable-streams/garbage-collection-1.html: Removed.
* web-platform-tests/streams/readable-streams/garbage-collection-2-expected.txt: Removed.
* web-platform-tests/streams/readable-streams/garbage-collection-2.html: Removed.
* web-platform-tests/streams/readable-streams/garbage-collection.https.html:
* web-platform-tests/streams/readable-streams/general.https.html:
* web-platform-tests/streams/readable-streams/pipe-through.https.html:
* web-platform-tests/streams/readable-streams/readable-stream-reader.https.html:
* web-platform-tests/streams/readable-streams/tee.https.html:
* web-platform-tests/streams/readable-streams/templated.https.html:
* web-platform-tests/streams/w3c-import.log:

LayoutTests:
Rebasing tests

Importing tests

Refresh WPT tests up to 03916af
https://bugs.webkit.org/show_bug.cgi?id=159420

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-05
Reviewed by Alex Christensen.

* TestExpectations:
* platform/mac/TestExpectations:
* platform/wk2/imported/w3c/web-platform-tests/html/semantics/document-metadata/styling/LinkStyle-expected.txt:

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

4 years agoRefactor NetworkResourceLoadParameters
commit-queue@webkit.org [Wed, 6 Jul 2016 06:53:18 +0000 (06:53 +0000)]
Refactor NetworkResourceLoadParameters
https://bugs.webkit.org/show_bug.cgi?id=159402

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-06
Reviewed by Alex Christensen.

Making NetworkResourceLoadParameters derive from NetworkLoadParameters.

* CMakeLists.txt: Removed NetworkLoadParameters.cpp
* NetworkProcess/NetworkLoadParameters.cpp: Deleted.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Deleted.
* NetworkProcess/NetworkResourceLoadParameters.h: Making it derive from NetworkLoadParameters.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years ago[GStreamer] Do not build MediaPlayerPrivateGStreamerOwr when VIDEO is disabled
commit-queue@webkit.org [Wed, 6 Jul 2016 06:52:25 +0000 (06:52 +0000)]
[GStreamer] Do not build MediaPlayerPrivateGStreamerOwr when VIDEO is disabled
https://bugs.webkit.org/show_bug.cgi?id=159425

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-07-05
Reviewed by Philippe Normand.

MediaPlayer backends are useful and can be built only when VIDEO is enabled.

No new tests, behavior is unchanged.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:

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

4 years agoENABLE_MEDIA_SOURCE should depend on ENABLE_VIDEO
commit-queue@webkit.org [Wed, 6 Jul 2016 06:51:41 +0000 (06:51 +0000)]
ENABLE_MEDIA_SOURCE should depend on ENABLE_VIDEO
https://bugs.webkit.org/show_bug.cgi?id=159424

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-07-05
Reviewed by Philippe Normand.

MEDIA_SOURCE requires VIDEO enabled, since MediaSource needs HTMLMediaElement.

* Source/cmake/WebKitFeatures.cmake:

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

4 years agoEnhance Windows DRT implementation to support platform scroll wheel events.
pvollan@apple.com [Wed, 6 Jul 2016 06:13:08 +0000 (06:13 +0000)]
Enhance Windows DRT implementation to support platform scroll wheel events.
https://bugs.webkit.org/show_bug.cgi?id=36002

Reviewed by Brent Fulgham.

Tools:

Implement function continuousMouseScrollBy in Windows event sender.

* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
(continuousMouseScrollBy):

LayoutTests:

Update test expectations.

* platform/win/TestExpectations:

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

4 years ago[Win] Layout Test http/tests/security/contentSecurityPolicy/source-list-parsing-10...
pvollan@apple.com [Wed, 6 Jul 2016 05:51:20 +0000 (05:51 +0000)]
[Win] Layout Test http/tests/security/contentSecurityPolicy/source-list-parsing-10.html is failing
https://bugs.webkit.org/show_bug.cgi?id=147646

Reviewed by Brent Fulgham.

.:

Disable CSP_NEXT. We can then use the common expected test results for this test.

* Source/cmake/OptionsWin.cmake:

Source/WebCore:

Fix build error when CSP_NEXT is disabled.

* DerivedSources.cpp:

LayoutTests:

Update test expectations.

* platform/win/TestExpectations:

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

4 years agoStackVisitor::unwindToMachineCodeBlockFrame() may unwind past a VM entry frame when...
sbarati@apple.com [Wed, 6 Jul 2016 05:25:06 +0000 (05:25 +0000)]
StackVisitor::unwindToMachineCodeBlockFrame() may unwind past a VM entry frame when catching an exception and the frame has inlined tail calls
https://bugs.webkit.org/show_bug.cgi?id=159448
<rdar://problem/27084459>

Reviewed by Mark Lam.

Consider the following stack trace:
(machine) foo -> VM entry frame -> (machine) bar -> (inlined tailcall) baz

If an exception is thrown at 'baz', we will do exception unwinding,
which will eventually call unwindToMachineCodeBlockFrame() which will call
gotoNextFrame() on the 'baz' frame. The next logical frame for 'baz' is 'foo' because
'bar' tail called 'baz' even though there is a machine frame for 'bar' on the stack.
This is a bug. unwindToMachineCodeBlockFrame() should not care about the next
logical frame, it just wants to move StackVisitor's state to the current machine
frame. The bug here is that we would end up unwinding past the VM entry frame
which can have all kinds of terrible consequences.

This bug fixes unwindToMachineCodeBlockFrame() by having it not rely
on gotoNextFrame() and instead using its own mechanism for setting
the StackVisotor's state to the current machine frame.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::unwindToMachineCodeBlockFrame):
* tests/stress/dont-unwind-past-vm-entry-frame.js: Added.
(let.p.new.Proxy):
(let.p.new.Proxy.apply):
(bar):
(let.good):
(getItem):
(start):

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

4 years agoRELEASE_ASSERT(!thisObject) in ObjCCallbackFunctionImpl::call when calling JSExport...
commit-queue@webkit.org [Wed, 6 Jul 2016 05:04:05 +0000 (05:04 +0000)]
RELEASE_ASSERT(!thisObject) in ObjCCallbackFunctionImpl::call when calling JSExport ObjC Constructor without operator new
https://bugs.webkit.org/show_bug.cgi?id=159446

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-05
Reviewed by Mark Lam.

Source/JavaScriptCore:

Treat ObjC JSExport init constructors like ES6 Class Constructors
and throw a TypeError when called without 'new'.

* API/ObjCCallbackFunction.mm:
(JSC::ObjCCallbackFunctionImpl::type):
(JSC::objCCallbackFunctionCallAsFunction):
When calling an init method as a function instead of construction
throw a TypeError.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
Improve error message.

* API/tests/testapi.mm:
(testObjectiveCAPIMain):
Test we get an exception when calling an ObjC constructor without 'new'.

LayoutTests:

* js/class-syntax-call-expected.txt:
* js/class-syntax-default-constructor-expected.txt:
* js/script-tests/class-syntax-call.js:
* js/script-tests/class-syntax-default-constructor.js:
Improve error message when calling a class constructor without 'new'.

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

4 years agoThrow exceptions for invalid number of channels for ConvolverNode
bfulgham@apple.com [Wed, 6 Jul 2016 04:11:44 +0000 (04:11 +0000)]
Throw exceptions for invalid number of channels for ConvolverNode
<https://webkit.org/b/159238>

Patch by David Kilzer <ddkilzer@apple.com> on 2016-07-05
Reviewed by Brent Fulgham.

Source/WebCore:

Fix based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

Also includes a related fix for ReverbConvolverStage (patch by <rtoy@chromium.org>):
<https://src.chromium.org/viewvc/blink?revision=157832&view=revision>

Test: webaudio/convolver-channels.html

* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::setBuffer): Throw an exception for
anything but 1, 2 or 4 channels.
* platform/audio/ReverbConvolverStage.cpp:
(WebCore::ReverbConvolverStage::ReverbConvolverStage): Don't read past the end of
the impulseResponse array.

LayoutTests:

Test based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

compatibility.js based on a Blink change (patch by <rtoy@google.com>):
<https://chromium.googlesource.com/chromium/src.git/+/f846f5a461d1fcdbe5152898576c125058079ed1>

* webaudio/convolver-channels-expected.txt: Added.
* webaudio/convolver-channels.html: Added.
* webaudio/resources/compatibility.js: Added.

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

4 years agoRemove some unneeded #include "CachedCall.h".
mark.lam@apple.com [Wed, 6 Jul 2016 02:50:33 +0000 (02:50 +0000)]
Remove some unneeded #include "CachedCall.h".
https://bugs.webkit.org/show_bug.cgi?id=159449

Reviewed by Saam Barati.

* runtime/ArrayPrototype.cpp:
* runtime/JSArray.cpp:
* runtime/MapPrototype.cpp:
* runtime/SetPrototype.cpp:

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

4 years agoWeb Inspector: Sending XHR with UTF8 encoded data shows garbled data in Resource...
commit-queue@webkit.org [Wed, 6 Jul 2016 00:56:49 +0000 (00:56 +0000)]
Web Inspector: Sending XHR with UTF8 encoded data shows garbled data in Resource sidebar
https://bugs.webkit.org/show_bug.cgi?id=159358

Patch by Johan K. Jensen <jj@johanjensen.dk> on 2016-07-05
Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/inspector/network/xhr-request-data-encoded-correctly.html

* inspector/InspectorNetworkAgent.cpp:
(WebCore::buildObjectForResourceRequest):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::setResourceContent):

LayoutTests:

* http/tests/inspector/network/xhr-request-data-encoded-correctly-expected.txt: Added.
* http/tests/inspector/network/xhr-request-data-encoded-correctly.html: Added.

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

4 years agoTest gardening after r202835.
ryanhaddad@apple.com [Wed, 6 Jul 2016 00:53:17 +0000 (00:53 +0000)]
Test gardening after r202835.

Unreviewed test garedening.

* platform/ios-simulator/fast/attachment/attachment-select-on-click-expected.txt:
* platform/mac-elcapitan/fast/attachment/attachment-select-on-click-expected.txt: Removed.
* platform/mac/fast/attachment/attachment-select-on-click-expected.txt:

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

4 years agoAX: Image attachment in email does not show up in AX tree
cfleizach@apple.com [Wed, 6 Jul 2016 00:41:46 +0000 (00:41 +0000)]
AX: Image attachment in email does not show up in AX tree
https://bugs.webkit.org/show_bug.cgi?id=159422

Reviewed by Joanmarie Diggs.

Source/WebCore:

When an image loads after the accessibility tree has already been created, the ignored status
of that image does not get updated.

Test: accessibility/image-load-on-delay.html

* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):

LayoutTests:

* accessibility/image-load-on-delay-expected.txt: Added.
* accessibility/image-load-on-delay.html: Added.

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

4 years agoWeb Inspector: Switch last uses of -webkit-linear-gradient() to linear-gradient()
timothy@apple.com [Tue, 5 Jul 2016 23:42:59 +0000 (23:42 +0000)]
Web Inspector: Switch last uses of -webkit-linear-gradient() to linear-gradient()
https://bugs.webkit.org/show_bug.cgi?id=159438
rdar://problem/27183417

Reviewed by Joseph Pecoraro.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
(.timeline-overview-graph.rendering-frame > .frame-marker):
(body.window-inactive .timeline-overview-graph.rendering-frame > .frame-marker):
* UserInterface/Views/TimelineRecordFrame.css:
(.timeline-record-frame.tall):
(.timeline-record-frame.selected):
(body.window-inactive .timeline-record-frame.selected):

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

4 years agoCrash @ bankofamerica.com, University of Vienna
ggaren@apple.com [Tue, 5 Jul 2016 23:09:51 +0000 (23:09 +0000)]
Crash @ bankofamerica.com, University of Vienna
https://bugs.webkit.org/show_bug.cgi?id=159439

Reviewed by Saam Barati.

* ftl/FTLLink.cpp:
(JSC::FTL::link): Do check for stack overflow in the arity mismatch thunk
because it can happen. Don't store a CallSiteIndex because we haven't
stored a CodeBlock yet, and our stack frame is not fully constructed,
so it would be an error for any client to try to load this value (and
operationCallArityCheck does not load this value).

* tests/stress/arity-check-ftl-throw.js: Added. New test case for stressing
a stack overflow with arity mismatch. Sadly, after hours of fiddling, I
can't seem to get this to fail in trunk. Still, it's good to have some
more testing in this area.

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

4 years agoLand test expectations for rdar://problem/27182687.
ryanhaddad@apple.com [Tue, 5 Jul 2016 22:27:58 +0000 (22:27 +0000)]
Land test expectations for rdar://problem/27182687.

* platform/mac/TestExpectations:

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

4 years agoFix Windows build.
achristensen@apple.com [Tue, 5 Jul 2016 22:25:34 +0000 (22:25 +0000)]
Fix Windows build.
https://bugs.webkit.org/show_bug.cgi?id=159103

* Modules/indexeddb/IDBActiveDOMObject.h:
(WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
WTF.

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

4 years agoHTMLAttachment elements don't receive clicks after the first on iOS.
enrica@apple.com [Tue, 5 Jul 2016 22:23:49 +0000 (22:23 +0000)]
HTMLAttachment elements don't receive clicks after the first on iOS.
https://bugs.webkit.org/show_bug.cgi?id=159310
rdar://problem/25776940

Reviewed by Tim Horton.

Source/WebCore:

shouldSelectOnMouseDown() now returns false on iOS.

* html/HTMLAttachmentElement.h:

LayoutTests:

Updated existing test to correctly reflect the new behavior.

* fast/attachment/attachment-select-on-click.html:
* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator/fast/attachment/attachment-select-on-click-expected.txt:
* platform/mac/fast/attachment/attachment-select-on-click-expected.txt:

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

4 years agoActually persist changes to cookie accept policy.
commit-queue@webkit.org [Tue, 5 Jul 2016 22:21:54 +0000 (22:21 +0000)]
Actually persist changes to cookie accept policy.
https://bugs.webkit.org/show_bug.cgi?id=159377
<rdar://problem/22774152>

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-05
Reviewed by Alexey Proskuryakov.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::NetworkSession):
Added logging.
* UIProcess/mac/WebCookieManagerProxyMac.mm:
(WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
When we persist the cookie accept policy, we want to call _saveCookies to actually write the
change to disk so that when we create a new process which reads from disk to determine its
cookie accept policy, it will read the new cookie accept policy.  Before this patch it was
reading the old one in some cases where the changes had not yet been persisted to disk.

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

4 years agoIDBDatabase can null deref its ScriptExecutionContext inside connectionToServerLost.
beidson@apple.com [Tue, 5 Jul 2016 21:34:33 +0000 (21:34 +0000)]
IDBDatabase can null deref its ScriptExecutionContext inside connectionToServerLost.
<rdar://problem/27169924> and https://bugs.webkit.org/show_bug.cgi?id=159432

Reviewed by Alex Christensen.

No new tests (Targeted test not possible, covered peripherally by all IDB tests).

* Modules/indexeddb/IDBActiveDOMObject.h:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost): Make sure there is still a script execution context.

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

4 years ago[JSC] The prototype cycle checks throws the wrong error type
commit-queue@webkit.org [Tue, 5 Jul 2016 21:08:38 +0000 (21:08 +0000)]
[JSC] The prototype cycle checks throws the wrong error type
https://bugs.webkit.org/show_bug.cgi?id=159393

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-05
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

We were supposed to throw the TypeError:
-https://tc39.github.io/ecma262/#sec-set-object.prototype.__proto__

* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):

LayoutTests:

* js/cyclic-prototypes-expected.txt:
* js/script-tests/cyclic-prototypes.js:
(catch):

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

4 years agoWeb Inspector: Drop -webkit-calc() in completions and a single use
timothy@apple.com [Tue, 5 Jul 2016 20:38:22 +0000 (20:38 +0000)]
Web Inspector: Drop -webkit-calc() in completions and a single use
https://bugs.webkit.org/show_bug.cgi?id=159435
rdar://problem/27179340

Reviewed by Dean Jackson.

* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/VisualStylePropertyEditorLink.css:
(.visual-style-property-editor-link > .visual-style-property-editor-link-border):

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

4 years agoWeb Inspector: Drop the prefix from -webkit-image-set()
timothy@apple.com [Tue, 5 Jul 2016 20:30:00 +0000 (20:30 +0000)]
Web Inspector: Drop the prefix from -webkit-image-set()
https://bugs.webkit.org/show_bug.cgi?id=159433
rdar://problem/27178887

Reviewed by Dean Jackson.

* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/ApplicationCacheIcons.css:
(.application-cache-manifest .icon):
(.application-cache-frame .icon):
* UserInterface/Views/CookieIcon.css:
(.cookie-icon .icon):
* UserInterface/Views/DOMStorageIcons.css:
(.local-storage-icon .icon):
(.session-storage-icon .icon):
* UserInterface/Views/DatabaseIcon.css:
(.database-icon .icon):
* UserInterface/Views/DatabaseTableIcon.css:
(.database-table-icon .icon):
* UserInterface/Views/FolderIcon.css:
(.folder-icon .icon):
* UserInterface/Views/GradientSlider.css:
(.gradient-slider-knob):
(.gradient-slider-knob.selected):
* UserInterface/Views/HoverMenu.css:
(.hover-menu > img):
* UserInterface/Views/ResourceIcons.css:
(.resource-icon .icon):
(.resource-icon.resource-type-document .icon):
(.resource-icon.resource-type-image .icon):
(.resource-icon.resource-type-font .icon):
(.resource-icon.resource-type-stylesheet .icon):
(.resource-icon.resource-type-script .icon):
(.anonymous-script-icon .icon):
(.source-map-resource.resource-icon .icon):
(.source-map-resource.resource-icon.resource-type-stylesheet .icon):
(.source-map-resource.resource-icon.resource-type-script .icon):
(.large .resource-icon .icon):
(.large .resource-icon.resource-type-document .icon):
(.large .resource-icon.resource-type-image .icon):
(.large .resource-icon.resource-type-font .icon):
(.large .resource-icon.resource-type-stylesheet .icon):
(.large .resource-icon.resource-type-script .icon):
(.large .anonymous-script-icon .icon):
(.large .source-map-resource.resource-icon .icon):
(.large .source-map-resource.resource-icon.resource-type-stylesheet .icon):
(.large .source-map-resource.resource-icon.resource-type-script .icon):
* UserInterface/Views/Slider.css:
(.slider > img):
(.slider > img.dragging):
* UserInterface/Views/SourceCodeTextEditor.css:
(.hover-menu.color > img):
* UserInterface/Views/TextEditor.css:
(.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .breakpoint-resolved .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .execution-line .CodeMirror-linenumber::after):
* UserInterface/Views/TimelineIcons.css:
(body:not(.mac-platform, .windows-platform) .network-icon .icon):
(body:not(.mac-platform, .windows-platform) .network-icon.large .icon):
(body:not(.mac-platform, .windows-platform) .layout-icon .icon):
(body:not(.mac-platform, .windows-platform) .layout-icon.large .icon):
(body:not(.mac-platform, .windows-platform) .script-icon .icon):
(body:not(.mac-platform, .windows-platform) .script-icon.large .icon):
(body:not(.mac-platform, .windows-platform) .rendering-frame-icon .icon):
(body:not(.mac-platform, .windows-platform) .memory-icon .icon):
(body:not(.mac-platform, .windows-platform) .heap-allocations-icon .icon):
(body:not(.mac-platform, .windows-platform) .stopwatch-icon .icon):

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

4 years agoREGRESSION (r202641): Netflix playback stalls after a few seconds
jer.noble@apple.com [Tue, 5 Jul 2016 20:22:58 +0000 (20:22 +0000)]
REGRESSION (r202641): Netflix playback stalls after a few seconds
https://bugs.webkit.org/show_bug.cgi?id=159365

Reviewed by Eric Carlson.

Source/WebCore:

Test: LayoutTests/media/media-source/media-source-small-gap.html

In r202641, we removed a "fudge factor" of 1 millisecond added onto the duration
of every sample for the purposes of calculating a SourceBuffer's buffered ranges.
Netflix (and likely other providers) have streams that have 1 "timeScale" gaps
between segments (e.g., 1/9000s, 1/3003s, etc.). Fill those gaps by looking for
the previous and next samples and extending the buffered range to cover the gaps
if they're short enough. We have to ensure that we correctly remove those extended
durations when we remove samples from the SourceBuffer as well.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

Source/WTF:

Add a isBetween() convenience method.

* wtf/MediaTime.cpp:
(WTF::MediaTime::isBetween):
* wtf/MediaTime.h:

LayoutTests:

* media/media-source/media-source-small-gap-expected.txt: Added.
* media/media-source/media-source-small-gap.html: Added.

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

4 years agoour parsing for "use strict" is wrong when we first parse other directives that are...
sbarati@apple.com [Tue, 5 Jul 2016 20:05:02 +0000 (20:05 +0000)]
our parsing for "use strict" is wrong when we first parse other directives that are not "use strict" but are located in a place where "use strict" would be valid
https://bugs.webkit.org/show_bug.cgi?id=159376
<rdar://problem/27108773>

Reviewed by Benjamin Poulain.

Our strict mode detection algorithm used to break if we ever saw a directive
that is not "use strict" but is syntactically located in a location where our
parser looks for "use strict". It broke as follows:

If a function started with a non "use strict" string literal, we will allow
"use strict" to be in any arbitrary statement inside the top level block in
the function body. For example, this meant that if we parsed a sequence of string
literals, followed by arbitrary statements, followed by "use strict", we would parse
the function as if it's in strict mode. This is the wrong behavior with respect to
the spec. This has consequences in other ways that break invariants of the language.
For example, we used to allow functions that are lexically nested inside what we deemed
a strict function to be non-strict. This used to fire an assertion if we ever skipped over
that function using the source provider cache, but it worked just fine in release builds.

This patch fixes this bug.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseSourceElements):
(JSC::Parser<LexerType>::parseStatement):
* tests/stress/ensure-proper-strict-mode-parsing.js: Added.
(foo.bar):
(foo):
(bar.foo):
(bar):
(bar.call.undefined.this.throw.new.Error.string_appeared_here.baz):
(baz.call.undefined.undefined.throw.new.Error.string_appeared_here.jaz):
(jaz.call.undefined.this.throw.new.Error.string_appeared_here.vaz):

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

4 years agoreportAbandonedObjectGraph should report abandoned bytes based on capacity() so it...
sbarati@apple.com [Tue, 5 Jul 2016 19:49:19 +0000 (19:49 +0000)]
reportAbandonedObjectGraph should report abandoned bytes based on capacity() so it works even if a GC has never happened
https://bugs.webkit.org/show_bug.cgi?id=159222
<rdar://problem/27001991>

Reviewed by Geoffrey Garen.

When reportAbandonedObjectGraph() was called before the first GC, it used to
not indicate to the GC timers that we have memory that needs to be collected
because the calculation was based on m_sizeAfterLastCollect (which was zero).
This patch makes the calculation based on capacity() which is a valid number
even before the first GC.

* heap/Heap.cpp:
(JSC::Heap::reportAbandonedObjectGraph):
(JSC::Heap::protect):
(JSC::Heap::didAbandon): Deleted.
* heap/Heap.h:
(JSC::Heap::jitStubRoutines):

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