[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:13:03 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit fe43c00b16c9adb5e9ec3b7304c2c05625cd5e05
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 5 19:00:29 2010 +0000
2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=32571
Added a test to make sure that ARIA checkboxes correctly handle the aria-checked attribute.
* accessibility/aria-checkbox-checked-expected.txt: Added.
* accessibility/aria-checkbox-checked.html: Added.
2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=32571
For an object with an aria role of "checkbox" or "radiobutton",
Use the "aria-checked" attribute to determine if it's checked.
Test: accessibility/aria-checkbox-checked.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isChecked):
2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=32571
For an object with an aria role of "checkbox" or "radiobutton",
use the "aria-checked" attribute to determine if it's checked.
These changes add an isChecked() method to AccessibilityUIElement
so that we can check for this property from a layout test.
* DumpRenderTree/AccessibilityUIElement.cpp:
(getIsCheckedCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(AccessibilityUIElement::isChecked):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::isChecked):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::isChecked):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f81ae26..c456e8e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32571
+
+ Added a test to make sure that ARIA checkboxes correctly handle the aria-checked attribute.
+
+ * accessibility/aria-checkbox-checked-expected.txt: Added.
+ * accessibility/aria-checkbox-checked.html: Added.
+
2010-01-04 Chris Fleizach <cfleizach at apple.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/accessibility/aria-checkbox-checked-expected.txt b/LayoutTests/accessibility/aria-checkbox-checked-expected.txt
new file mode 100644
index 0000000..161c639
--- /dev/null
+++ b/LayoutTests/accessibility/aria-checkbox-checked-expected.txt
@@ -0,0 +1,21 @@
+
+X
+X
+
+This tests that ARIA checkboxes correctly handle the aria-checked attribute.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS checkbox.isChecked is false
+PASS checkbox.isChecked is true
+PASS checkbox.isChecked is false
+PASS checkbox.isChecked is true
+PASS checkbox.isChecked is false
+PASS checkbox.isChecked is true
+PASS checkbox.isChecked is false
+PASS checkbox.isChecked is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-checkbox-checked.html b/LayoutTests/accessibility/aria-checkbox-checked.html
new file mode 100644
index 0000000..5fe92c3
--- /dev/null
+++ b/LayoutTests/accessibility/aria-checkbox-checked.html
@@ -0,0 +1,54 @@
+<!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">
+
+<input type="checkbox" id="check1" />
+<input type="checkbox" id="check2" checked />
+
+<div tabindex="0" role="checkbox" id="check3">X</div>
+<div tabindex="0" role="checkbox" id="check4" aria-checked="true">X</div>
+
+<input type="checkbox" id="check5" aria-checked="false" />
+<input type="checkbox" id="check6" aria-checked="false" checked />
+<input type="checkbox" id="check7" aria-checked="true" />
+<input type="checkbox" id="check8" aria-checked="true" checked />
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that ARIA checkboxes correctly handle the aria-checked attribute.");
+
+ if (window.accessibilityController) {
+
+ var answers = [[ "check1", "false" ],
+ [ "check2", "true" ],
+ [ "check3", "false" ],
+ [ "check4", "true" ],
+ [ "check5", "false" ],
+ [ "check6", "true" ],
+ [ "check7", "false" ],
+ [ "check8", "true" ]];
+
+ for (var i = 0; i < answers.length; i++) {
+ var checkbox = document.getElementById(answers[i][0]);
+ checkbox.focus();
+ checkbox = accessibilityController.focusedElement;
+ shouldBe("checkbox.isChecked", answers[i][1]);
+ }
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 769fd6f..1dad3df 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32571
+
+ For an object with an aria role of "checkbox" or "radiobutton",
+ Use the "aria-checked" attribute to determine if it's checked.
+
+ Test: accessibility/aria-checkbox-checked.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isChecked):
+
2010-01-05 Yong Li <yoli at rim.com>
Reviewed by Adam Roben.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index d253b9d..efe56a5 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -363,11 +363,21 @@ bool AccessibilityRenderObject::isChecked() const
if (!m_renderer->node() || !m_renderer->node()->isElementNode())
return false;
+ // First test for native checkedness semantics
InputElement* inputElement = toInputElement(static_cast<Element*>(m_renderer->node()));
- if (!inputElement)
+ if (inputElement)
+ return inputElement->isChecked();
+
+ // Else, if this is an ARIA checkbox or radio, respect the aria-checked attribute
+ AccessibilityRole ariaRole = ariaRoleAttribute();
+ if (ariaRole == RadioButtonRole || ariaRole == CheckBoxRole) {
+ if (equalIgnoringCase(getAttribute(aria_checkedAttr), "true"))
+ return true;
return false;
+ }
- return inputElement->isChecked();
+ // Otherwise it's not checked
+ return false;
}
bool AccessibilityRenderObject::isHovered() const
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6c22b81..b9b7679 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,25 @@
+2010-01-05 Dominic Mazzoni <dmazzoni at google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32571
+
+ For an object with an aria role of "checkbox" or "radiobutton",
+ use the "aria-checked" attribute to determine if it's checked.
+ These changes add an isChecked() method to AccessibilityUIElement
+ so that we can check for this property from a layout test.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsCheckedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isChecked):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isChecked):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isChecked):
+
2010-01-05 David Levin <levin at chromium.org>
Reviewed by Darin Adler.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 6bdc734..dd6c5fc 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -497,6 +497,11 @@ static JSValueRef getIsExpandedCallback(JSContextRef context, JSObjectRef thisOb
return JSValueMakeBoolean(context, toAXElement(thisObject)->isExpanded());
}
+static JSValueRef getIsCheckedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->isChecked());
+}
+
static JSValueRef hierarchicalLevelCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeNumber(context, toAXElement(thisObject)->hierarchicalLevel());
@@ -583,6 +588,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "isRequired", getIsRequiredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isSelected", getIsSelectedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isExpanded", getIsExpandedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isChecked", getIsCheckedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "valueDescription", getValueDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "documentEncoding", getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 4bba135..7441ae7 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -104,7 +104,7 @@ public:
double y();
double width();
double height();
- double intValue();
+ double intValue() const;
double minValue();
double maxValue();
JSStringRef valueDescription();
@@ -114,6 +114,7 @@ public:
bool isRequired() const;
bool isSelected() const;
bool isExpanded() const;
+ bool isChecked() const;
int hierarchicalLevel() const;
double clickPointX();
double clickPointY();
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index 0380048..50c0d41 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -255,7 +255,7 @@ JSStringRef AccessibilityUIElement::orientation() const
return 0;
}
-double AccessibilityUIElement::intValue()
+double AccessibilityUIElement::intValue() const
{
GValue value = { 0, { { 0 } } };
@@ -365,6 +365,11 @@ bool AccessibilityUIElement::isExpanded() const
return false;
}
+bool AccessibilityUIElement::isChecked() const
+{
+ return intValue();
+}
+
JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 5b16991..192e157 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -469,7 +469,7 @@ double AccessibilityUIElement::clickPointY()
return static_cast<double>([positionValue pointValue].y);
}
-double AccessibilityUIElement::intValue()
+double AccessibilityUIElement::intValue() const
{
id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
if ([value isKindOfClass:[NSNumber class]])
@@ -547,6 +547,12 @@ bool AccessibilityUIElement::isExpanded() const
return false;
}
+bool AccessibilityUIElement::isChecked() const
+{
+ // On the Mac, intValue()==1 if a a checkable control is checked.
+ return intValue() == 1;
+}
+
int AccessibilityUIElement::hierarchicalLevel() const
{
id value = [m_element accessibilityAttributeValue:NSAccessibilityDisclosureLevelAttribute];
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 1668bbc..48270da 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -288,12 +288,21 @@ bool AccessibilityUIElement::isExpanded() const
return false;
}
+bool AccessibilityUIElement::isChecked() const
+{
+ VARIANT vState;
+ if (FAILED(m_element->get_accState(self(), &vState)))
+ return false;
+
+ return vState.lVal & STATE_SYSTEM_CHECKED;
+}
+
JSStringRef AccessibilityUIElement::orientation() const
{
return 0;
}
-double AccessibilityUIElement::intValue()
+double AccessibilityUIElement::intValue() const
{
BSTR valueBSTR;
if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list