[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:16:39 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 25926420ca5d23853c5184024ed6ea05dc4178fc
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 5 23:22:01 2003 +0000
Add support for link clicking as an accessibility action.
Reviewed by john
* kwq/KWQAccObject.mm:
(-[KWQAccObject anchorElement]):
(-[KWQAccObject role]):
(-[KWQAccObject accessibilityAttributeNames]):
(-[KWQAccObject accessibilityActionNames]):
(-[KWQAccObject accessibilityActionDescription:]):
(-[KWQAccObject accessibilityPerformAction:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7d280d6..05156dd 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-12-05 David Hyatt <hyatt at apple.com>
+
+ Add support for link clicking as an accessibility action.
+
+ Reviewed by john
+
+ * kwq/KWQAccObject.mm:
+ (-[KWQAccObject anchorElement]):
+ (-[KWQAccObject role]):
+ (-[KWQAccObject accessibilityAttributeNames]):
+ (-[KWQAccObject accessibilityActionNames]):
+ (-[KWQAccObject accessibilityActionDescription:]):
+ (-[KWQAccObject accessibilityPerformAction:]):
+
2003-12-05 Maciej Stachowiak <mjs at apple.com>
Reviewed by John.
diff --git a/WebCore/kwq/KWQAccObject.mm b/WebCore/kwq/KWQAccObject.mm
index 773177f..666835b 100644
--- a/WebCore/kwq/KWQAccObject.mm
+++ b/WebCore/kwq/KWQAccObject.mm
@@ -30,6 +30,7 @@
#import "dom_docimpl.h"
#import "dom_elementimpl.h"
+#import "html_inlineimpl.h"
#import "dom_string.h"
#import "dom2_range.h"
#import "htmlattrs.h"
@@ -43,6 +44,7 @@
#import "render_text.h"
using DOM::ElementImpl;
+using DOM::HTMLAnchorElementImpl;
using khtml::RenderObject;
using khtml::RenderWidget;
@@ -116,6 +118,19 @@ using khtml::RenderWidget;
m_data = data;
}
+-(HTMLAnchorElementImpl*)anchorElement
+{
+ RenderObject* currRenderer;
+ for (currRenderer = m_renderer;
+ currRenderer && (!currRenderer->element() || !currRenderer->element()->hasAnchor());
+ currRenderer = currRenderer->parent());
+
+ if (!currRenderer)
+ return 0;
+
+ return static_cast<HTMLAnchorElementImpl*>(currRenderer->element());
+}
+
-(KWQAccObject*)firstChild
{
if (!m_renderer || !m_renderer->firstChild())
@@ -198,7 +213,7 @@ using khtml::RenderWidget;
if (m_renderer->isText())
return NSAccessibilityStaticTextRole;
if (m_renderer->isImage())
- return NSAccessibilityButtonRole;
+ return NSAccessibilityImageRole;
if (m_renderer->isCanvas())
return NSAccessibilityGroupRole;
if (m_renderer->isTable() || m_renderer->isTableCell())
@@ -315,27 +330,51 @@ using khtml::RenderWidget;
- (NSArray *)accessibilityAttributeNames
{
- return [NSArray arrayWithObjects: NSAccessibilityRoleAttribute,
- NSAccessibilityRoleDescriptionAttribute,
- NSAccessibilityChildrenAttribute,
- NSAccessibilityHelpAttribute,
- NSAccessibilityParentAttribute,
- NSAccessibilityPositionAttribute,
- NSAccessibilitySizeAttribute,
- //NSAccessibilitySubroleAttribute,
- NSAccessibilityTitleAttribute,
- NSAccessibilityValueAttribute,
- NSAccessibilityFocusedAttribute,
- NSAccessibilityEnabledAttribute,
- NSAccessibilityWindowAttribute,
- nil];
+ static NSArray* attributes = nil;
+ if (attributes == nil) {
+ attributes = [[NSArray alloc] initWithObjects: NSAccessibilityRoleAttribute,
+ NSAccessibilityRoleDescriptionAttribute,
+ NSAccessibilityChildrenAttribute,
+ NSAccessibilityHelpAttribute,
+ NSAccessibilityParentAttribute,
+ NSAccessibilityPositionAttribute,
+ NSAccessibilitySizeAttribute,
+ NSAccessibilityTitleAttribute,
+ NSAccessibilityValueAttribute,
+ NSAccessibilityFocusedAttribute,
+ NSAccessibilityEnabledAttribute,
+ NSAccessibilityWindowAttribute,
+ nil];
+ }
+ return attributes;
}
- (NSArray*)accessibilityActionNames
{
+ static NSArray* actions = nil;
+ if ([self anchorElement]) {
+ if (actions == nil)
+ actions = [[NSArray alloc] initWithObjects: NSAccessibilityPressAction, nil];
+ return actions;
+ }
return nil;
}
+- (NSString *)accessibilityActionDescription:(NSString *)action
+{
+ // We only have the one action (press).
+ return UI_STRING("press link", "not real string value yet");
+}
+
+- (void)accessibilityPerformAction:(NSString *)action
+{
+ // We only have the one action (press).
+ // Locate the anchor element. If it doesn't exist, just bail.
+ HTMLAnchorElementImpl* anchorElt = [self anchorElement];
+ if (!anchorElt) return;
+ anchorElt->click();
+}
+
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName
{
return NO;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list