Reviewed by John Sullivan.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 23:02:14 +0000 (23:02 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 23:02:14 +0000 (23:02 +0000)
        <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.

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQAccObject.mm

index 6e294c4c1248c6b14a98504aace46a36c4ac6d39..9df906f7d724d0965b9e127a677da27159f5784f 100644 (file)
@@ -1,3 +1,14 @@
+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.
index a5d7573ba8f93368c7e2d5a30d03bc307b62bbef..a27ce5d79c463ece778d1cd0ab46a29073edac2b 100644 (file)
@@ -711,7 +711,6 @@ static QRect boundingBoxRect(RenderObject* obj)
 
 - (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];
@@ -726,7 +725,7 @@ static QRect boundingBoxRect(RenderObject* obj)
             }
         }
 
-        anchorElt->click();
+        anchorElt->accessKeyAction();
     }
 }
 
@@ -1880,6 +1879,10 @@ static void AXAttributedStringAppendReplaced (NSMutableAttributedString *attrStr
 #else
     if ([attributeName isEqualToString: (NSString *) kAXSelectedTextMarkerRangeAttribute])
         return YES;
+    if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
+        if ([[self role] isEqualToString:@"AXLink"])
+            return YES;
+    }
 #endif
 
     return NO;
@@ -1910,12 +1913,28 @@ static void AXAttributedStringAppendReplaced (NSMutableAttributedString *attrStr
 - (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