WebStorageNamespaceProvider should create StorageNamespaceImpls
https://bugs.webkit.org/show_bug.cgi?id=139419

Reviewed by Andreas Kling.

Source/WebCore:

* WebCore.exp.in:
Export new symbols.

* WebCore.xcodeproj/project.pbxproj:
Make StorageNamespaceImpl.h a private header.

* storage/StorageNamespaceImpl.cpp:
(WebCore::localStorageNamespaceMap):
Use NeverDestroyed.

(WebCore::StorageNamespaceImpl::createSessionStorageNamespace):
(WebCore::StorageNamespaceImpl::getOrCreateLocalStorageNamespace):
Add new functions for creating namespaces.

(WebCore::StorageNamespaceImpl::localStorageNamespace):
(WebCore::StorageNamespaceImpl::sessionStorageNamespace):
Call the new functions.

* storage/StorageNamespaceImpl.h:
Add new members, make sure to deprecate the ones we don't want anyone calling.

* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageNamespace):
(WebCore::StorageNamespaceProvider::transientLocalStorageNamespace):
* storage/StorageNamespaceProvider.h:
Pass the quota when creating storage namespaces.

Source/WebKit:

* Storage/WebStorageNamespaceProvider.cpp:
(WebStorageNamespaceProvider::createLocalStorageNamespace):
(WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
Create StorageNamespaceImpls.

(WebStorageNamespaceProvider::createSessionStorageNamespace): Deleted.
Delete this for now.

* Storage/WebStorageNamespaceProvider.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix typo.

* storage/StorageNamespaceImpl.cpp:
(WebCore::localStorageNamespaceMap):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/18905383> [iOS] Crash due to null m_webPageProxyForBackForwardListForCurrentSwipe in ViewGestureController::endSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=138750

Reviewed by Tim Horton.

The snapshot for the current gesture was being removed mid-gesture by the callback from
dispatchAfterEnsuringDrawing scheduled by the previous gesture. The fix is to ignore the
callback for a gesture if it is made after the snapshot for that gesture has already been
removed (which can happen as a result of the watchdog timer firing).

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::ViewGestureController): Initialize new member variable.
(WebKit::addLogEntry): Fixed the log message format.
(WebKit::ViewGestureController::endSwipeGesture): When dispatchAfterEnsuringDrawing() calls
us back, bail out if the gesture snapshot has already been removed.
(WebKit::ViewGestureController::removeSwipeSnapshot): Increment
m_gesturePendingSnapshotRemoval.
* UIProcess/mac/ViewGestureController.h: Added m_gesturePendingSnapshotRemoval member
variable.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r176979.
https://bugs.webkit.org/show_bug.cgi?id=139424

"New JSC test in this patch is failing" (Requested by mlam on
#webkit).

Reverted changeset:

"Fixes operationPutByIds such that they check that the put
didn't"
https://bugs.webkit.org/show_bug.cgi?id=139196
http://trac.webkit.org/changeset/176979

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move 'text-shadow' check from RenderStyle::changeRequiresLayout() to changeAffectsVisualOverflow()
https://bugs.webkit.org/show_bug.cgi?id=139420

Reviewed by Simon Fraser.

Move 'text-shadow' check from RenderStyle::changeRequiresLayout() to
changeAffectsVisualOverflow(). This has no behavior change as
changeRequiresLayout() calls changeAffectsVisualOverflow(). However,
this is clearer as text-shadow affects the visual overflow (similarly
to box-shadow).

No new tests, no behavior change.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow):
(WebCore::RenderStyle::changeRequiresLayout):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Copy and Lookup menu items should be disabled when something is not copyable
https://bugs.webkit.org/show_bug.cgi?id=139423

Reviewed by Tim Horton.

Source/WebCore:

New function allowCopy() indicates whether the HitTestResult would allow itself to 
be copied onto the pasteboard.
* WebCore.exp.in:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::allowsCopy):
* rendering/HitTestResult.h:

Source/WebKit/mac:

Disable both lookup and copy when a HitTestResult does not allow copy.
* WebView/WebActionMenuController.mm:

Set autoenablesItems to NO. It’s messing with our ability to control the enable/
disable state otherwise.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit2:

Add allowsCopy to the WebHitTestResult.
* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
* Shared/WebHitTestResult.h:
(WebKit::WebHitTestResult::allowsCopy):

Set autoenablesItems to NO. It’s messing with our ability to control the enable/
disable state otherwise.
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:context:configuration:webView:]):

Disable both lookup and copy when a WebHitTestResult does not allow copy.
* UIProcess/mac/WKActionMenuController.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Apple] Use Accelerate framework to speed-up FEGaussianBlur
https://bugs.webkit.org/show_bug.cgi?id=139310
<rdar://problem/18434594>

PerformanceTests:

Reviewed by Simon Fraser.

Add an interactive performance test that measures the speed of a set
of blur operations on a generated images.

* Interactive/blur-filter-timing.html: Added.

Source/WebCore:

<rdar://problem/18434594>

Reviewed by Simon Fraser.

Using Apple's Accelerate framework provides faster blurs
than the parallel jobs approach, especially since r168577
which started performing retina-accurate filters.

