GTK: AX: DRT needs to use correct root object method.
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 17:31:07 +0000 (17:31 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 17:31:07 +0000 (17:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=51911

Reviewed by Martin Robinson.

Tools:

* DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
(AccessibilityController::rootElement):

WebKit/gtk:

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::getRootAccessibleElement):
(DumpRenderTreeSupportGtk::getFocusedAccessibleElement):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:

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

Tools/ChangeLog
Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

index b9971be..2c95f17 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-05  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Martin Robinson.
+
+        GTK: AX: DRT needs to use correct root object method.
+        https://bugs.webkit.org/show_bug.cgi?id=51911
+
+        * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+        (AccessibilityController::rootElement):
+
 2011-01-05  Gabor Rapcsanyi  <rgabor@inf.u-szeged.hu>
 
         Rubber-stamped by Csaba Osztrogon√°c.
index 589e53c..c572633 100644 (file)
@@ -60,13 +60,11 @@ AccessibilityUIElement AccessibilityController::focusedElement()
 
 AccessibilityUIElement AccessibilityController::rootElement()
 {
-    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+    AtkObject* accessible = DumpRenderTreeSupportGtk::getRootAccessibleElement(mainFrame);
+    if (!accessible)
+        return 0;
 
-    // The presumed, desired rootElement is the parent of the web view.
-    GtkWidget* webViewParent = gtk_widget_get_parent(GTK_WIDGET(view));
-    AtkObject* axObject = gtk_widget_get_accessible(webViewParent);
-    return AccessibilityUIElement(axObject);
+    return AccessibilityUIElement(accessible);
 }
 
 void AccessibilityController::setLogFocusEvents(bool)
index 42bd698..ebe0c32 100644 (file)
@@ -1,5 +1,17 @@
 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
 
+        Reviewed by Martin Robinson.
+
+        GTK: AX: DRT needs to use correct root object method.
+        https://bugs.webkit.org/show_bug.cgi?id=51911
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::getRootAccessibleElement):
+        (DumpRenderTreeSupportGtk::getFocusedAccessibleElement):
+        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+
+2011-01-04  Chris Fleizach  <cfleizach@apple.com>
+
         Reviewed by Sam Weinig.
 
         WK2: Support Accessibility
index d72d834..dabe4b5 100644 (file)
@@ -413,7 +413,7 @@ void DumpRenderTreeSupportGtk::clearMainFrameName(WebKitWebFrame* frame)
     core(frame)->tree()->clearName();
 }
 
-AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* frame)
+AtkObject* DumpRenderTreeSupportGtk::getRootAccessibleElement(WebKitWebFrame* frame)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
 
@@ -429,6 +429,19 @@ AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame*
     if (!wrapper)
         return 0;
 
+    return wrapper;
+#else
+    return 0;
+#endif
+}
+
+AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* frame)
+{
+#if HAVE(ACCESSIBILITY)
+    AtkObject* wrapper = getRootAccessibleElement(frame);
+    if (!wrapper)
+        return 0;
+
     return webkit_accessible_get_focused_element(WEBKIT_ACCESSIBLE(wrapper));
 #else
     return 0;
index 61764ab..663f13a 100644 (file)
@@ -64,6 +64,7 @@ public:
     static void resumeAnimations(WebKitWebFrame*);
     static void clearMainFrameName(WebKitWebFrame*);
     static AtkObject* getFocusedAccessibleElement(WebKitWebFrame*);
+    static AtkObject* getRootAccessibleElement(WebKitWebFrame*);
     static void layoutFrame(WebKitWebFrame*);
 
     // WebKitWebView