2009-05-20 Xan Lopez <xlopez@igalia.com>
Reviewed by Jan Alonzo.
https://bugs.webkit.org/show_bug.cgi?id=25414
[GTK] ROLE_PANEL should not be used for paragraphs and list items.
Implement Atk paragraph role for paragraph elements.
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(webkit_accessible_get_role):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index f591452..6267e95 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -41,6 +41,7 @@
#include "Editor.h"
#include "Frame.h"
#include "FrameView.h"
+#include "HTMLNames.h"
#include "IntRect.h"
#include "NotImplemented.h"
@@ -268,6 +269,11 @@
if (!AXObject)
return ATK_ROLE_UNKNOWN;
+ // WebCore does not know about paragraph role
+ Node* node = static_cast<AccessibilityRenderObject*>(AXObject)->renderer()->node();
+ if (node && node->hasTagName(HTMLNames::pTag))
+ return ATK_ROLE_PARAGRAPH;
+
// Note: Why doesn't WebCore have a password field for this
if (AXObject->isPasswordField())
return ATK_ROLE_PASSWORD_TEXT;