[EFL] Missing implementation of AccessibilityControllerEfl and AccessibilityUIElement...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 01:27:49 +0000 (01:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 01:27:49 +0000 (01:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110584

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-03-06
Reviewed by Gyuyoung Kim.

Source/WebKit/efl:

Adds support for help text in DumpRenderTree.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::accessibilityHelpText):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

Adds missing implementation of AccessibilityControllerEfl
and AccessibilityUIElementEfl files. Modify DumpRenderTreeChrome
so that it can make accessibilityController as a js object.

* DumpRenderTree/AccessibilityController.h:
(AccessibilityController):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityControllerAtk.cpp:
(AccessibilityController::childElementById): Moved declaration to base class.
Implementation can be shared among other ports.
* DumpRenderTree/efl/AccessibilityControllerEfl.cpp: Copied from Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp.
(AccessibilityController::focusedElement):
(AccessibilityController::rootElement):
(AccessibilityController::accessibleElementById):
* DumpRenderTree/efl/AccessibilityUIElementEfl.cpp: Copied from Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp.
(AccessibilityUIElement::helpText):
* DumpRenderTree/efl/CMakeLists.txt:
* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::DumpRenderTreeChrome):
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
(DumpRenderTreeChrome::onWindowObjectCleared):
(DumpRenderTreeChrome::accessibilityController):
* DumpRenderTree/efl/DumpRenderTreeChrome.h:
(DumpRenderTreeChrome):
* DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:

LayoutTests:

Unskipping LayoutTests/accessibility folder.
Added failure tests. Skipping those with missing expected results.

* platform/efl-wk1/TestExpectations:

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

15 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/efl-wk1/TestExpectations
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityController.h
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp
Tools/DumpRenderTree/efl/AccessibilityControllerEfl.cpp [new file with mode: 0644]
Tools/DumpRenderTree/efl/AccessibilityUIElementEfl.cpp [new file with mode: 0644]
Tools/DumpRenderTree/efl/CMakeLists.txt
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h
Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp

index b3434bb..3dceba5 100644 (file)
@@ -1,3 +1,15 @@
+2013-03-06  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Missing implementation of AccessibilityControllerEfl and AccessibilityUIElementEfl files
+        https://bugs.webkit.org/show_bug.cgi?id=110584
+
+        Reviewed by Gyuyoung Kim.
+
+        Unskipping LayoutTests/accessibility folder.
+        Added failure tests. Skipping those with missing expected results.
+
+        * platform/efl-wk1/TestExpectations:
+
 2013-03-06  Benjamin Poulain  <benjamin@webkit.org>
 
         WebKitTestRunner needs layoutTestController.elementDoesAutoCompleteForElementWithId
index 23253cd..3e1734d 100644 (file)
@@ -108,8 +108,77 @@ webkit.org/b/99183 svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-
 webkit.org/b/99183 svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr.html [ ImageOnlyFailure ]
 webkit.org/b/99183 svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop.html [ ImageOnlyFailure ]
  
