[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cfleizach at apple.com
cfleizach at apple.com
Wed Dec 22 15:09:45 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e3cf9e492523b97b8709bc09da5c6d422a47b096
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 28 18:54:13 2010 +0000
AX: multi select group option does not handle setting of AXSelectedChildren correctly
https://bugs.webkit.org/show_bug.cgi?id=48464
Reviewed by Adele Peterson.
WebCore:
Ensure that when selecting an item from a <select> element, it accounts for <optgroups>.
Test: platform/mac/accessibility/select-element-selection-with-optgroups.html
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::setSelected):
WebKitTools:
Add support for querying information about selected children to DRT, including:
selectedChildAtIndex
selectedChildrenCount
setSelectedChild
* DumpRenderTree/AccessibilityUIElement.cpp:
(selectedChildAtIndexCallback):
(setSelectedChildCallback):
(selectedChildrenCountCallback):
(AccessibilityUIElement::setSelectedChild):
(AccessibilityUIElement::selectedChildrenCount):
(AccessibilityUIElement::selectedChildAtIndex):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::selectedChildAtIndex):
(AccessibilityUIElement::selectedChildrenCount):
(AccessibilityUIElement::setSelectedChild):
LayoutTests:
* platform/mac/accessibility/select-element-selection-with-optgroups-expected.txt: Added.
* platform/mac/accessibility/select-element-selection-with-optgroups.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4c28573..b8dbc45 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-28 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ * platform/mac/accessibility/select-element-selection-with-optgroups-expected.txt: Added.
+ * platform/mac/accessibility/select-element-selection-with-optgroups.html: Added.
+
2010-10-28 Sergio Villar Senin <svillar at igalia.com>
Reviewed by Martin Robinson.
diff --git a/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups-expected.txt b/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups-expected.txt
new file mode 100644
index 0000000..724ede1
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups-expected.txt
@@ -0,0 +1,17 @@
+
+This tests that setting selection within a list box works correctly if there are optgroups
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS selectElement.selectedChildrenCount is 0
+PASS selectElement.selectedChildrenCount is 1
+PASS selectElement.selectedChildAtIndex(0).isEqual(option1) is true
+PASS selectElement.selectedChildrenCount is 1
+PASS selectElement.selectedChildAtIndex(0).isEqual(option2) is true
+PASS selectElement.selectedChildrenCount is 1
+PASS selectElement.selectedChildAtIndex(0).isEqual(option3) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups.html b/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups.html
new file mode 100644
index 0000000..c3f8af3
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/select-element-selection-with-optgroups.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<select name="suite" id="suite" multiple="multiple" size="24">
+
+<optgroup label="main">
+<option value="881">Item1</option>
+<option value="938">Item2</option>
+</optgroup>
+<optgroup label="primary">
+<option value="1027">Item3</option>
+<option value="1049">Item4</option>
+<option value="1050">Item5</option>
+</optgroup>
+</select>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that setting selection within a list box works correctly if there are optgroups");
+
+ if (window.accessibilityController) {
+
+ document.getElementById("suite").focus();
+ var selectElement = accessibilityController.focusedElement;
+
+ shouldBe("selectElement.selectedChildrenCount", "0");
+
+ var option1 = selectElement.childAtIndex(1);
+ var option2 = selectElement.childAtIndex(2);
+ var option3 = selectElement.childAtIndex(4);
+
+ selectElement.setSelectedChild(option1);
+ shouldBe("selectElement.selectedChildrenCount", "1");
+ shouldBeTrue("selectElement.selectedChildAtIndex(0).isEqual(option1)");
+
+ selectElement.setSelectedChild(option2);
+ shouldBe("selectElement.selectedChildrenCount", "1");
+ shouldBeTrue("selectElement.selectedChildAtIndex(0).isEqual(option2)");
+
+ selectElement.setSelectedChild(option3);
+ shouldBe("selectElement.selectedChildrenCount", "1");
+ shouldBeTrue("selectElement.selectedChildAtIndex(0).isEqual(option3)");
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d2325dc..9f6fd98 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-28 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ Ensure that when selecting an item from a <select> element, it accounts for <optgroups>.
+
+ Test: platform/mac/accessibility/select-element-selection-with-optgroups.html
+
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::setSelected):
+
2010-10-28 Dan Bernstein <mitz at apple.com>
Reviewed by Adam Roben.
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 3e4dad9..81a5978 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -184,7 +184,9 @@ void AccessibilityListBoxOption::setSelected(bool selected)
if ((isOptionSelected && selected) || (!isOptionSelected && !selected))
return;
- selectElement->accessKeySetSelectedIndex(listBoxOptionIndex());
+ // Convert from the entire list index to the option index.
+ int optionIndex = static_cast<SelectElement*>(selectElement)->listToOptionIndex(listBoxOptionIndex());
+ selectElement->accessKeySetSelectedIndex(optionIndex);
}
HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 87ec80f..c54326f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,29 @@
+2010-10-28 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ Add support for querying information about selected children to DRT, including:
+ selectedChildAtIndex
+ selectedChildrenCount
+ setSelectedChild
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (selectedChildAtIndexCallback):
+ (setSelectedChildCallback):
+ (selectedChildrenCountCallback):
+ (AccessibilityUIElement::setSelectedChild):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::setSelectedChild):
+
2010-10-27 Sam Weinig <sam at webkit.org>
Reviewed by Anders Carlsson.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 52d238d..87be335 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -204,6 +204,15 @@ static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef functio
return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->getChildAtIndex(indexNumber));
}
+static JSValueRef selectedChildAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = -1;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->selectedChildAtIndex(indexNumber));
+}
+
static JSValueRef linkedUIElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int indexNumber = -1;
@@ -260,6 +269,17 @@ static JSValueRef isEqualCallback(JSContextRef context, JSObjectRef function, JS
return JSValueMakeBoolean(context, toAXElement(thisObject)->isEqual(toAXElement(otherElement)));
}
+static JSValueRef setSelectedChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ JSObjectRef element = 0;
+ if (argumentCount == 1)
+ element = JSValueToObject(context, arguments[0], exception);
+
+ toAXElement(thisObject)->setSelectedChild(toAXElement(element));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef elementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int x = 0;
@@ -695,6 +715,11 @@ static JSValueRef speakCallback(JSContextRef context, JSObjectRef thisObject, JS
return JSValueMakeString(context, speakString.get());
}
+static JSValueRef selectedChildrenCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ return JSValueMakeNumber(context, toAXElement(thisObject)->selectedChildrenCount());
+}
+
static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -757,6 +782,9 @@ static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObj
#if !PLATFORM(MAC)
JSStringRef AccessibilityUIElement::speak() { return 0; }
JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
+unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
#endif
#if !SUPPORTS_AX_TEXTMARKERS
@@ -860,6 +888,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "speak", speakCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildrenCount", selectedChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0, 0 }
};
@@ -920,6 +949,8 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 9311dfd..3120e65 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -130,9 +130,14 @@ public:
JSStringRef selectedTextRange();
bool isEnabled();
bool isRequired() const;
+
bool isSelected() const;
bool isSelectable() const;
bool isMultiSelectable() const;
+ void setSelectedChild(AccessibilityUIElement*) const;
+ unsigned selectedChildrenCount() const;
+ AccessibilityUIElement selectedChildAtIndex(unsigned) const;
+
bool isExpanded() const;
bool isChecked() const;
bool isVisible() const;
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 2ca5755..e27ee0e 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -381,6 +381,26 @@ AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned inde
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];
+ if (index < [array count])
+ return [array objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+unsigned AccessibilityUIElement::selectedChildrenCount() const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ return [m_element accessibilityArrayAttributeCount:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
BEGIN_AX_OBJC_EXCEPTIONS
@@ -1103,6 +1123,14 @@ void AccessibilityUIElement::press()
END_AX_OBJC_EXCEPTIONS
}
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];
+ [m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
+}
+
JSStringRef AccessibilityUIElement::accessibilityValue() const
{
// FIXME: implement
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list