+2005-01-28 David Harrison <harrison@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
+
+ * kwq/KWQAccObject.mm:
+ (-[KWQAccObject accessibilityPerformAction:]):
+ (-[KWQAccObject accessibilityIsAttributeSettable:]):
+ Add AXFocused for AXLinks.
+
2005-01-28 David Harrison <harrison@apple.com>
Reviewed by Darin.
- (void)accessibilityPerformAction:(NSString *)action
{
- // We only have the one action (press).
if ([action isEqualToString:NSAccessibilityPressAction]) {
// Locate the anchor element. If it doesn't exist, just bail.
HTMLAnchorElementImpl* anchorElt = [self anchorElement];
}
}
- anchorElt->click();
+ anchorElt->accessKeyAction();
}
}
#else
if ([attributeName isEqualToString: (NSString *) kAXSelectedTextMarkerRangeAttribute])
return YES;
+ if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
+ if ([[self role] isEqualToString:@"AXLink"])
+ return YES;
+ }
#endif
return NO;
- (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attributeName;
{
AXTextMarkerRangeRef textMarkerRange = nil;
+ NSNumber * number = nil;
+ // decode the parameter
if (CFGetTypeID(value) == AXTextMarkerRangeGetTypeID())
textMarkerRange = (AXTextMarkerRangeRef) value;
-
+
+ else if ([value isKindOfClass:[NSNumber self]])
+ number = value;
+
+ // handle the command
if ([attributeName isEqualToString: (NSString *) kAXSelectedTextMarkerRangeAttribute]) {
+ ASSERT(textMarkerRange);
[self doSetAXSelectedTextMarkerRange:textMarkerRange];
+
+ } else if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
+ ASSERT(number);
+ if ([[self role] isEqualToString:@"AXLink"]) {
+ if ([number intValue] != 0)
+ m_renderer->document()->setFocusNode(m_renderer->element());
+ else
+ m_renderer->document()->setFocusNode(0);
+ }
}
}
#endif