Add helper function for converting a KeyedCodingValue to a CFTypeRef
https://bugs.webkit.org/show_bug.cgi?id=116461

Reviewed by Tim Horton.

* Shared/cf/KeyedCodingValueCF.cpp: Added.
* Shared/cf/KeyedCodingValueCF.h: Added.

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fix w3c test importer unit tests after r150324
https://bugs.webkit.org/show_bug.cgi?id=116459

Reviewed by Ryosuke Niwa.

This patch fixes the unit tests to not actually call out to
'hg' (by using a mock executive) and also changes the real
directory we crawl from Source/WebCore/css to
Tools/Scripts/webkitpy/w3c to run much more quickly. We should
still change this to a mock filesystem, but that's a separate change.

* Scripts/webkitpy/w3c/test_importer.py:
(main):
(TestImporter.__init__):
(TestImporter.load_changeset):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg):
(TestImporterTest.test_import_dir_with_no_tests):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make C API more robust against null contexts
https://bugs.webkit.org/show_bug.cgi?id=116462

Reviewed by Anders Carlsson.

Handle null contexts in a non-crashy way.  It's a bug to ever call the
API with a null context, and the absence of a context means we can't
produce a meaningful result, so we still assert in debug builds.

Now where possible we detect and early return, returning null for any
pointer type, NaN for doubles, and false for any boolean result.

* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):
(JSReportExtraMemoryCost):
* API/JSContextRef.cpp:
(JSContextGetGlobalObject):
(JSContextGetGroup):
(JSContextGetGlobalContext):
(JSContextCreateBacktrace):
* API/JSObjectRef.cpp:
(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeError):
(JSObjectMakeRegExp):
(JSObjectGetPrototype):
(JSObjectSetPrototype):
(JSObjectHasProperty):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCopyPropertyNames):
* API/JSValueRef.cpp:
(JSValueGetType):
(JSValueIsUndefined):
(JSValueIsNull):
(JSValueIsBoolean):
(JSValueIsNumber):
(JSValueIsString):
(JSValueIsObject):
(JSValueIsObjectOfClass):
(JSValueIsEqual):
(JSValueIsStrictEqual):
(JSValueIsInstanceOfConstructor):
(JSValueMakeUndefined):
(JSValueMakeNull):
(JSValueMakeBoolean):
(JSValueMakeNumber):
(JSValueMakeString):
(JSValueMakeFromJSONString):
(JSValueCreateJSONString):
(JSValueToBoolean):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):
(JSValueProtect):
* API/JSWeakObjectMapRefPrivate.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed TestExpectation cleanup. Reordered lines
to match Mac version to make it easier to understand what features
are uniquely missing in Windows port.

* platform/win/TestExpectations: Reordering of lines, adds some
bug ID's to existing skipped tests.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Fix offsetLeft / offsetTop for elements inside named flow
https://bugs.webkit.org/show_bug.cgi?id=115899

Patch by Radu Stavila <stavila@adobe.com> on 2013-05-20
Reviewed by David Hyatt.

Source/WebCore:

Elements in named flows that have the body as their offsetParent, need to compute their
offsetLeft and offsetTop values relative to the body.

Tests: fast/regions/offsetLeft-offsetTop-in-multiple-regions.html
       fast/regions/offsetLeft-offsetTop-in-region-absolute-sticky-fixed.html
       fast/regions/offsetLeft-offsetTop-in-region-float-vert-rl.html
       fast/regions/offsetLeft-offsetTop-in-region-float.html
       fast/regions/offsetLeft-offsetTop-inlines-region-in-element.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
