Unreviewed gardening. plugins/document-open.html will some times timeout.

* platform/gtk-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Objective-C API: blocks aren't callable via 'new'
https://bugs.webkit.org/show_bug.cgi?id=122561

Reviewed by Oliver Hunt.

Currently the only way for clients to vend new native objects to JavaScript code
is via factory methods in the form of exported class methods or blocks. Blocks can
be called like normal functions from JavaScript code, but they cannot be invoked
with 'new'. This would give a simple way for clients to expose constructor-like
behavior to their JavaScript code.

This patch adds the ability for blocks to be invoked as if they were a constructor.
Blocks invoked as constructors are required to return an object. If the block doesn't
return an object then an error is thrown. The 'this' object is not provided to the
block and must be created within the block itself.

This patch also unifies the native 'construct' callback used in both the C and Obj-C
APIs under the APICallbackFunction struct, similar to how we unified the 'call' callback
between ObjCCallbackFunction and JSCallbackFunction before.

This patch also adds tests to make sure that different blocks generate objects that
correctly behave when queried with instanceof. It also makes sure that the correct
JS exception is thrown when a block fails to return an object.

* API/APICallbackFunction.h:
(JSC::APICallbackFunction::call):
(JSC::APICallbackFunction::construct):
* API/JSCallbackConstructor.cpp:
(JSC::JSCallbackConstructor::getConstructData):
* API/JSCallbackConstructor.h:
(JSC::JSCallbackConstructor::constructCallback):
* API/JSCallbackFunction.h:
(JSC::JSCallbackFunction::functionCallback):
* API/ObjCCallbackFunction.h:
(JSC::ObjCCallbackFunction::functionCallback):
(JSC::ObjCCallbackFunction::constructCallback):
* API/ObjCCallbackFunction.mm:
(JSC::objCCallbackFunctionCallAsConstructor):
(JSC::ObjCCallbackFunction::ObjCCallbackFunction):
(JSC::ObjCCallbackFunction::create):
(JSC::ObjCCallbackFunction::getConstructData):
* API/tests/testapi.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid resizing the internal buffer of SharedBuffer when creating a PurgeableBuffer
https://bugs.webkit.org/show_bug.cgi?id=122516

Reviewed by Darin Adler.

Currently when we create a PurgeableBuffer from a SharedBuffer we may
resize the internal buffer of the SharedBuffer so that it can fit the
concatenated contents of all of its segments before copying this
internal buffer to the internal buffer of the PurgeableBuffer. Instead,
we can avoid resizing the internal buffer of SharedBuffer by allocating
a PurgeableBuffer and then copying the internal buffer of SharedBuffer
and its segments directly into it.

* platform/PurgeableBuffer.h:
(WebCore::PurgeableBuffer::createUninitialized): Add inline implementation
when building with ENABLE_PURGEABLE_MEMORY disabled.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::createPurgeableBuffer): Implemented in terms of
SharedBuffer::{copyBufferAndClear, createUninitialized}().
(WebCore::SharedBuffer::copyBufferAndClear): Added.
(WebCore::SharedBuffer::buffer): Moved logic to copy segments/data array to
SharedBuffer::copyBufferAndClear() and modified this function to use it.
* platform/SharedBuffer.h:
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::copyBufferAndClear): Renamed; formerly called SharedBuffer::copyDataArrayAndClear.
* platform/mac/PurgeableBufferMac.cpp:
(WebCore::allocatePurgeableBuffer): Added.
(WebCore::PurgeableBuffer::createUninitialized): Added.
(WebCore::PurgeableBuffer::create): Moved logic to allocate a purgeable buffer into
PurgeableBuffer::createUninitialized() and modified this function to use it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] New positioning model: Shape cropped to margin box
https://bugs.webkit.org/show_bug.cgi?id=118092

Reviewed by Alexandru Chiculita.

Source/WebCore:

Clip the shape to the margin box when it extends out the left or right
edges. Also added a few local variables to make the code easier to
read.

Tests: csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-ref.html
       csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-004.html
       csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-005.html
       csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-006.html

* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):

LayoutTests:

Add tests for shapes that extend out left/right of the margin box.

Fix polygon and image threshold tests so that they have a large enough
margin box so the shape isn't clipped.

Also update some of the top/bottom tests to have a better reference,
they should be more likely to break if the implementation fails now.

* csswg/contributors/adobe/submitted/shapes/shape-outside/resources/w3c-import.log:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-expected.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-ref-expected.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-ref.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003-expected.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-004-expected.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-expected.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-004.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-005-expected.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-expected.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-005.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-003.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-006-expected.html: Copied from LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-001-expected.html.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-006.html: Added.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-000.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-001.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-002.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/w3c-import.log:
* fast/shapes/shape-outside-floats/shape-outside-floats-image-threshold-001.html:


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