Using Accelerate.framework to replace the existing box blur (what
we use to approximate Gaussian blurs) gets about a 20% speedup on
desktop class machines, but between a 2x-6x speedup on iOS hardware.
Obviously this depends on the size of the content being blurred,
but it is still good.

The change is to intercept the platformApply function on
FEGaussianBlur and send it off to Accelerate.

There is an interactive performance test: PerformanceTests/Interactive/blur-filter-timing.html

* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::kernelPosition): Move this to a file static function from the .h.
(WebCore::accelerateBoxBlur): The Accelerate implementation.
(WebCore::standardBoxBlur): The default generic/standard implementation.
(WebCore::FEGaussianBlur::platformApplyGeneric): Use accelerate or the default form.
(WebCore::FEGaussianBlur::platformApply): Don't try the parallelJobs approach if Accelerate is available.
* platform/graphics/filters/FEGaussianBlur.h:
(WebCore::FEGaussianBlur::kernelPosition): Deleted. Move into the .cpp.

Source/WTF:

<rdar://problem/18434594>

Reviewed by Simon Fraser.

Add a HAVE_ACCELERATE flag, true on Apple platforms.

* wtf/Platform.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore:
Removed some allocation and cruft from the parser
https://bugs.webkit.org/show_bug.cgi?id=139416

Reviewed by Mark Lam.

Now, the only AST nodes that require a destructor are the ones that
relate to pickling a function's arguments -- which will required some
deeper thinking to resolve.

This is a < 1% parser speedup.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj: Removed NodeInfo because it
was unused.

* bytecompiler/NodesCodegen.cpp:
(JSC::CommaNode::emitBytecode):
(JSC::SourceElements::lastStatement):
(JSC::SourceElements::emitBytecode): Updated for interface change to linked list.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::ASTBuilder):
(JSC::ASTBuilder::varDeclarations):
(JSC::ASTBuilder::funcDeclarations):
(JSC::ASTBuilder::createFuncDeclStatement):
(JSC::ASTBuilder::addVar): Removed the ParserArenaData abstraction because
it wasn't buying us anything. We can just use Vector directly.

(JSC::ASTBuilder::createCommaExpr):
(JSC::ASTBuilder::appendToCommaExpr): Changed to use a linked list instead
of a vector, to avoid allocating a vector with inline capacity in the
common case in which an expression is not followed by a vector.

(JSC::ASTBuilder::Scope::Scope): Use Vector directly to avoid new'ing
up a Vector*.

(JSC::ASTBuilder::appendToComma): Deleted.
(JSC::ASTBuilder::combineCommaNodes): Deleted.

* parser/Lexer.cpp:

* parser/NodeConstructors.h:
(JSC::StatementNode::StatementNode):
(JSC::CommaNode::CommaNode):
(JSC::SourceElements::SourceElements): Updated for interface change to linked list.

* parser/NodeInfo.h: Removed.

* parser/Nodes.cpp:
(JSC::SourceElements::append):
(JSC::SourceElements::singleStatement): Use a linked list instead of a
vector to track the statements in a list. This removes some allocation
and it means that we don't need a destructor anymore.

(JSC::ScopeNode::ScopeNode):
(JSC::ProgramNode::ProgramNode):
(JSC::EvalNode::EvalNode):
(JSC::FunctionNode::FunctionNode): Updated for interface change to reference,
since these values are never null.

* parser/Nodes.h:
(JSC::StatementNode::next):
(JSC::StatementNode::setNext):
(JSC::CommaNode::append): Deleted. Updated for interface change to linked list.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::didFinishParsing): Updated for interface change to reference.

(JSC::Parser<LexerType>::parseVarDeclarationList):
(JSC::Parser<LexerType>::parseExpression): Track comma expressions as
an explicit list of CommaNodes, removing a use of vector and a destructor.

* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createCommaExpr):
(JSC::SyntaxChecker::appendToCommaExpr):
(JSC::SyntaxChecker::appendToComma): Deleted. Updated for interface changes.

LayoutTests:
Removed the custom allocator for ParserArena
https://bugs.webkit.org/show_bug.cgi?id=139305

Reviewed by Mark Lam.

Added a test for something I messed up while writing this patch.

* js/basic-strict-mode-expected.txt:
* js/script-tests/basic-strict-mode.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implementation EXT_sRGB as a WebGL1 extension.
https://bugs.webkit.org/show_bug.cgi?id=109332.
<rdar://problem/17363470>
Reviewed by Dean Jackson.
Tested by:
webgl/1.0.3/conformance/webgl/ext-sRGB.html
fast/canvas/webgl/constants.html
This patch implements the SRGB extension for WebGL1.
Details of the extension specification are outlined here: 
https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS):
* html/canvas/EXTsRGB.cpp: Added.
(WebCore::EXTsRGB::EXTsRGB):
(WebCore::EXTsRGB::~EXTsRGB):
(WebCore::EXTsRGB::getName):
* html/canvas/EXTsRGB.h: Added.
* html/canvas/EXTsRGB.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::checkStatus):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::renderbufferStorage):
(WebCore::WebGLRenderingContext::validateTexFuncFormatAndType):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContext.idl:
* platform/graphics/Extensions3D.h:
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
(WebCore::GraphicsContext3D::getClearBitsByFormat):
(WebCore::GraphicsContext3D::getChannelBitsByFormat):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::texImage2D):

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