Changeset 52809 in webkit


Ignore:
Timestamp:
Jan 5, 2010 11:00:29 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-05 Dominic Mazzoni <dmazzoni@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@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@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):
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52786 r52809  
     12010-01-05  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32571
     6
     7        Added a test to make sure that ARIA checkboxes correctly handle the aria-checked attribute.
     8
     9        * accessibility/aria-checkbox-checked-expected.txt: Added.
     10        * accessibility/aria-checkbox-checked.html: Added.
     11
    1122010-01-04  Chris Fleizach  <cfleizach@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r52801 r52809  
     12010-01-05  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32571
     6
     7        For an object with an aria role of "checkbox" or "radiobutton",
     8        Use the "aria-checked" attribute to determine if it's checked.
     9
     10        Test: accessibility/aria-checkbox-checked.html
     11
     12        * accessibility/AccessibilityRenderObject.cpp:
     13        (WebCore::AccessibilityRenderObject::isChecked):
     14
    1152010-01-05  Yong Li  <yoli@rim.com>
    216
  • trunk/WebCore/accessibility/AccessibilityRenderObject.cpp

    r52786 r52809  
    364364        return false;
    365365
     366    // First test for native checkedness semantics
    366367    InputElement* inputElement = toInputElement(static_cast<Element*>(m_renderer->node()));
    367     if (!inputElement)
    368         return false;
    369 
    370     return inputElement->isChecked();
     368    if (inputElement)
     369        return inputElement->isChecked();
     370
     371    // Else, if this is an ARIA checkbox or radio, respect the aria-checked attribute
     372    AccessibilityRole ariaRole = ariaRoleAttribute();
     373    if (ariaRole == RadioButtonRole || ariaRole == CheckBoxRole) {
     374        if (equalIgnoringCase(getAttribute(aria_checkedAttr), "true"))
     375            return true;
     376        return false;
     377    }
     378
     379    // Otherwise it's not checked
     380    return false;
    371381}
    372382
  • trunk/WebKitTools/ChangeLog

    r52808 r52809  
     12010-01-05  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32571
     6
     7        For an object with an aria role of "checkbox" or "radiobutton",
     8        use the "aria-checked" attribute to determine if it's checked.
     9        These changes add an isChecked() method to AccessibilityUIElement
     10        so that we can check for this property from a layout test.
     11
     12        * DumpRenderTree/AccessibilityUIElement.cpp:
     13        (getIsCheckedCallback):
     14        (AccessibilityUIElement::getJSClass):
     15        * DumpRenderTree/AccessibilityUIElement.h:
     16        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
     17        (AccessibilityUIElement::isChecked):
     18        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
     19        (AccessibilityUIElement::isChecked):
     20        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
     21        (AccessibilityUIElement::isChecked):
     22
    1232010-01-05  David Levin  <levin@chromium.org>
    224
  • trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp

    r52786 r52809  
    496496{
    497497    return JSValueMakeBoolean(context, toAXElement(thisObject)->isExpanded());
     498}
     499
     500static JSValueRef getIsCheckedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
     501{
     502    return JSValueMakeBoolean(context, toAXElement(thisObject)->isChecked());
    498503}
    499504
     
    584589        { "isSelected", getIsSelectedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    585590        { "isExpanded", getIsExpandedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     591        { "isChecked", getIsCheckedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    586592        { "valueDescription", getValueDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    587593        { "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.h

    r52786 r52809  
    105105    double width();
    106106    double height();
    107     double intValue();
     107    double intValue() const;
    108108    double minValue();
    109109    double maxValue();
     
    115115    bool isSelected() const;
    116116    bool isExpanded() const;
     117    bool isChecked() const;
    117118    int hierarchicalLevel() const;
    118119    double clickPointX();
  • trunk/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp

    r52786 r52809  
    256256}
    257257
    258 double AccessibilityUIElement::intValue()
     258double AccessibilityUIElement::intValue() const
    259259{
    260260    GValue value = { 0, { { 0 } } };
     
    366366}
    367367
     368bool AccessibilityUIElement::isChecked() const
     369{
     370    return intValue();
     371}
     372
    368373JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
    369374{
  • trunk/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm

    r52789 r52809  
    470470}
    471471
    472 double AccessibilityUIElement::intValue()
     472double AccessibilityUIElement::intValue() const
    473473{
    474474    id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
     
    546546        return [value boolValue];
    547547    return false;
     548}
     549
     550bool AccessibilityUIElement::isChecked() const
     551{
     552    // On the Mac, intValue()==1 if a a checkable control is checked.
     553    return intValue() == 1;
    548554}
    549555
  • trunk/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp

    r52786 r52809  
    289289}
    290290
     291bool AccessibilityUIElement::isChecked() const
     292{
     293    VARIANT vState;
     294    if (FAILED(m_element->get_accState(self(), &vState)))
     295        return false;
     296
     297    return vState.lVal & STATE_SYSTEM_CHECKED;
     298}
     299
    291300JSStringRef AccessibilityUIElement::orientation() const
    292301{
     
    294303}
    295304
    296 double AccessibilityUIElement::intValue()
     305double AccessibilityUIElement::intValue() const
    297306{
    298307    BSTR valueBSTR;
Note: See TracChangeset for help on using the changeset viewer.