Move the tests that only fail in wk1 to their file, and unskip the
ones that are passing in all cases.

* platform/gtk-wk1/TestExpectations:
* platform/gtk-wk2/TestExpectations:
* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] clampToUnsigned() should return unsigned, not int
https://bugs.webkit.org/show_bug.cgi?id=122601

Source/WebCore:

Reviewed by Andreas Kling.

Corrected the return type for clampToUnsigned() in MathExtras.h. It's now unsigned.
No new tests since this is just an internal refactoring of existing code.

* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShape::marginIntervals): Use the redefined clampToUnsigned method.

Source/WTF:

Corrected the return type for clampToUnsigned() in MathExtras.h. It's now unsigned.

Reviewed by Andreas Kling.

* wtf/MathExtras.h:
(clampToUnsigned):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore: <rdar://problem/13871507> JavaScriptCore fails to build with C++ 98 conformance changes

Reviewed by Andreas Kling.

* heap/VTableSpectrum.cpp:
(JSC::VTableSpectrum::dump): strrchr returns a const char* when passed one.
Update the type of the local variable to accommodate that.

Source/WebKit2: <rdar://problem/13871522> WebKit2 fails to build with C++ 98 conformance changes

Reviewed by Andreas Kling.

* Shared/mac/SandboxExtensionMac.mm:
(WebKit::resolveSymlinksInPath): strrchr returns a const char* when passed one.
Update the type of the local variable to accommodate that.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CoordinatedGraphics][CSS Shaders] marshal color and matrix custom filter parameters
https://bugs.webkit.org/show_bug.cgi?id=117904

Correctly encode and decode the "matrix" and "color" custom filter parameter types.
No port currently enables this code, however with this change the relevant layout tests now pass when enabled in EFL.
Patch by Ralph Thomas <ralpht@gmail.com> on 2013-10-10
Reviewed by Noam Rosenthal.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/13341666> WebKit should always build against an SDK.

Have all projects default to building against the OS X Internal SDK for the Production
configuration. For the Debug and Release configurations, look for UseInternalSDK.xcconfig
to determine whether the OS X Internal SDK should be used. If not, use the normal OS X SDK.

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty:

* gtest/xcode/Config/General.xcconfig:
* gtest/xcode/Config/ProductionProject.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebKit/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebKit2:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move the rest of EventRetargeter functions to EventPath
https://bugs.webkit.org/show_bug.cgi?id=122586

Reviewed by Andreas Kling.

Moved the rest of EventRetargeter functiosn either static local or EventPath member functions.

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchScopedEvent):
(WebCore::EventDispatcher::dispatch):
(WebCore::EventDispatcher::dispatchEventPostProcess):
* dom/EventDispatcher.h:
* dom/EventRetargeter.cpp:
(WebCore::EventPath::EventPath):
(WebCore::calculateAdjustedNodes): Made static local. Also takes const EventPath and returns the size
to which EventPath should be shrunk; this allows us to remove EventPath::shrink.
(WebCore::updateTouchListsInEventPath): Moved and renamed from EventRetargeter::adjustTouchList.
(WebCore::EventPath::updateTouchLists): Moved and renamed from EventRetargeter::adjustForTouchEvent.
(WebCore::EventPath::setRelatedTarget): Moved.
* dom/EventRetargeter.h:
(WebCore::eventTargetRespectingTargetRules): Renamed from EventRetargeter::eventTargetRespectingTargetRules.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
generate-message-receiver.py can't handle nested #ifs
https://bugs.webkit.org/show_bug.cgi?id=121877

Reviewed by Alexey Proskuryakov.

* Scripts/webkit2/parser.py:
(parse): Exit early until proper fix instead of generating buggy output.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, roll out r157193. It broke some builds.

* JavaScriptCore.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r157203): WebKit crashes after dispatching gesture event
https://bugs.webkit.org/show_bug.cgi?id=122615

Reviewed by Anders Carlsson.

Don't release the event until the end of the function where we call member functions on it.

