Web Inspector: Gracefully handle nil name -[JSContext setName:]
https://bugs.webkit.org/show_bug.cgi?id=130262

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-03-14
Reviewed by Mark Hahnenberg.

* API/JSContext.mm:
(-[JSContext setName:]):
Gracefully handle nil input.

* API/tests/testapi.c:
(globalContextNameTest):
* API/tests/testapi.mm:
Test for nil / NULL names in the ObjC and C APIs.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor Path to Path2D and remove currentPath
https://bugs.webkit.org/show_bug.cgi?id=130236

Reviewed by Dean Jackson.

Source/WebCore:

Other implementations prefer Path2D over Path. Furthermore, currentPath is not the right
way to apply a Path2D object to a context. Main argument is that currentPath creates a copy
of the Path2D object. Instead we pass Path2D as argument to fill, stroke and clip now.

Tests: fast/canvas/canvas-clip-path.html
       fast/canvas/canvas-fill-path.html
       fast/canvas/canvas-stroke-path.html

* bindings/scripts/CodeGeneratorJS.pm: WebIDL parser didn't handle enumerations
    for overloaded methods at all.
(GenerateParametersCheckExpression):
* html/canvas/CanvasRenderingContext2D.cpp: New functions with DOMPath argument.
(WebCore::CanvasRenderingContext2D::fill):
(WebCore::CanvasRenderingContext2D::stroke):
(WebCore::CanvasRenderingContext2D::clip):
(WebCore::CanvasRenderingContext2D::fillInternal): Internal method to avoid code duplication
    and copy operation.
(WebCore::CanvasRenderingContext2D::strokeInternal): Ditto.
(WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/DOMPath.idl: Rename Path to Path2D.

LayoutTests:

Add new tests for Path2D object and new functions fill(),
stroke() and clip() with Path2D argument.

* fast/canvas/canvas-clip-path-expected.txt: Added.
* fast/canvas/canvas-clip-path.html: Added.
* fast/canvas/canvas-currentPath-crash-expected.txt: Removed.
* fast/canvas/canvas-currentPath-crash.html: Removed.
* fast/canvas/canvas-currentPath-expected.txt: Removed.
* fast/canvas/canvas-currentPath.html: Removed.
* fast/canvas/canvas-fill-path-expected.txt: Added.
* fast/canvas/canvas-fill-path.html: Added.
* fast/canvas/canvas-path-constructors-expected.txt:
* fast/canvas/canvas-path-object-expected.txt:
* fast/canvas/canvas-stroke-path-expected.txt: Added.
* fast/canvas/canvas-stroke-path.html: Added.
* fast/canvas/script-tests/canvas-clip-path.js: Added.
(areaColor):
* fast/canvas/script-tests/canvas-currentPath-crash.js: Removed.
* fast/canvas/script-tests/canvas-currentPath.js: Removed.
* fast/canvas/script-tests/canvas-fill-path.js: Added.
(areaColor):
* fast/canvas/script-tests/canvas-path-constructors.js:
* fast/canvas/script-tests/canvas-path-object.js:
* fast/canvas/script-tests/canvas-stroke-path.js: Added.
(areaColor):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] Improve behavior of fixed elments on zooming
https://bugs.webkit.org/show_bug.cgi?id=130253

Reviewed by Beth Dakin.

Correctly reposition right- and bottom-relative position:fixed
elements on zooming in WK2 iOS by telling the scrolling tree
about zoom-related viewport changes.

Source/WebCore:

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::rectForViewportConstrainedObjects):
(WebCore::FrameView::viewportConstrainedObjectsRect): We need to be able to
recompute the fixed position rect from the scrolling tree on iOS, so we need
a static function, similar to scrollOffsetForFixedPosition(), that computes
the constrained viewport.
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor): When scrolling (and, by implication, zooming)
is delegated, then setPageScaleFactor() should not affect the scroll position.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Go back to just
passing the visibleContentRect() for iOS.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Entrypoint to
the scrolling tree, called when the viewport is changed by zooming.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
(WebCore::ScrollingTreeScrollingNodeIOS::setScrollLayerPosition): Use the
new FrameView::rectForViewportConstrainedObjects() to compute the correct viewport
for fixed/sticky child nodes.
(WebCore::ScrollingTreeScrollingNodeIOS::updateForViewport):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateForViewport):

