Changeset 126369 in webkit


Ignore:
Timestamp:
Aug 22, 2012 5:36:06 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: [Gtk] Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
https://bugs.webkit.org/show_bug.cgi?id=73819

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

Added a new role, Toggle Button, based on whether aria-pressed is present.
http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed

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

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::determineAccessibilityRole): using buttonRoleType
to classify a button-related role.
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute): using buttonRoleType
to classify a button-related role.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::ariaPressedIsPresent): checks if aria-pressed
attribute is present.
(WebCore::AccessibilityObject::buttonRoleType): returns a specific button-related
role if the object is a button-related role.

  • accessibility/AccessibilityObject.h:

(AccessibilityObject): added new role ToggleButtonRole.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::determineAccessibilityRole): using buttonRoleType
to classify a button-related role.

  • accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:

(atkRole): added a mapping between ToggleButtonRole and
ATK_ROLE_TOGGLE_BUTTON.

  • accessibility/mac/WebAccessibilityObjectWrapper.mm:

(createAccessibilityRoleMap): added a mapping between
ToggleButtonRole and NSAccessibilityButtonRole

Source/WebKit/chromium: Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
https://bugs.webkit.org/show_bug.cgi?id=73819

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

Added a new role, Toggle Button, based on whether aria-pressed is present.
http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed

  • public/WebAccessibilityRole.h: added WebAccessibilityRoleToggleButton that

matchs with WebCore ToggleButtonRole

  • src/AssertMatchingEnums.cpp: added the assert matching rule for

WebAccessibilityRoleToggleButton and ToggleButtonRole

Tools: Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
https://bugs.webkit.org/show_bug.cgi?id=73819

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

Added a new role, Toggle Button, based on whether aria-pressed is present.
http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed

  • DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:

(roleToString): added "ToggleButton" string for WebAccessibilityRoleToggleButton

LayoutTests: [Gtk] Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
https://bugs.webkit.org/show_bug.cgi?id=73819

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

