Diff
Modified: trunk/LayoutTests/ChangeLog (100891 => 100892)
--- trunk/LayoutTests/ChangeLog 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/LayoutTests/ChangeLog 2011-11-21 09:50:39 UTC (rev 100892)
@@ -1,3 +1,13 @@
+2011-11-21 Dominic Mazzoni <[email protected]>
+
+ Accessibility: Multiselect list boxes need to report the active option in addition to which items are selected.
+ https://bugs.webkit.org/show_bug.cgi?id=72479
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/multiselect-list-reports-active-option.html: Added.
+ * platform/chromium/accessibility/multiselect-list-reports-active-option-expected.txt: Added.
+
2011-11-21 Yuta Kitamura <[email protected]>
[Qt] WebSocket close tests are failing
Added: trunk/LayoutTests/accessibility/multiselect-list-reports-active-option.html (0 => 100892)
--- trunk/LayoutTests/accessibility/multiselect-list-reports-active-option.html (rev 0)
+++ trunk/LayoutTests/accessibility/multiselect-list-reports-active-option.html 2011-11-21 09:50:39 UTC (rev 100892)
@@ -0,0 +1,85 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script>
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+ function runTest() {
+ description("This tests that navigating in a multiselect list updates selection and the active selected option and sends a notification.");
+
+ if (window.accessibilityController) {
+ var menulist = document.getElementById("menulist");
+ menulist.focus();
+ window.accessibleMenulist = accessibilityController.focusedElement;
+ window.accessibleOne = accessibleMenulist.childAtIndex(0);
+ window.accessibleTwo = accessibleMenulist.childAtIndex(1);
+ window.accessibleThree = accessibleMenulist.childAtIndex(2);
+
+ function listListener(notification) {
+ document.getElementById("console").innerText += "List notification: " + notification + "\n";
+ }
+ accessibleMenulist.addNotificationListener(listListener);
+
+ shouldBe("accessibleOne.isSelected", "true");
+ shouldBe("accessibleOne.isSelectedOptionActive", "true");
+ shouldBe("accessibleTwo.isSelected", "false");
+ shouldBe("accessibleTwo.isSelectedOptionActive", "false");
+ shouldBe("accessibleThree.isSelected", "false");
+ shouldBe("accessibleThree.isSelectedOptionActive", "false");
+
+ // Change the selected index by simulating a down arrow keydown event.
+ var event = document.createEvent('KeyboardEvents');
+ event.initKeyboardEvent('keydown', true, true, document.defaultView, 'Down', 0, false, false, false, false, false);
+ menulist.dispatchEvent(event);
+
+ shouldBe("accessibleOne.isSelected", "false");
+ shouldBe("accessibleOne.isSelectedOptionActive", "false");
+ shouldBe("accessibleTwo.isSelected", "true");
+ shouldBe("accessibleTwo.isSelectedOptionActive", "true");
+ shouldBe("accessibleThree.isSelected", "false");
+ shouldBe("accessibleThree.isSelectedOptionActive", "false");
+
+ // Extend the selection by simulating a Shift + Down Arrow keydown event.
+ var event = document.createEvent('KeyboardEvents');
+ event.initKeyboardEvent('keydown', true, true, document.defaultView, 'Down', 0, false, false, true, false, false);
+ menulist.dispatchEvent(event);
+
+ shouldBe("accessibleOne.isSelected", "false");
+ shouldBe("accessibleOne.isSelectedOptionActive", "false");
+ shouldBe("accessibleTwo.isSelected", "true");
+ shouldBe("accessibleTwo.isSelectedOptionActive", "false");
+ shouldBe("accessibleThree.isSelected", "true");
+ shouldBe("accessibleThree.isSelectedOptionActive", "true");
+ }
+
+ // Make the test finish quickly whether we get the notification or not.
+ window.setTimeout(function() {
+ debug('<br /><span class="pass">TEST COMPLETE</span>');
+ if (window.accessibilityController)
+ accessibleMenulist.removeNotificationListener();
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 10);
+ }
+
+ window.addEventListener('load', function() {
+ setTimeout(runTest, 10);
+ }, false);
+</script>
+</head>
+<body>
+
+<select multiple id="menulist">
+ <option selected>One</option>
+ <option>Two</option>
+ <option>Three</option>
+ <option>Four</option>
+</select>
+
+<p id="description"></p>
+<div id="console"></div>
+
+</body>
+</html>
Added: trunk/LayoutTests/platform/chromium/accessibility/multiselect-list-reports-active-option-expected.txt (0 => 100892)
--- trunk/LayoutTests/platform/chromium/accessibility/multiselect-list-reports-active-option-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/accessibility/multiselect-list-reports-active-option-expected.txt 2011-11-21 09:50:39 UTC (rev 100892)
@@ -0,0 +1,29 @@
+
+This tests that navigating in a multiselect list updates selection and the active selected option and sends a notification.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS accessibleOne.isSelected is true
+PASS accessibleOne.isSelectedOptionActive is true
+PASS accessibleTwo.isSelected is false
+PASS accessibleTwo.isSelectedOptionActive is false
+PASS accessibleThree.isSelected is false
+PASS accessibleThree.isSelectedOptionActive is false
+PASS accessibleOne.isSelected is false
+PASS accessibleOne.isSelectedOptionActive is false
+PASS accessibleTwo.isSelected is true
+PASS accessibleTwo.isSelectedOptionActive is true
+PASS accessibleThree.isSelected is false
+PASS accessibleThree.isSelectedOptionActive is false
+PASS accessibleOne.isSelected is false
+PASS accessibleOne.isSelectedOptionActive is false
+PASS accessibleTwo.isSelected is true
+PASS accessibleTwo.isSelectedOptionActive is false
+PASS accessibleThree.isSelected is true
+PASS accessibleThree.isSelectedOptionActive is true
+List notification: SelectedChildrenChanged
+List notification: SelectedChildrenChanged
+
+TEST COMPLETE
+
Modified: trunk/Source/WebCore/ChangeLog (100891 => 100892)
--- trunk/Source/WebCore/ChangeLog 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebCore/ChangeLog 2011-11-21 09:50:39 UTC (rev 100892)
@@ -1,3 +1,18 @@
+2011-11-21 Dominic Mazzoni <[email protected]>
+
+ Accessibility: Multiselect list boxes need to report the active option in addition to which items are selected.
+ https://bugs.webkit.org/show_bug.cgi?id=72479
+
+ Reviewed by Chris Fleizach.
+
+ Test: accessibility/multiselect-list-reports-active-option.html
+
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::isSelectedOptionActive):
+ * accessibility/AccessibilityListBoxOption.h:
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isSelectedOptionActive):
+
2011-11-21 Yuta Kitamura <[email protected]>
[Qt] WebSocket close tests are failing
Modified: trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp (100891 => 100892)
--- trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -83,6 +83,15 @@
return static_cast<HTMLOptionElement*>(m_optionElement)->selected();
}
+bool AccessibilityListBoxOption::isSelectedOptionActive() const
+{
+ HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode();
+ if (!listBoxParentNode)
+ return false;
+
+ return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionIndex();
+}
+
LayoutRect AccessibilityListBoxOption::elementRect() const
{
LayoutRect rect;
Modified: trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h (100891 => 100892)
--- trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h 2011-11-21 09:50:39 UTC (rev 100892)
@@ -54,6 +54,7 @@
virtual bool accessibilityIsIgnored() const;
virtual bool isSelected() const;
virtual bool isEnabled() const;
+ virtual bool isSelectedOptionActive() const;
virtual String stringValue() const;
virtual Element* actionElement() const;
virtual Node* node() const { return m_optionElement; }
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (100891 => 100892)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2011-11-21 09:50:39 UTC (rev 100892)
@@ -407,6 +407,9 @@
virtual bool isCollapsed() const { return false; }
virtual void setIsExpanded(bool) { }
+ // In a multi-select list, many items can be selected but only one is active at a time.
+ virtual bool isSelectedOptionActive() const { return false; }
+
virtual bool hasBoldFont() const { return false; }
virtual bool hasItalicFont() const { return false; }
bool hasMisspelling() const;
Modified: trunk/Source/WebKit/chromium/ChangeLog (100891 => 100892)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-11-21 09:50:39 UTC (rev 100892)
@@ -1,3 +1,16 @@
+2011-11-21 Dominic Mazzoni <[email protected]>
+
+ Accessibility: Multiselect list boxes need to report the active option in addition to which items are selected.
+ https://bugs.webkit.org/show_bug.cgi?id=72479
+
+ Reviewed by Chris Fleizach.
+
+ Test: accessibility/multiselect-list-reports-active-option.html
+
+ * public/WebAccessibilityObject.h:
+ * src/WebAccessibilityObject.cpp:
+ (WebKit::WebAccessibilityObject::isSelectedOptionActive):
+
2011-11-20 Kenichi Ishibashi <[email protected]>
[Chromium] Remove old getFontFamilyForCharacters() and familyForChars() APIs.
Modified: trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h (100891 => 100892)
--- trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h 2011-11-21 09:50:39 UTC (rev 100892)
@@ -113,6 +113,7 @@
WEBKIT_EXPORT bool isReadOnly() const;
WEBKIT_EXPORT bool isRequired() const;
WEBKIT_EXPORT bool isSelected() const;
+ WEBKIT_EXPORT bool isSelectedOptionActive() const;
WEBKIT_EXPORT bool isVertical() const;
WEBKIT_EXPORT bool isVisible() const;
WEBKIT_EXPORT bool isVisited() const;
Modified: trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp (100891 => 100892)
--- trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -397,6 +397,15 @@
return m_private->isSelected();
}
+bool WebAccessibilityObject::isSelectedOptionActive() const
+{
+ if (m_private.isNull())
+ return false;
+
+ m_private->updateBackingStore();
+ return m_private->isSelectedOptionActive();
+}
+
bool WebAccessibilityObject::isVertical() const
{
if (m_private.isNull())
Modified: trunk/Tools/ChangeLog (100891 => 100892)
--- trunk/Tools/ChangeLog 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/ChangeLog 2011-11-21 09:50:39 UTC (rev 100892)
@@ -1,3 +1,25 @@
+2011-11-21 Dominic Mazzoni <[email protected]>
+
+ Accessibility: Multiselect list boxes need to report the active option in addition to which items are selected.
+ https://bugs.webkit.org/show_bug.cgi?id=72479
+
+ Reviewed by Chris Fleizach.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsSelectedOptionActiveCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/chromium/AccessibilityUIElement.cpp:
+ (AccessibilityUIElement::AccessibilityUIElement):
+ (AccessibilityUIElement::isSelectedOptionActiveGetterCallback):
+ * DumpRenderTree/chromium/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isSelectedOptionActive):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isSelectedOptionActive):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isSelectedOptionActive):
+
2011-11-21 Takashi Toyoshima <[email protected]>
Use Host().port_factory instead of webkitpy.layout_tests.port.factory.
Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (100891 => 100892)
--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -762,6 +762,11 @@
return JSValueMakeBoolean(context, toAXElement(thisObject)->isMultiSelectable());
}
+static JSValueRef getIsSelectedOptionActiveCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->isSelectedOptionActive());
+}
+
static JSValueRef getIsExpandedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->isExpanded());
@@ -991,6 +996,7 @@
{ "isSelected", getIsSelectedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isSelectable", getIsSelectableCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isMultiSelectable", getIsMultiSelectableCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isSelectedOptionActive", getIsSelectedOptionActiveCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isExpanded", getIsExpandedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isChecked", getIsCheckedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isVisible", getIsVisibleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (100891 => 100892)
--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h 2011-11-21 09:50:39 UTC (rev 100892)
@@ -138,6 +138,7 @@
bool isSelected() const;
bool isSelectable() const;
bool isMultiSelectable() const;
+ bool isSelectedOptionActive() const;
void setSelectedChild(AccessibilityUIElement*) const;
unsigned selectedChildrenCount() const;
AccessibilityUIElement selectedChildAtIndex(unsigned) const;
Modified: trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.cpp (100891 => 100892)
--- trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -308,6 +308,7 @@
bindProperty("isSelected", &AccessibilityUIElement::isSelectedGetterCallback);
bindProperty("isSelectable", &AccessibilityUIElement::isSelectableGetterCallback);
bindProperty("isMultiSelectable", &AccessibilityUIElement::isMultiSelectableGetterCallback);
+ bindProperty("isSelectedOptionActive", &AccessibilityUIElement::isSelectedOptionActiveGetterCallback);
bindProperty("isExpanded", &AccessibilityUIElement::isExpandedGetterCallback);
bindProperty("isChecked", &AccessibilityUIElement::isCheckedGetterCallback);
bindProperty("isVisible", &AccessibilityUIElement::isVisibleGetterCallback);
@@ -503,6 +504,11 @@
result->set(accessibilityObject().isMultiSelectable());
}
+void AccessibilityUIElement::isSelectedOptionActiveGetterCallback(CppVariant* result)
+{
+ result->set(accessibilityObject().isSelectedOptionActive());
+}
+
void AccessibilityUIElement::isExpandedGetterCallback(CppVariant* result)
{
result->set(!accessibilityObject().isCollapsed());
Modified: trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.h (100891 => 100892)
--- trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.h 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/chromium/AccessibilityUIElement.h 2011-11-21 09:50:39 UTC (rev 100892)
@@ -81,6 +81,7 @@
void isSelectedGetterCallback(CppVariant*);
void isSelectableGetterCallback(CppVariant*);
void isMultiSelectableGetterCallback(CppVariant*);
+ void isSelectedOptionActiveGetterCallback(CppVariant*);
void isExpandedGetterCallback(CppVariant*);
void isCheckedGetterCallback(CppVariant*);
void isVisibleGetterCallback(CppVariant*);
Modified: trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp (100891 => 100892)
--- trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -763,6 +763,12 @@
return false;
}
+bool AccessibilityUIElement::isSelectedOptionActive() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::isVisible() const
{
// FIXME: implement
Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (100891 => 100892)
--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2011-11-21 09:50:39 UTC (rev 100892)
@@ -1262,6 +1262,12 @@
return false;
}
+bool AccessibilityUIElement::isSelectedOptionActive() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::isVisible() const
{
// FIXME: implement
Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (100891 => 100892)
--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp 2011-11-21 09:42:57 UTC (rev 100891)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp 2011-11-21 09:50:39 UTC (rev 100892)
@@ -641,6 +641,12 @@
return (state & multiSelectable) == multiSelectable;
}
+bool AccessibilityUIElement::isSelectedOptionActive() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::isVisible() const
{
DWORD state = accessibilityState(m_element);