* rendering/RenderFlowThread.cpp:
(WebCore):
(WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
* rendering/RenderFlowThread.h:

LayoutTests:

Added tests for the implementation of offsetLeft and offsetTop for objects inside named flows
for which the offsetParent is the body.

* fast/regions/offsetLeft-offsetTop-in-multiple-regions-expected.txt: Added.
* fast/regions/offsetLeft-offsetTop-in-multiple-regions.html: Added.
* fast/regions/offsetLeft-offsetTop-in-region-absolute-sticky-fixed-expected.txt: Added.
* fast/regions/offsetLeft-offsetTop-in-region-absolute-sticky-fixed.html: Added.
* fast/regions/offsetLeft-offsetTop-in-region-float-expected.txt: Added.
* fast/regions/offsetLeft-offsetTop-in-region-float-vert-rl-expected.txt: Added.
* fast/regions/offsetLeft-offsetTop-in-region-float-vert-rl.html: Added.
* fast/regions/offsetLeft-offsetTop-in-region-float.html: Added.
* fast/regions/offsetLeft-offsetTop-inlines-region-in-element-expected.txt: Added.
* fast/regions/offsetLeft-offsetTop-inlines-region-in-element.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PPT: Closing tab that is hung or chewing 100% CPU leaves abandoned WebProcess.
<http://webkit.org/b/116464>
<rdar://problem/10103795>

Reviewed by Anders Carlsson.

Give the web process a 10 second chance to exit nicely after closing the last tab belonging to it.
This code only runs if there was something on the page (e.g an unload/beforeunload event handler)
preventing the UI process from killing it right away.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::forcefulTerminationTimerFired):
* UIProcess/WebProcessProxy.h:
(WebProcessProxy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a failing test expectation to editing/selection/user-drag-element-and-user-select-none.html
after r150354. The failure is tracked by the bug 116473.

* TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WTR::pathSuitableForTestResult should behave the same as _drt_descriptionSuitableForTestResult so we can unskip tests.
https://bugs.webkit.org/show_bug.cgi?id=116125

Patch by Alex Christensen <achristensen@apple.com> on 2013-05-20
Reviewed by Tim Horton.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::pathSuitableForTestResult):
Changed string operations to match _drt_descriptionSuitableForTestResult.
(WTR::dumpRequestDescriptionSuitableForTestResult):
(WTR::dumpResponseDescriptionSuitableForTestResult):
(WTR::InjectedBundlePage::willPerformClientRedirectForFrame):
(WTR::InjectedBundlePage::didInitiateLoadForResource):
(WTR::InjectedBundlePage::willSendRequestForFrame):
(WTR::InjectedBundlePage::didReceiveResponseForResource):
Pass the main frame's URL to pathSuitableForTestResult.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
Added WKBundlePageRef to willPerformClientRedirectForFrame.

LayoutTests:

* platform/wk2/TestExpectations:
Unskipped working tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Add CSS parsing support for image URI shape-inside and shape-outside values
https://bugs.webkit.org/show_bug.cgi?id=116349

Reviewed by Alexandru Chiculita.

Source/WebCore:

Add support for parsing image URI values for the shape-inside and shape-outside CSS properties.
Extended the ExclusionShapeValue class to support tracking the property's StyleImage value.

The ExclusionShapeValue::type enums were changed from all upper case to "Intercase" by order
of the style bot.

The existing CSS parsing tests were extended to check URI values.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyExclusionShape::applyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingImages):
* rendering/style/ExclusionShapeValue.h:
(WebCore::ExclusionShapeValue::createImageValue):
(ExclusionShapeValue):
(WebCore::ExclusionShapeValue::image):
(WebCore::ExclusionShapeValue::setImage):
(WebCore::ExclusionShapeValue::ExclusionShapeValue):

LayoutTests:

Check that shape values specified with a URI are parsed correctly.

* fast/exclusions/parsing-wrap-shape-inside-expected.txt:
* fast/exclusions/parsing-wrap-shape-outside-expected.txt:
* fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
* fast/exclusions/script-tests/parsing-wrap-shape-outside.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clients should have a way to extend rendering suppression
https://bugs.webkit.org/show_bug.cgi?id=116463
<rdar://problem/13738496>