Added a test to verify that when aria-pressed is present, buttons
will have the appropiate role.

  • platform/gtk/accessibility/aria-toggle-button-role-expected.txt: Added.
  • platform/gtk/accessibility/aria-toggle-button-role.html: Added.
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126367 r126369  
     12012-08-22  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        [Gtk] Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
     4        https://bugs.webkit.org/show_bug.cgi?id=73819
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added a test to verify that when aria-pressed is present, buttons
     9        will have the appropiate role.
     10
     11        * platform/gtk/accessibility/aria-toggle-button-role-expected.txt: Added.
     12        * platform/gtk/accessibility/aria-toggle-button-role.html: Added.
     13
    1142012-08-22  Kenneth Russell  <kbr@google.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r126366 r126369  
     12012-08-22  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        [Gtk] Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
     4        https://bugs.webkit.org/show_bug.cgi?id=73819
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added a new role, Toggle Button, based on whether aria-pressed is present.
     9        http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed
     10
     11        Test: platform/gtk/accessibility/aria-toggle-button-role.html
     12
     13        * accessibility/AccessibilityNodeObject.cpp:
     14        (WebCore::AccessibilityNodeObject::determineAccessibilityRole): using buttonRoleType
     15        to classify a button-related role.
     16        (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute): using buttonRoleType
     17        to classify a button-related role.
     18        * accessibility/AccessibilityObject.cpp:
     19        (WebCore::AccessibilityObject::ariaPressedIsPresent): checks if aria-pressed
     20        attribute is present.
     21        (WebCore::AccessibilityObject::buttonRoleType): returns a specific button-related
     22        role if the object is a button-related role.
     23        * accessibility/AccessibilityObject.h:
     24        (AccessibilityObject): added new role ToggleButtonRole.
     25        * accessibility/AccessibilityRenderObject.cpp:
     26        (WebCore::AccessibilityRenderObject::determineAccessibilityRole): using buttonRoleType
     27        to classify a button-related role.
     28        * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
     29        (atkRole): added a mapping between ToggleButtonRole and
     30        ATK_ROLE_TOGGLE_BUTTON.
     31        * accessibility/mac/WebAccessibilityObjectWrapper.mm:
     32        (createAccessibilityRoleMap): added a mapping between
     33        ToggleButtonRole and NSAccessibilityButtonRole
     34
    1352012-08-22  David Grogan  <dgrogan@chromium.org>
    236
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r123428 r126369  
    251251        return StaticTextRole;
    252252    if (node()->hasTagName(buttonTag))
    253         return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
     253        return buttonRoleType();
    254254    if (node()->hasTagName(inputTag)) {
    255255        HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     
    259259            return RadioButtonRole;
    260260        if (input->isTextButton())
    261             return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
     261            return buttonRoleType();
    262262        return TextFieldRole;
    263263    }
     
    337337    if (role == PresentationalRole && canSetFocusAttribute())
    338338        return UnknownRole;
    339    
    340     if (role == ButtonRole && ariaHasPopup())
    341         role = PopUpButtonRole;
     339
     340    if (role == ButtonRole)
     341        role = buttonRoleType();
    342342
    343343    if (role == TextAreaRole && !ariaIsMultiline())
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r125710 r126369  
    17351735    }
    17361736}
    1737    
     1737
     1738bool AccessibilityObject::ariaPressedIsPresent() const
     1739{
     1740    return !getAttribute(aria_pressedAttr).isEmpty();
     1741}
     1742
     1743AccessibilityRole AccessibilityObject::buttonRoleType() const
     1744{
     1745    // If aria-pressed is present, then it should be exposed as a toggle button.
     1746    // http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed
     1747    if (ariaPressedIsPresent())
     1748        return ToggleButtonRole;
     1749    if (ariaHasPopup())
     1750        return PopUpButtonRole;
     1751    // We don't contemplate RadioButtonRole, as it depends on the input
     1752    // type.
     1753
     1754    return ButtonRole;
     1755}
     1756
    17381757} // namespace WebCore
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r125710 r126369  
    188188    TreeItemRole,
    189189    TextFieldRole,
     190    ToggleButtonRole,
    190191    ToolbarRole,
    191192    UnknownRole,
     
    452453    virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { }
    453454    virtual bool ariaHasPopup() const { return false; }
     455    virtual bool ariaPressedIsPresent() const;
    454456    bool ariaIsMultiline() const;
    455457    virtual const AtomicString& invalidStatus() const;
     
    716718    static bool isAccessibilityTextSearchMatch(AccessibilityObject*, AccessibilitySearchCriteria*);
    717719    static bool objectMatchesSearchCriteriaWithResultLimit(AccessibilityObject*, AccessibilitySearchCriteria*, AccessibilityChildrenVector&);
     720    virtual AccessibilityRole buttonRoleType() const;
    718721   
    719722#if PLATFORM(GTK)
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r125710 r126369  
    16891689    return elementAttributeValue(aria_haspopupAttr);
    16901690}
    1691    
     1691
    16921692bool AccessibilityRenderObject::supportsARIAFlowTo() const
    16931693{
     
    31443144        return ListMarkerRole;
    31453145    if (node && node->hasTagName(buttonTag))
    3146         return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
     3146        return buttonRoleType();
    31473147    if (m_renderer->isText())
    31483148        return StaticTextRole;
     
    31713171            return RadioButtonRole;
    31723172        if (input->isTextButton())
    3173             return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
     3173            return buttonRoleType();
    31743174    }
    31753175
  • trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp

    r126243 r126369  
    431431    case ButtonRole:
    432432        return ATK_ROLE_PUSH_BUTTON;
     433    case ToggleButtonRole:
     434        return ATK_ROLE_TOGGLE_BUTTON;
    433435    case RadioButtonRole:
    434436        return ATK_ROLE_RADIO_BUTTON;
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm

    r126359 r126369  
    15781578        { FormRole, NSAccessibilityGroupRole },
    15791579        { SpinButtonRole, NSAccessibilityIncrementorRole },
    1580         { FooterRole, NSAccessibilityGroupRole }
     1580        { FooterRole, NSAccessibilityGroupRole },
     1581        { ToggleButtonRole, NSAccessibilityButtonRole }
    15811582    };
    15821583    AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
  • trunk/Source/WebKit/chromium/ChangeLog

    r126365 r126369  
     12012-08-22  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
     4        https://bugs.webkit.org/show_bug.cgi?id=73819
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added a new role, Toggle Button, based on whether aria-pressed is present.
     9        http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed
     10
     11        * public/WebAccessibilityRole.h: added WebAccessibilityRoleToggleButton that
     12        matchs with WebCore ToggleButtonRole
     13        * src/AssertMatchingEnums.cpp: added the assert matching rule for
     14        WebAccessibilityRoleToggleButton and ToggleButtonRole
     15
    1162012-08-17  Jeffrey Pfau  <jpfau@apple.com>
    217
  • trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h

    r110828 r126369  
    134134    WebAccessibilityRoleTreeItemRole,
    135135    WebAccessibilityRoleTextField,
     136    WebAccessibilityRoleToggleButton,
    136137    WebAccessibilityRoleToolbar,
    137138    WebAccessibilityRoleUnknown,
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r125225 r126369  
    258258COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentRegion, DocumentRegionRole);
    259259COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUserInterfaceTooltip, UserInterfaceTooltipRole);
     260COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleToggleButton, ToggleButtonRole);
    260261
    261262COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::Uncached, ApplicationCacheHost::UNCACHED);
  • trunk/Tools/ChangeLog

    r126368 r126369  
     12012-08-22  Alejandro Piñeiro  <apinheiro@igalia.com>
     2
     3        Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON
     4        https://bugs.webkit.org/show_bug.cgi?id=73819
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added a new role, Toggle Button, based on whether aria-pressed is present.
     9        http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed
     10
     11        * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
     12        (roleToString): added "ToggleButton" string for WebAccessibilityRoleToggleButton
     13
    1142012-08-23  Victor Carbune  <victor@rosedu.org>
    215
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp

    r124581 r126369  
    205205    case WebAccessibilityRoleUserInterfaceTooltip:
    206206        return result.append("UserInterfaceTooltip");
     207    case WebAccessibilityRoleToggleButton:
     208        return result.append("ToggleButton");
    207209    default:
    208210        // Also matches WebAccessibilityRoleUnknown.
Note: See TracChangeset for help on using the changeset viewer.