summaryrefslogtreecommitdiffstats
path: root/WebCore/accessibility/gtk
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/accessibility/gtk
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/accessibility/gtk')
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp29
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp17
2 files changed, 35 insertions, 11 deletions
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index f48770f..ca3e8cc 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -32,7 +32,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
AccessibilityObject* parent = parentObject();
if (!parent)
@@ -41,17 +41,34 @@ AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformI
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
- // When a list item is made up entirely of children (e.g. paragraphs)
- // the list item gets ignored. We need it.
- if (isGroup() && parent->isList())
- return IncludeObject;
+ if (isGroup()) {
+ // When a list item is made up entirely of children (e.g. paragraphs)
+ // the list item gets ignored. We need it.
+ if (parent->isList())
+ return IncludeObject;
+
+ // We expect the parent of a table cell to be a table.
+ AccessibilityObject* child = firstChild();
+ if (child && child->roleValue() == CellRole)
+ return IgnoreObject;
+ }
// Entries and password fields have extraneous children which we want to ignore.
if (parent->isPasswordField() || parent->isTextControl())
return IgnoreObject;
+ AccessibilityRole role = roleValue();
+
+ // Include all tables, even layout tables. The AT can decide what to do with each.
+ if (role == CellRole || role == TableRole)
+ return IncludeObject;
+
+ // We at some point might have a need to expose a table row; but it's not standard Gtk+.
+ if (role == RowRole)
+ return IgnoreObject;
+
// The object containing the text should implement AtkText itself.
- if (roleValue() == StaticTextRole)
+ if (role == StaticTextRole)
return IgnoreObject;
return DefaultBehavior;
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 487fa5b..ffef2a8 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -42,7 +42,6 @@
#include "AccessibilityTableColumn.h"
#include "AccessibilityTableRow.h"
#include "AtomicString.h"
-#include "CString.h"
#include "Document.h"
#include "DocumentType.h"
#include "Editor.h"
@@ -57,6 +56,7 @@
#include "NotImplemented.h"
#include "RenderText.h"
#include "TextEncoding.h"
+#include <wtf/text/CString.h>
#include <atk/atk.h>
#include <glib.h>
@@ -448,6 +448,8 @@ static AtkRole webkit_accessible_get_role(AtkObject* object)
return ATK_ROLE_LABEL;
if (node->hasTagName(HTMLNames::divTag))
return ATK_ROLE_SECTION;
+ if (node->hasTagName(HTMLNames::formTag))
+ return ATK_ROLE_FORM;
}
}
@@ -996,8 +998,13 @@ static gint webkit_accessible_text_get_caret_offset(AtkText* text)
// coreObject is the unignored object whose offset the caller is requesting.
// focusedObject is the object with the caret. It is likely ignored -- unless it's a link.
AccessibilityObject* coreObject = core(text);
- RenderObject* focusedNode = coreObject->selection().end().node()->renderer();
- AccessibilityObject* focusedObject = coreObject->document()->axObjectCache()->getOrCreate(focusedNode);
+ Node* focusedNode = coreObject->selection().end().node();
+
+ if (!focusedNode)
+ return 0;
+
+ RenderObject* focusedRenderer = focusedNode->renderer();
+ AccessibilityObject* focusedObject = coreObject->document()->axObjectCache()->getOrCreate(focusedRenderer);
int offset;
// Don't ignore links if the offset is being requested for a link.
@@ -1563,7 +1570,7 @@ static const gchar* webkit_accessible_document_get_locale(AtkDocument* document)
{
// TODO: Should we fall back on lang xml:lang when the following comes up empty?
- String language = static_cast<AccessibilityRenderObject*>(core(document))->language();
+ String language = core(document)->language();
if (!language.isEmpty())
return returnString(language);
@@ -1656,7 +1663,7 @@ static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)
interfaceMask |= 1 << WAI_TEXT;
if (!coreObject->isReadOnly())
interfaceMask |= 1 << WAI_EDITABLE_TEXT;
- } else if (static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
+ } else if (role != TableRole && static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
interfaceMask |= 1 << WAI_TEXT;
// Image