Reviewed by Andy Estes.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageExtendIncrementalRenderingSuppression): Added.
(WKBundlePageStopExtendingIncrementalRenderingSuppression): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
These only have any effect if SuppressesIncrementalRendering is also enabled.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Inform the FrameView if there are any outstanding rendering suppression tokens.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::extendIncrementalRenderingSuppression):
Return the next available rendering suppression token.
Add it to the list of active tokens.
Inform the FrameView that we want to suppress rendering.

(WebKit::WebPage::stopExtendingIncrementalRenderingSuppression):
Remove the given token from the list of active tokens.
Un-suppress rendering if appropriate.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
Return if there are any active rendering suppression tokens.

* WebCore.exp.in:
Export FrameView::setVisualUpdatesAllowedByClient.

* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
Move rendering-suppression watchdog into setVisualUpdatesAllowed(bool).
setVisualUpdatesAllowed(ReadyState) should not re-enable visual updates
if the client is itself disabling visual updates.

(WebCore::Document::visualUpdatesSuppressionTimerFired):
If the watchdog fires and the client is still disabling visual
updates, we should not re-enable visual updates, but instead
wait for the client.

(WebCore::Document::setVisualUpdatesAllowedByClient):
Actually re-enable visual updates if we deferred the re-enabling above
(when the page finishes loading, but the client had them disabled).

* dom/Document.h:
(Document): Add setVisualUpdatesAllowedByClient.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView): Visual updates are allowed by default.
(WebCore::FrameView::setVisualUpdatesAllowedByClient):
Forward through to the document, but we also need to persist the state
here in FrameView so that it survives through navigation.

* page/FrameView.h:
(WebCore::FrameView::setVisualUpdatesAllowedByClient): Added.
(WebCore::FrameView::visualUpdatesAllowedByClient): Added.
Added storage for m_visualUpdatesAllowedByClient.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/batik/text/textEffect.svg is flaky on Mountain Lion builders
https://bugs.webkit.org/show_bug.cgi?id=116477

Add a failing test expectation.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] [WK2] storage/websql/open-database-creation-callback-isolated-world.html, statement-error-callback-isolated-world.html,
and transaction-success-callback-isolated-world.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=116478

Add flaky test expectations.

* platform/mac-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][JHBUILD] Make sure eet is built before evas
https://bugs.webkit.org/show_bug.cgi?id=116440

Reviewed by Gyuyoung Kim.

Mark eet as a dependency of evas since evas requires eet to enable some of its
functionality.

* efl/jhbuild.modules:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK2] Unflag tests related to layoutTestController.setSmartInsertDeleteEnabled
https://bugs.webkit.org/show_bug.cgi?id=116433

Unreviewed gardening.

Patch by Manuel Rego Casasnovas <rego@igalia.com> on 2013-05-20

* platform/gtk-wk2/TestExpectations: Unflag tests as they are passing
since r150289.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a test that inserting a character inside a URL doesn't move caret per auto correction
https://bugs.webkit.org/show_bug.cgi?id=116458

Reviewed by Darin Adler.

Add a test. This is broken on Safari 6 but fixed on ToT.

* editing/inserting/inserting-slash-inside-url-with-smart-link-expected.txt: Added.
* editing/inserting/inserting-slash-inside-url-with-smart-link.html: Added.
* platform/mac-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove DISABLE_ROUNDED_CORNER_CLIPPING
https://bugs.webkit.org/show_bug.cgi?id=115531

Patch by Jeff Rogers <jrogers@blackberry.com> on 2013-05-20
Reviewed by Andreas Kling.

BlackBerry port is no longer using this.

