[ATK] Issues with edge cases when getting offsets for a text range in AtkText
https://bugs.webkit.org/show_bug.cgi?id=118908

Reviewed by Martin Robinson.

Source/WebCore:

Reimplement getSelectionOffsetsForObject() just in term of
Positions instead of using ranges, which makes it simpler and
works better. Also, make sure we use the right Node as reference
for the accessibility object by getting the proper one both for
text control objects (e.g. input, text area) and normal ones.

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getNodeForAccessibilityObject): New helper function to ensure we
always get the relevant object from the DOM tree for a given
accessibility object, in the context of the implementation of
AtkText, so it works both with Text Controls and other elements.
(getSelectionOffsetsForObject): Rewritten this function in terms
of VisiblePositions and avoiding weird operations with ranges, so
we have more control to fine tune the results and give more
accurate ones. Besides, now it works better with edge cases.

Source/WebKit/gtk:

* tests/testatk.c:
(runGetTextTests): Updated unit tests to check more cases of
calling the atk_text_get_text_*_offset() functions for WORD.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CoordinatedGraphics: Add API to get and set the active state of a WebView
https://bugs.webkit.org/show_bug.cgi?id=119067

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-07-29
Reviewed by Noam Rosenthal.

Source/WebCore:

Added a method to return whether a scene is active or not.

No new tests, no behavior change.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
(WebCore::CoordinatedGraphicsScene::isActive): Added method to return the
active state of the scene.

Source/WebKit2:

A view being in the "active" state generally means that it is not in the
"background", although this definition can vary depending on the platform
under consideration.

This patch adds the following APIs to WKView:
- bool WKViewIsActive(WKViewRef)
This API accepts a WKViewRef as parameter and returns a boolean indicating
whether the given view is active.

- void WKViewSetIsActive(WKViewRef, bool)
This API accepts a WKViewRef and a boolean as parameteres, and it sets the
active state of the given view to the given boolean argument.

* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewIsActive): API added.
(WKViewSetIsActive): Ditto.
* UIProcess/API/C/CoordinatedGraphics/WKView.h: Export aforementioned API.
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::initialize): Use new setActive method.
(WebKit::WebView::setActive): Added method to set the active state of the
view.
(WebKit::WebView::isActive): Added method to return the active state of
view.
(WebKit::WebView::enterAcceleratedCompositingMode): Use new setActive
method.
(WebKit::WebView::exitAcceleratedCompositingMode): Ditto.
* UIProcess/CoordinatedGraphics/WebView.h: Added declarations of isActive
and setActive.

Tools:

Added API tests for WKViewIsActive and WKViewSetIsActive.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::webProcessCrashed):
(TestWebKitAPI::webProcessRelaunched):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive_Bundle.cpp:
Bundle added to allow crashing the WebProcess and testing the active state of a view
under such condition.
(TestWebKitAPI::WKViewIsActiveSetIsActiveTest::WKViewIsActiveSetIsActiveTest):
(TestWebKitAPI::WKViewIsActiveSetIsActiveTest::didReceiveMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Made EGL useable by non-cairo ports.
https://bugs.webkit.org/show_bug.cgi?id=119177

Reviewed by Brent Fulgham.

* platform/graphics/cairo/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
Protected Cairo-specific code with #if USE(CAIRO)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support infrastructure for iOS WebKit port
https://bugs.webkit.org/show_bug.cgi?id=119168

Reviewed by Ryosuke Niwa.

Implement support infrastructure towards building iOS WebKit.

* Scripts/webkitdirs.pm:
(xcodeSDKPlatformName): Added.
(determineConfigurationProductDir):
(builtDylibPathForName):
(willUseIOSDeviceSDKWhenBuilding): Added.
(willUseIOSSimulatorSDKWhenBuilding): Added.
(isIOSWebKit): Added.
(copyInspectorFrontendFiles):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(148300) GIFs not reanimated after resumeActiveDOMObjectAndAnimations
https://bugs.webkit.org/show_bug.cgi?id=119217

Reviewed by Tim Horton.

Commit 148300 introduced a new better was of restarting GIF animations after
they have been suspended. Unfortunately the method was not activated when a page
is resumed but only when it is returning from background.

This fixes GIF animations that are stopped during user interaction on Qt and other
platforms using suspendActiveDOMObjectAndAnimations.

* page/Frame.cpp:
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Implement allAttributes() for AccessibilityUIElement
https://bugs.webkit.org/show_bug.cgi?id=118966

Reviewed by Gustavo Noronha Silva.

Tools:

Implemented AccessibilityUIElement::allAttributes() both in
DumpRenderTree and the WebKitTestRunner.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(getAtkAttributeSetAsString): Moved up in the file, and refactored
to use StringBuilder and return a String instead of a gchar*.
(roleToString): Changed not to return the "AXRole: " prefix, so
we can use it as well from attributesOfElement().
(attributesOfElement): New function to dump attributes for an object.
(AccessibilityUIElement::allAttributes): Call attributesOfElement().
(AccessibilityUIElement::role): Updated to prefix "AXRole: ".

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(getAtkAttributeSetAsString): Refactored to use StringBuilder and return
a String instead of a gchar*.

(WTF::roleToString): Changed not to return the "AXRole: " prefix,
so we can use it as well from attributesOfElement().
(WTF::attributesOfElement): New function to dump attributes for an object.
(WTR::AccessibilityUIElement::allAttributes): Call attributesOfElement().
(WTR::AccessibilityUIElement::role): Updated to prefix "AXRole: ".

LayoutTests:

Removed fixed tests from TestExpectations and added/updated expected
results for tests that are now dumping more useful information.

* platform/gtk/TestExpectations: Removed four fixed tests.
* platform/gtk/accessibility/image-link-expected.txt: Updated.
* platform/gtk/accessibility/table-cell-spans-expected.txt: Updated
* platform/gtk/accessibility/table-cells-expected.txt: Updated
* platform/gtk/accessibility/table-detection-expected.txt: Added.
* platform/gtk/accessibility/table-one-cell-expected.txt: Added.
* platform/gtk/accessibility/table-with-rules-expected.txt: Added.
* platform/gtk/accessibility/transformed-element-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT_NOT_REACHED was touched in WebCore::SVGAnimatedType::valueAsString
https://bugs.webkit.org/show_bug.cgi?id=118744

Reviewed by Philip Rogers.

Source/WebCore:

If we have an <animateTransform> tag that sets the attributeName and attributeType
properties however they are not consistent and we shouldn't try to apply it.
It is already checked and catched in SVGAnimateElement::resetAnimatedType() but
DontApplyAnimation case isn't handled properly. The patch forces an early return
in this case.

Test: svg/animations/attributeNameAndAttributeTypeMissmatch.svg

* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::resetAnimatedType):

LayoutTests:

Adding test to check whether attributeName and attributeType are consistent in <animateTransform>.

* platform/qt/svg/animations/attributeNameAndAttributeTypeMissmatch-expected.txt: Added.
* svg/animations/attributeNameAndAttributeTypeMissmatch.svg: Added.

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