[ATK] Missing checks in returnIfWebKitAccessibleIsInvalid
https://bugs.webkit.org/show_bug.cgi?id=122600

Patch by Mario Sanchez Prada <mario.prada@samsung.com> on 2013-10-10
Reviewed by Chris Fleizach.

Check that the AccessibilityObject associated to the ATK wrapper
is not NULL and contains a valid reference to the document before
calling AccessibilityObject::updateBackingStore().

* accessibility/atk/WebKitAccessibleUtil.h: Add extra checks.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: activeDOMWindow() and firstDOMWindow() should return references.
<https://webkit.org/b/122598>

Reviewed by Anders Carlsson.

Now that wrappers vend references to their WebCore objects, follow
up and make these two return references as well.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove duplicate entry for editing/spelling/spellcheck-paste.html.

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove custom finalizer for Node JS wrappers.
<https://webkit.org/b/122603>

Reviewed by Geoff Garen.

Node can just use the auto-generated finalizer, the custom one was
identical to what the generator would output.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: VoiceOver speaking too much when group elements with tabindex=-1 are used
https://bugs.webkit.org/show_bug.cgi?id=122574

Reviewed by Mario Sanchez Prada.

Source/WebCore: 

Tests: accessibility/negative-tabindex-does-not-expose-label.html

Elements that expose tabindex=-1 are being identified as generic focusable elements for accessibility.
Which among other things, determines whether to create an accessible name for the object. 
This has the negative effect of causing VoiceOver to speak way too much information when navigating inside
a <div> with this attribute.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):
(WebCore::AccessibilityNodeObject::title):

LayoutTests: 

* accessibility/negative-tabindex-does-not-expose-label-expected.txt: Added.
* accessibility/negative-tabindex-does-not-expose-label.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, the inspector protocol timeouts are also affecting TestInspectorServer.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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