-# The EFL port has no support for accessibility features in wk1
-Bug(EFL) accessibility [ Skip ]
+accessibility/aria-hidden-updates-alldescendants.html [ Failure ]
+accessibility/aria-invalid.html [ Failure ]
+accessibility/aria-link-supports-press.html [ Failure ]
+accessibility/aria-readonly.html [ Failure ]
+accessibility/aria-scrollbar-role.html [ Failure ]
+accessibility/aria-text-role.html [ Failure ]
+accessibility/aria-used-on-image-maps.html [ Failure ]
+accessibility/button-press-action.html [ Failure ]
+accessibility/canvas-accessibilitynodeobject.html [ Failure ]
+accessibility/canvas-fallback-content-2.html [ Failure ]
+accessibility/canvas-fallback-content.html [ Failure ]
+accessibility/disabled-controls-not-focusable.html [ Failure ]
+accessibility/heading-level.html [ Failure ]
+accessibility/ignore-spacer-elements.html [ Failure ]
+accessibility/inline-continuations.html [ Failure ]
+accessibility/loading-iframe-sends-notification.html [ Failure ]
+accessibility/loading-iframe-updates-axtree.html [ Failure ]
+accessibility/onclick-handlers.html [ Failure ]
+accessibility/secure-textfield-title-ui.html [ Failure ]
+accessibility/selection-states.html [ Failure ]
+accessibility/spinbutton-value.html [ Failure ]
+accessibility/svg-bounds.html [ Failure ]
+accessibility/svg-remote-element.html [ Failure ]
+accessibility/textarea-insertion-point-line-number.html [ Failure ]
+accessibility/textarea-line-for-index.html [ Failure ]
+accessibility/textarea-selected-text-range.html [ Failure ]
+accessibility/textbox-role-reports-selection.html [ Failure ]
+accessibility/th-as-title-ui.html [ Failure ]
+accessibility/title-ui-element-correctness.html [ Failure ]
+accessibility/transformed-element.html [ Failure ]
+accessibility/visible-elements.html [ Failure ]
+
+accessibility/adjacent-continuations-cause-assertion-failure.html [ Skip ]
+accessibility/aria-checkbox-sends-notification.html [ Skip ]
+accessibility/aria-checkbox-text.html [ Skip ]
+accessibility/aria-combobox.html [ Skip ]
+accessibility/aria-fallback-roles.html [ Skip ]
+accessibility/aria-labelledby-overrides-aria-label.html [ Skip ]
+accessibility/aria-menubar-menuitems.html [ Skip ]
+accessibility/aria-option-role.html [ Skip ]
+accessibility/aria-roles.html [ Skip ]
+accessibility/aria-tables.html [ Skip ]
+accessibility/aria-toggle-button-with-title.html [ Skip ]
+accessibility/canvas-description-and-role.html [ Skip ]
+accessibility/color-well.html [ Skip ]
+accessibility/deleting-iframe-destroys-axcache.html [ Skip ]
+accessibility/div-within-anchors-causes-crash.html [ Skip ]
+accessibility/image-link.html [ Skip ]
+accessibility/image-map1.html [ Skip ]
+accessibility/image-map2.html [ Skip ]
+accessibility/img-alt-tag-only-whitespace.html [ Skip ]
+accessibility/img-fallsback-to-title.html [ Skip ]
+accessibility/internal-link-anchors2.html [ Skip ]
+accessibility/legend.html [ Skip ]
+accessibility/lists.html [ Skip ]
+accessibility/media-element.html [ Skip ]
+accessibility/menu-list-sends-change-notification.html [ Skip ]
+accessibility/multiselect-list-reports-active-option.html [ Skip ]
+accessibility/notification-listeners.html [ Skip ]
+accessibility/platform-name.html [ Skip ]
+accessibility/plugin.html [ Skip ]
+accessibility/radio-button-group-members.html [ Skip ]
+accessibility/svg-image.html [ Skip ]
+accessibility/table-attributes.html [ Skip ]
+accessibility/table-cell-spans.html [ Skip ]
+accessibility/table-cells.html [ Skip ]
+accessibility/table-detection.html [ Skip ]
+accessibility/table-one-cell.html [ Skip ]
+accessibility/table-sections.html [ Skip ]
+accessibility/table-with-aria-role.html [ Skip ]
+accessibility/table-with-rules.html [ Skip ]
 
 # Frame flattening does not work properly for EFL port
 Bug(EFL) fast/frames/flattening/frameset-flattening-advanced.html [ Failure ]
index b9ad17b..dbe6cfd 100644 (file)
@@ -1,3 +1,16 @@
+2013-03-06  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Missing implementation of AccessibilityControllerEfl and AccessibilityUIElementEfl files
+        https://bugs.webkit.org/show_bug.cgi?id=110584
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds support for help text in DumpRenderTree.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::accessibilityHelpText):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
 2013-03-06  Benjamin Poulain  <benjamin@webkit.org>
 
         WebKitTestRunner needs layoutTestController.elementDoesAutoCompleteForElementWithId
index 2722165..320ff9f 100644 (file)
@@ -757,6 +757,18 @@ int DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(const
 }
 
 #if HAVE(ACCESSIBILITY)
+String DumpRenderTreeSupportEfl::accessibilityHelpText(const AtkObject* axObject)
+{
+    if (!axObject || !WEBKIT_IS_ACCESSIBLE(axObject))
+        return String();
+
+    WebCore::AccessibilityObject* coreObject = webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(axObject));
+    if (!coreObject)
+        return String();
+
+    return coreObject->helpText();
+}
+
 AtkObject* DumpRenderTreeSupportEfl::rootAccessibleElement(const Evas_Object* ewkFrame)
 {
     DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0);