Source/WebKit2:

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
Drive-by cleanup; typedef the flags field to an unsigned, to avoid ugly casting.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Pass out a flag to say
if the update contained a new fixed or sticky layer.
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
Call into the new ScrolingTree::viewportChangedViaDelegatedScrolling().
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: If we got a new fixed
or sticky layer, set fixedOrStickyLayerChanged to true.
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
Remember both the old zoomScale and the filteredScale, since the fixed position rect
should be computed using the unfiltered scale.
Some FloatRect -> CGRect changes.
Now call viewportChangedViaDelegatedScrolling() on the scrolling coordinator.
(-[WKContentView fixedPositionRectFromExposedRect:scale:]): Call the
FrameView function to compute the iOS fixed position rect.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): If the update
got a new fixed or sticky layer, run the scrolling tree logic to make sure
it gets into the right place.
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree): If we logged here,
we'd log twice if the tiled scrolling indicator was enabled, so
hoisted the logging out into the caller.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the iOS build and sort the exports file.

* WebCore.exp.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Remove -fno-tree-sra workaround for GCC 4.5
https://bugs.webkit.org/show_bug.cgi?id=130258

Reviewed by Martin Robinson.

GCC compilers 4.7 and later are supported, so there's no need for disabling
the -ftree-sra optimization which was causing problems when enabled on GCC 4.5.

* Source/cmake/WebKitHelpers.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] CSS parser accepts trailing position arguments
https://bugs.webkit.org/show_bug.cgi?id=129514

Reviewed by Andreas Kling.

Source/WebCore:

Add a check to make sure there are no remaining function args
following a position in the circle() and ellipse() css shape
functions.

Updated existing parsing tests.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):

LayoutTests:

Add a shape with an additional argument trailing the position
in the css shapes functions.

* fast/shapes/parsing/parsing-shape-inside-expected.txt:
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: AccessibilityObject::invalidStatus() is incorrect when aria-invalid="undefined" or whitespace
https://bugs.webkit.org/show_bug.cgi?id=130071

Patch by James Craig <jcraig@apple.com> on 2014-03-14
Reviewed by Chris Fleizach.

Accounted for whitespace values and the explicit string, "undefined".

Source/WebCore:

Test: accessibility/aria-invalid.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::invalidStatus):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):

LayoutTests:

* accessibility/aria-invalid-expected.txt:
* accessibility/aria-invalid.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Sync extended attribute related rules with AppSandbox profile
https://bugs.webkit.org/show_bug.cgi?id=130263
<rdar://problem/16318965>

Reviewed by Sam Weinig.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/PlugInSandboxProfiles/com.apple.QuickTime Plugin.plugin.sb:
* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
* Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
* Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
* Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
* Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
* WebProcess/com.apple.WebProcess.sb.in:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sometimes we need to be explicit about the SDK when running ranlib on Darwin
https://bugs.webkit.org/show_bug.cgi?id=130265

Reviewed by Michael Saboff.

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up unused externs from WebCore logging.
https://bugs.webkit.org/show_bug.cgi?id=130240

Reviewed by Andreas Kling.

* platform/Logging.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin work on the bundle parameter API
https://bugs.webkit.org/show_bug.cgi?id=130267

Reviewed by Dan Bernstein.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _objectForBundleParameter:]):
(-[WKProcessPool _setObject:forBundleParameter:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebContext.h:
(WebKit::WebContext::bundleParameters):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::ensureBundleParameters):
(WebKit::WebContext::platformInitializeWebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Add autocomplete for -webkit-shape-outside
https://bugs.webkit.org/show_bug.cgi?id=130268

Reviewed by Joseph Pecoraro.

Add completions for -webkit-shape-outside. Also add the box shapes to
the possible completions for clip-path.

* UserInterface/Models/CSSKeywordCompletions.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Release-assert if someone starts the WebThread in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=130270
<rdar://problem/16332380>

Reviewed by Sam Weinig.

If someone tries to start the WebThread in the WebProcess, assert,
even in release builds, because this should never happen.

* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the iOS build.

* UIProcess/mac/WebContextMac.mm:

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