Reviewed by John Sullivan.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2006 21:09:55 +0000 (21:09 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2006 21:09:55 +0000 (21:09 +0000)
        <rdar://problem/4717841> Setting AXFocused to true does not activate the insertion point in text field

        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject accessibilitySetValue:forAttribute:]):
        For AXFocus, use focus() if the node is an element, so that selection is set.
        Matches tabbing behavior in text fields and text areas.

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

WebCore/ChangeLog
WebCore/bridge/mac/WebCoreAXObject.mm

index bbefd089f43eebd6038ce5a6112e23593d7403df..b24b4c5b047df8d61267f75b5a255d71a6739b38 100644 (file)
@@ -1,3 +1,14 @@
+2006-09-12  David Harrison  <harrison@apple.com>
+
+        Reviewed by John Sullivan.
+
+        <rdar://problem/4717841> Setting AXFocused to true does not activate the insertion point in text field
+
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject accessibilitySetValue:forAttribute:]):
+        For AXFocus, use focus() if the node is an element, so that selection is set.
+        Matches tabbing behavior in text fields and text areas.
+
 2006-09-12  Adam Roben  <aroben@apple.com>
 
         Reviewed by adele.
index eb0b4149457e281ec408fbabc9292622a68ce379..d0a6e7f17ae0cfa059aa630e88084270267084fc 100644 (file)
@@ -2174,10 +2174,14 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
     } else if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
         ASSERT(number);
         if ([self canSetFocusAttribute] && number) {
-            if ([number intValue] != 0)
-                m_renderer->document()->setFocusNode(m_renderer->element());
-            else
+            if ([number intValue] == 0)
                 m_renderer->document()->setFocusNode(0);
+            else {
+                if (m_renderer->element()->isElementNode())
+                    static_cast<Element*>(m_renderer->element())->focus();
+                else
+                    m_renderer->document()->setFocusNode(m_renderer->element());
+            }
         }
     } else if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) {
         if (!string)