Changeset 128748 in webkit


Ignore:
Timestamp:
Sep 17, 2012 5:52:19 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

AX: Regression (r126369) - toggle buttons no longer return accessible titles
https://bugs.webkit.org/show_bug.cgi?id=94858

Patch by Alejandro Piñeiro <apinheiro@igalia.com> on 2012-09-17
Reviewed by Chris Fleizach.

Source/WebCore:

After the addition of the ToggleButtonRole some logic broke because some parts
of the code were assuming/waiting for a ButtonRole

Test: platform/gtk/accessibility/aria-toggle-button-with-title.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::isImageButton): using
isButton instead of a ButtonRole comparison
(WebCore::AccessibilityNodeObject::isPressed): using isButton
instead of a ButtonRole comparison
(WebCore::AccessibilityNodeObject::actionElement):
ToggleButtonRole also contemplated in order to call or not toElement
(WebCore::AccessibilityNodeObject::title): ToggleButtonRole also
contemplated in order to call or not textUnderElement

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::actionVerb): buttonAction also
assigned to ToggleButtonRole
(WebCore::AccessibilityObject::isButton): isButton now returns
that an object is a button if it is a ButtonRole, a
PopUpButtonRole or a ToggleButtonRole

  • accessibility/AccessibilityObject.h:

(AccessibilityObject): isButton is now implemented on the .c file

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::actionVerb): ToggleButtonRole
also returns a buttonAction

LayoutTests:

Added a test to verify that a toggle button exposes the title.

  • accessibility/aria-toggle-button-with-title.html: Added.
  • platform/chromium/accessibility/aria-toggle-button-with-title-expected.txt: Added.
  • platform/gtk/accessibility/aria-toggle-button-with-title-expected.txt: Added.
  • platform/mac/accessibility/aria-toggle-button-with-title-expected.txt: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128747 r128748  
     12012-09-17  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        AX: Regression (r126369) - toggle buttons no longer return accessible titles
     4        https://bugs.webkit.org/show_bug.cgi?id=94858
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added a test to verify that a toggle button exposes the title.
     9
     10        * accessibility/aria-toggle-button-with-title.html: Added.
     11        * platform/chromium/accessibility/aria-toggle-button-with-title-expected.txt: Added.
     12        * platform/gtk/accessibility/aria-toggle-button-with-title-expected.txt: Added.
     13        * platform/mac/accessibility/aria-toggle-button-with-title-expected.txt: Added.
     14
    1152012-09-17  Christophe Dumez  <christophe.dumez@intel.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r128746 r128748  
     12012-09-17  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        AX: Regression (r126369) - toggle buttons no longer return accessible titles
     4        https://bugs.webkit.org/show_bug.cgi?id=94858
     5
     6        Reviewed by Chris Fleizach.
     7
     8        After the addition of the ToggleButtonRole some logic broke because some parts
     9        of the code were assuming/waiting for a ButtonRole
     10
     11        Test: platform/gtk/accessibility/aria-toggle-button-with-title.html
     12
     13        * accessibility/AccessibilityNodeObject.cpp:
     14        (WebCore::AccessibilityNodeObject::isImageButton): using
     15        isButton instead of a ButtonRole comparison
     16        (WebCore::AccessibilityNodeObject::isPressed): using isButton
     17        instead of a ButtonRole comparison
     18        (WebCore::AccessibilityNodeObject::actionElement):
     19        ToggleButtonRole also contemplated in order to call or not toElement
     20        (WebCore::AccessibilityNodeObject::title): ToggleButtonRole also
     21        contemplated in order to call or not textUnderElement
     22        * accessibility/AccessibilityObject.cpp:
     23        (WebCore::AccessibilityObject::actionVerb): buttonAction also
     24        assigned to ToggleButtonRole
     25        (WebCore::AccessibilityObject::isButton): isButton now returns
     26        that an object is a button if it is a ButtonRole, a
     27        PopUpButtonRole or a ToggleButtonRole
     28        * accessibility/AccessibilityObject.h:
     29        (AccessibilityObject): isButton is now implemented on the .c file
     30        * accessibility/AccessibilityRenderObject.cpp:
     31        (WebCore::AccessibilityRenderObject::actionVerb): ToggleButtonRole
     32        also returns a buttonAction
     33
    1342012-09-14  Alexander Pavlov  <apavlov@chromium.org>
    235
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r128368 r128748  
    373373bool AccessibilityNodeObject::isImageButton() const
    374374{
    375     return isNativeImage() && roleValue() == ButtonRole;
     375    return isNativeImage() && isButton();
    376376}
    377377
     
    566566bool AccessibilityNodeObject::isPressed() const
    567567{
    568     if (roleValue() != ButtonRole)
     568    if (!isButton())
    569569        return false;
    570570
     
    876876    case ButtonRole:
    877877    case PopUpButtonRole:
     878    case ToggleButtonRole:
    878879    case TabRole:
    879880    case MenuItemRole:
     
    12131214    case PopUpButtonRole:
    12141215    case ButtonRole:
     1216    case ToggleButtonRole:
    12151217    case CheckBoxRole:
    12161218    case ListBoxOptionRole:
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r127936 r128748  
    12551255    switch (roleValue()) {
    12561256    case ButtonRole:
     1257    case ToggleButtonRole:
    12571258        return buttonAction;
    12581259    case TextFieldRole:
     
    17901791}
    17911792
     1793bool AccessibilityObject::isButton() const
     1794{
     1795    AccessibilityRole role = roleValue();
     1796
     1797    return role == ButtonRole || role == PopUpButtonRole || role == ToggleButtonRole;
     1798}
     1799
    17921800} // namespace WebCore
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r128140 r128748  
    381381    bool isTreeItem() const { return roleValue() == TreeItemRole; }
    382382    bool isScrollbar() const { return roleValue() == ScrollBarRole; }
    383     bool isButton() const { return roleValue() == ButtonRole; }
     383    bool isButton() const;
    384384    bool isListItem() const { return roleValue() == ListItemRole; }
    385385    bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); }
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r128405 r128748  
    29082908    switch (roleValue()) {
    29092909    case ButtonRole:
     2910    case ToggleButtonRole:
    29102911        return buttonAction;
    29112912    case TextFieldRole:
Note: See TracChangeset for help on using the changeset viewer.