* rendering/RenderLayer.cpp:
(WebCore::inContainingBlockChain):
(WebCore::RenderLayer::clipToRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
position:sticky should stick for the enclosing overflow ancestor
https://bugs.webkit.org/show_bug.cgi?id=100054

Source/WebCore:

Reviewed by Beth Dakin.

Make position: -webkit-sticky be constrained by an enclosing ancestor
with non-visible overflow if there is one, rather than being constained
always by the viewport.

Test: fast/css/sticky/sticky-top-overflow.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Rename
viewportRect to constrainingRect, since it isn't just about the viewport any more.
Fix an issue where just adding stickyLocation to absContainerFrame.location() was
incorrect when the container is scrolled; we also have to take the scroll offset
into account, and that offset is stored in the layer tree.
(WebCore::RenderBoxModelObject::stickyPositionOffset):
Look for an enclosing layer with overflow clipping, and, if found, use it to
compute the sticky constraint rect.
* rendering/RenderLayer.h: Add a helpful IncludeSelfOrNot, and fix several member functions
to use it place of hard-to-read boolean arguments.
Add enclosingOverflowClipLayer(IncludeSelfOrNot).
(WebCore::RenderLayer::ancestorCompositingLayer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::enclosingOverflowClipLayer): New function, finds the enclosing
layer with overflow clip.
(WebCore::RenderLayer::enclosingCompositingLayer): Use IncludeSelfOrNot.
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint): Ditto.
(WebCore::RenderLayer::enclosingFilterLayer): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::repaintInCompositedAncestor): Use IncludeSelfOrNot.
(WebCore::isViewportConstrainedFixedOrStickyLayer): Renamed from isRootmostFixedOrStickyLayer
and moved up so we can use it in requiresCompositingForPosition().
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Only make sticky composited if
it's viewport-constrained.
(WebCore::RenderLayerCompositor::updateViewportConstraintStatus):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints): Declare StickyPositionViewportConstraints
one line down to just before it gets used.

LayoutTests:

Reviewed by Beth Dakin.

Reference test for sticky behavior inside overflow:.

* fast/css/sticky/sticky-top-overflow-expected.html: Added.
* fast/css/sticky/sticky-top-overflow.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid caret repaints if we're not showing carets anyway.
<http://webkit.org/b/116489>

Reviewed by Simon Fraser.

When moving the selection, check if we're inside a contenteditable element (or in caret browsing mode)
before repainting the caret's previous location.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::recomputeCaretRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r150386): [WK2] loader/go-back-cached-main-resource.html fails
https://bugs.webkit.org/show_bug.cgi?id=116491

Add a test expectation.

* platform/wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose a way to know when forms are added to a page or when form controls are added to a form
in the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=116334

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Add the new callbacks as part of version 2 of the WKBundlePageFormClient.

* WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
(WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
Pass the message along to the client if the client has a handler.
(WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
Ditto.
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didAssociateFormControls):
Tell the injected bundle form client for the page.
(WebKit::WebChromeClient::shouldNotifyOnFormChanges):
Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

Add tests for the new callbacks.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Add DidAssociateFormControls/_Bundle.cpp and associate-form-controls.html

* TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: Added.
(TestWebKitAPI::nullJavaScriptCallback):
A "null" callback to handle the fact that WKPageRunJavaScriptInMainFrame cannot handle null
being passed in for the callback.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
After receiving the message that didAssociateFormControls callback was invoked from adding
the form in the onload handler, tell the page to add a password field to the form, which
should also invoke didAssociateFormControls callback.
(TestWebKitAPI::setInjectedBundleClient):
Register to receive messages.
(TestWebKitAPI::TEST):
Load associate-form-controls.html and wait until the didAssociateFormControls callback has
been invoked for both adding the form and for adding a password field to the form.

* TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: Added.
(TestWebKitAPI::shouldNotifyOnFormChanges):
Return true so the didAssociateFormControls callback is invoked.
(TestWebKitAPI::didAssociateFormControls):
Tell the UI process.
(TestWebKitAPI::DidAssociateFormControlsTest::DidAssociateFormControlsTest):
(TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage):
Register for the shouldNotifyOnFormChanges and didAssociateFormControls callbacks.

* TestWebKitAPI/Tests/WebKit2/associate-form-controls.html: Added.
Add a form in response to the onload event. Add a button that will add the password field
for manual testing.

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