index 9705da3..9588811 100644 (file)
@@ -129,6 +129,7 @@ public:
     static int numberOfPendingGeolocationPermissionRequests(const Evas_Object*);
 
 #if HAVE(ACCESSIBILITY)
+    static String accessibilityHelpText(const AtkObject* axObject);
     static AtkObject* focusedAccessibleElement(const Evas_Object*);
     static AtkObject* rootAccessibleElement(const Evas_Object*);
 #endif
index b99df81..bc4595e 100644 (file)
@@ -1,3 +1,36 @@
+2013-03-06  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Missing implementation of AccessibilityControllerEfl and AccessibilityUIElementEfl files
+        https://bugs.webkit.org/show_bug.cgi?id=110584
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds missing implementation of AccessibilityControllerEfl
+        and AccessibilityUIElementEfl files. Modify DumpRenderTreeChrome
+        so that it can make accessibilityController as a js object.
+
+        * DumpRenderTree/AccessibilityController.h:
+        (AccessibilityController):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/atk/AccessibilityControllerAtk.cpp:
+        (AccessibilityController::childElementById): Moved declaration to base class.
+        Implementation can be shared among other ports.
+        * DumpRenderTree/efl/AccessibilityControllerEfl.cpp: Copied from Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp.
+        (AccessibilityController::focusedElement):
+        (AccessibilityController::rootElement):
+        (AccessibilityController::accessibleElementById):
+        * DumpRenderTree/efl/AccessibilityUIElementEfl.cpp: Copied from Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp.
+        (AccessibilityUIElement::helpText):
+        * DumpRenderTree/efl/CMakeLists.txt:
+        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+        (DumpRenderTreeChrome::DumpRenderTreeChrome):
+        (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+        (DumpRenderTreeChrome::onWindowObjectCleared):
+        (DumpRenderTreeChrome::accessibilityController):
+        * DumpRenderTree/efl/DumpRenderTreeChrome.h:
+        (DumpRenderTreeChrome):
+        * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+
 2013-03-06  Benjamin Poulain  <benjamin@webkit.org>
 
         WebKitTestRunner needs layoutTestController.elementDoesAutoCompleteForElementWithId
index a6cdc46..1bb066f 100644 (file)
@@ -34,6 +34,9 @@
 #if PLATFORM(WIN)
 #include <windows.h>
 #endif
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+#include <atk/atk.h>
+#endif
 
 class AccessibilityController {
 public:
@@ -65,6 +68,10 @@ public:
     void winNotificationReceived(PlatformUIElement, const std::string& eventName);
 #endif
 
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+    AtkObject* childElementById(AtkObject* parent, const char* id);
+#endif
+
 private:
     static JSClassRef getJSClass();
 
index 3174be2..3b2d391 100644 (file)
@@ -45,7 +45,7 @@ typedef struct objc_object* PlatformUIElement;
 #include <oleacc.h>
 
 typedef COMPtr<IAccessible> PlatformUIElement;
-#elif PLATFORM(GTK)
+#elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
 #include <atk/atk.h>
 typedef AtkObject* PlatformUIElement;
 #else
index 0510319..faecfd0 100644 (file)
@@ -88,4 +88,29 @@ void AccessibilityController::removeNotificationListener()
 {
 }
 
+AtkObject* AccessibilityController::childElementById(AtkObject* parent, const char* id)
+{
+    if (!ATK_IS_OBJECT(parent))
+        return 0;
+
+    AtkAttributeSet* attributeSet = atk_object_get_attributes(parent);
+    for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) {
+        AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
+        if (!strcmp(attribute->name, "html-id")) {
+            if (!strcmp(attribute->value, id))
+                return parent;
+            break;
+        }
+    }
+
+    int childCount = atk_object_get_n_accessible_children(parent);
+    for (int i = 0; i < childCount; i++) {
+        AtkObject* result = childElementById(atk_object_ref_accessible_child(parent, i), id);
+        if (ATK_IS_OBJECT(result))
+            return result;
+    }
+
+    return 0;
+}
+
 #endif
diff --git a/Tools/DumpRenderTree/efl/AccessibilityControllerEfl.cpp b/Tools/DumpRenderTree/efl/AccessibilityControllerEfl.cpp
new file mode 100644 (file)
index 0000000..8012da6
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Jan Michael Alonzo
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AccessibilityController.h"
+
+#if HAVE(ACCESSIBILITY)
+
+#include "AccessibilityCallbacks.h"
+#include "AccessibilityUIElement.h"
+#include "DumpRenderTree.h"
+#include "DumpRenderTreeChrome.h"
+#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
+
+#include <atk/atk.h>
+#include <wtf/gobject/GOwnPtr.h>
+
+AccessibilityUIElement AccessibilityController::focusedElement()
+{
+    AtkObject* accessible =  DumpRenderTreeSupportEfl::focusedAccessibleElement(browser->mainFrame());
+    if (!accessible)
+        return 0;
+
+    return AccessibilityUIElement(accessible);
+}
+
+AccessibilityUIElement AccessibilityController::rootElement()
+{
+    AtkObject* accessible = DumpRenderTreeSupportEfl::rootAccessibleElement(browser->mainFrame());
+    if (!accessible)
+        return 0;
+
+    return AccessibilityUIElement(accessible);
+}
+
+AccessibilityUIElement AccessibilityController::accessibleElementById(JSStringRef id)
+{
+    AtkObject* root = DumpRenderTreeSupportEfl::rootAccessibleElement(browser->mainFrame());
+    if (!root)
+        return 0;
+
+    size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
+    GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
+
+    AtkObject* result = childElementById(root, idBuffer.get());
+    if (ATK_IS_OBJECT(result))
+        return AccessibilityUIElement(result);
+
+    return 0;
+}
+
+#endif
diff --git a/Tools/DumpRenderTree/efl/AccessibilityUIElementEfl.cpp b/Tools/DumpRenderTree/efl/AccessibilityUIElementEfl.cpp
new file mode 100644 (file)
index 0000000..9e115d9
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Jan Michael Alonzo
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "AccessibilityUIElement.h"
+
+#if HAVE(ACCESSIBILITY)
+
+#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
+#include <JavaScriptCore/JSStringRef.h>
+#include <atk/atk.h>
+#include <wtf/Assertions.h>
+#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GRefPtr.h>
+#include <wtf/text/WTFString.h>
+#include <wtf/unicode/CharacterNames.h>
+
+JSStringRef AccessibilityUIElement::helpText() const
+{
+    if (!m_element)
+        return JSStringCreateWithCharacters(0, 0);
+
+    ASSERT(ATK_IS_OBJECT(m_element));
+
+    String helpText = DumpRenderTreeSupportEfl::accessibilityHelpText(ATK_OBJECT(m_element));
+    GOwnPtr<gchar> axHelpText(g_strdup_printf("AXHelp: %s", helpText.utf8().data()));
+    return JSStringCreateWithUTF8CString(axHelpText.get());
+}
+
+#endif
index 67f905d..bedaa5c 100644 (file)
@@ -1,12 +1,19 @@
 set(DumpRenderTree_SOURCES
-    ${TOOLS_DIR}/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp
+    ${TOOLS_DIR}/DumpRenderTree/AccessibilityController.cpp
+    ${TOOLS_DIR}/DumpRenderTree/AccessibilityTextMarker.cpp
+    ${TOOLS_DIR}/DumpRenderTree/AccessibilityUIElement.cpp
     ${TOOLS_DIR}/DumpRenderTree/DumpRenderTreeCommon.cpp
     ${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp
     ${TOOLS_DIR}/DumpRenderTree/GCController.cpp
     ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp
     ${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp
     ${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp
+    ${TOOLS_DIR}/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp
+    ${TOOLS_DIR}/DumpRenderTree/atk/AccessibilityControllerAtk.cpp
+    ${TOOLS_DIR}/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
     ${TOOLS_DIR}/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp
+    ${TOOLS_DIR}/DumpRenderTree/efl/AccessibilityControllerEfl.cpp
+    ${TOOLS_DIR}/DumpRenderTree/efl/AccessibilityUIElementEfl.cpp
     ${TOOLS_DIR}/DumpRenderTree/efl/DumpHistoryItem.cpp
     ${TOOLS_DIR}/DumpRenderTree/efl/DumpRenderTree.cpp
     ${TOOLS_DIR}/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -115,6 +122,7 @@ set(DumpRenderTree_INCLUDE_DIRECTORIES
 
 if (ENABLE_ACCESSIBILITY)
     list(APPEND DumpRenderTree_INCLUDE_DIRECTORIES
+        ${TOOLS_DIR}/DumpRenderTree/atk
         ${ATK_INCLUDE_DIRS}
     )
     list(APPEND DumpRenderTree_LIBRARIES
index e3785b1..f87eeb0 100644 (file)
 #include <wtf/NotFound.h>
 #include <wtf/text/StringBuilder.h>
 
+#if HAVE(ACCESSIBILITY)
+#include "AccessibilityController.h"
+#endif
+
 using namespace WebCore;
 
 HashMap<unsigned long, CString> DumpRenderTreeChrome::m_dumpAssignedUrls;
@@ -70,6 +74,7 @@ DumpRenderTreeChrome::DumpRenderTreeChrome(Evas* evas)
     , m_mainFrame(0)
     , m_evas(evas)
     , m_gcController(adoptPtr(new GCController))
+    , m_axController(adoptPtr(new AccessibilityController))
 {
 }
 
@@ -297,6 +302,10 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
 
     ewk_security_policy_whitelist_origin_reset();
 
+#if HAVE(ACCESSIBILITY)
+    browser->accessibilityController()->resetToConsistentState();
+#endif
+
     DumpRenderTreeSupportEfl::clearFrameName(mainFrame());
     DumpRenderTreeSupportEfl::clearOpener(mainFrame());
     DumpRenderTreeSupportEfl::clearUserScripts(mainView());
@@ -430,6 +439,11 @@ void DumpRenderTreeChrome::onWindowObjectCleared(void* userData, Evas_Object*, v
     JSValueRef exception = 0;
     ASSERT(gTestRunner);
 
+#if HAVE(ACCESSIBILITY)
+    browser->accessibilityController()->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception);
+    ASSERT(!exception);
+#endif
+
     GCController* gcController = static_cast<GCController*>(userData);
     ASSERT(gcController);
 
@@ -850,3 +864,8 @@ void DumpRenderTreeChrome::onDownloadRequest(void*, Evas_Object*, void* eventInf
  
     browser->m_extraViews.append(newView);
 }
+
+AccessibilityController* DumpRenderTreeChrome::accessibilityController() const
+{
+    return m_axController.get();
+}
index 1fcc534..4cb592b 100644 (file)
 #include <wtf/Vector.h>
 #include <wtf/text/CString.h>
 
+#if HAVE(ACCESSIBILITY)
+#include "AccessibilityController.h"
+#endif
+
 class DumpRenderTreeChrome {
 public:
     ~DumpRenderTreeChrome();
@@ -64,10 +68,12 @@ private:
 
     Evas_Object* createView() const;
     bool initialize();
+    AccessibilityController* accessibilityController() const;
 
     Evas_Object* m_mainFrame;
     Evas_Object* m_mainView;
     Evas* m_evas;
+    OwnPtr<AccessibilityController> m_axController;
     OwnPtr<GCController> m_gcController;
     Vector<Evas_Object*> m_extraViews;
     static HashMap<unsigned long, CString> m_dumpAssignedUrls;
index 848baa1..d89a8d2 100644 (file)
 #include <webkit/webkit.h>
 #include <wtf/gobject/GOwnPtr.h>
 
-static AtkObject* childElementById(AtkObject* parent, const char* id)
-{
-    if (!ATK_IS_OBJECT(parent))
-        return 0;
-
-    AtkAttributeSet* attributeSet = atk_object_get_attributes(parent);
-    for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) {
-        AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
-        if (!strcmp(attribute->name, "html-id")) {
-            if (!strcmp(attribute->value, id))
-                return parent;
-            break;
-        }
-    }
-
-    int childCount = atk_object_get_n_accessible_children(parent);
-    for (int i = 0; i < childCount; i++) {
-        AtkObject* result = childElementById(atk_object_ref_accessible_child(parent, i), id);
-        if (ATK_IS_OBJECT(result))
-            return result;
-    }
-
-    return 0;
-}
-
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     AtkObject* accessible =  DumpRenderTreeSupportGtk::getFocusedAccessibleElement(mainFrame);