* dom/Node.cpp:
(WebCore::Node::dispatchGestureEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove the old front-end from WebKit
https://bugs.webkit.org/show_bug.cgi?id=122295

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-10-10
Reviewed by Timothy Hatcher.

Skipping the tests of the old Inspector UI for all ports.

* TestExpectations:
* platform/efl-wk1/TestExpectations:
* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk-wk1/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac-lion/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/win-xp/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Store uniform type information in WebGLUniformationLocation.
https://bugs.webkit.org/show_bug.cgi?id=122607.

Reviewed by Dean Jackson.

Covered by Khronos Conformance Suite 1.0.2.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getUniform):
(WebCore::WebGLRenderingContext::getUniformLocation):
* html/canvas/WebGLUniformLocation.cpp:
(WebCore::WebGLUniformLocation::create):
(WebCore::WebGLUniformLocation::WebGLUniformLocation):
(WebCore::WebGLUniformLocation::type):
* html/canvas/WebGLUniformLocation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert some OwnPtr/PassOwnPtr in CoordinatedGraphics code to std::unique_ptr's
https://bugs.webkit.org/show_bug.cgi?id=122614

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-10-10
Reviewed by Anders Carlsson.

Source/WebCore:

No new tests, covered by existing ones.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::paintToSurface):
(WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
* platform/graphics/texmap/coordinated/CompositingCoordinator.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::adjustContentsScale):
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::createLayer):
(WebCore::CoordinatedGraphicsScene::deleteLayer):
(WebCore::CoordinatedGraphicsScene::ensureRootLayer):
(WebCore::CoordinatedGraphicsScene::purgeGLResources):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
* platform/graphics/texmap/coordinated/ThreadSafeCoordinatedSurface.cpp:
(WebCore::ThreadSafeCoordinatedSurface::ThreadSafeCoordinatedSurface):
* platform/graphics/texmap/coordinated/ThreadSafeCoordinatedSurface.h:
* platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
(WebCore::UpdateAtlas::buildLayoutIfNeeded):
(WebCore::UpdateAtlas::didSwapBuffers):
* platform/graphics/texmap/coordinated/UpdateAtlas.h:
(WebCore::UpdateAtlas::isInUse):

Source/WebKit2:

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CallbackData unnecessarily caches the JSValue for currentThis
https://bugs.webkit.org/show_bug.cgi?id=122616

Reviewed by Oliver Hunt.

CallbackData implements its own version of caching the JSValue* for the JSValueRef it stores.
+[JSValue valueWithJSValueRef:inContext:] already does caching, thus obviating the need for
CallbackData to do its own caching.

* API/JSContext.mm:
(+[JSContext currentThis]):
(-[JSContext beginCallbackWithData:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):
* API/JSContextInternal.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make all functions of EventDispatcher static
https://bugs.webkit.org/show_bug.cgi?id=122591

Reviewed by Antti Koivisto.

Now that EventDispatchMediator is gone, we don't have to have an EventDispatcher object.
Turn EventDispatcher into an empty class with a bunch of static functions.

We can convert it to a namespace or whatever later.

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchSimulatedClick):
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventDispatcher.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Port RemoteNetworkingContext for Soup
https://bugs.webkit.org/show_bug.cgi?id=110097

Reviewed by Darin Adler.

Original patch by Balazs Kelemen <kbalazs@webkit.org> and Kwang Yul Seo <skyul@company100.net>.

This should be a cross-platform interface so I lifted the header from
the mac directory. Removed mac specific arguments from constructor,
added setters instead. Moved platform things behind ifdefs and added
Soup specific bits.

The following things were fixed by Csaba Osztrogonác:
- solved conflicts in project.pbxproj
- removed the change in the non-existent SyncNetworkResourceLoader.cpp
- marked RemoteNetworkingContext class as FINAL
- reordered the members for platform specific initialization
- added initializers to m_needsSiteSpecificQuirks and m_localFileContentSniffingEnabled members on PLATFORM(MAC)

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* NetworkProcess/RemoteNetworkingContext.h: Renamed from Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h.
(WebKit::RemoteNetworkingContext::create):
(WebKit::RemoteNetworkingContext::RemoteNetworkingContext):
(WebKit::RemoteNetworkingContext::setNeedsSiteSpecificQuirks):
(WebKit::RemoteNetworkingContext::setLocalFileContentSniffingEnabled):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Added.
(WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
(WebKit::RemoteNetworkingContext::isValid):
(WebKit::RemoteNetworkingContext::initiatingPageID):
(WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::storageSession):
(WebKit::RemoteNetworkingContext::privateBrowsingSession):
* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed build fix after r157228

The changes in r157228 trigger a bug in VS2010. This patch works around the compiler bug
to allow this platform to build.

* dom/Range.cpp: Move implementation to header file.
* dom/Range.h: Inline the method.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open): Add stub method (with pointer arguments) to call the real
method with references.
* page/DOMWindow.h: Declare stub method taking pointer arguments to avoid compiler bug.
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend): Use work-around method when building under
the buggy version of Visual Studio.



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