<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
+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.
} 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)