Changeset 82459 in webkit


Ignore:
Timestamp:
Mar 30, 2011 9:51:08 AM (13 years ago)
Author:
mario@webkit.org
Message:

2011-03-30 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Chris Fleizach.

AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
https://bugs.webkit.org/show_bug.cgi?id=47636

Added new layout test to check that roles are correct in GTK.

  • platform/gtk/accessibility/aria-roles-unignored-expected.txt: Added.
  • platform/gtk/accessibility/aria-roles-unignored.html: Added.

2011-03-30 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Chris Fleizach.

AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
https://bugs.webkit.org/show_bug.cgi?id=47636

Define new roles in WebCore and map them to ATK accordingly.

Test: platform/gtk/accessibility/aria-roles-unignored.html

  • accessibility/AccessibilityObject.h: Added new roles to represent paragraphs, labels, forms and div sections.
  • accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Return ParagraphRole, LabelRole, FormRole and DivRole when needed for the GTK platform only.
  • accessibility/gtk/AccessibilityObjectAtk.cpp: (WebCore::AccessibilityObject::allowsTextRanges): Consider the new roles now that those kind of nodes won't return true to isGroup().
  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (atkRole): Map new WebCore roles to ATK Roles. (webkit_accessible_get_role): Remove code to define roles for paragraphs, labels, forms and divs based on node's tag name.

Update mappings for the Mac platform.

  • accessibility/mac/AccessibilityObjectWrapper.mm: (createAccessibilityRoleMap): Add explicit mappings from the new roles introduced to NSAccessibilityGroupRole.

2011-03-30 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Chris Fleizach.

AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
https://bugs.webkit.org/show_bug.cgi?id=47636

Duplicate new internal WebCore roles in the Chromium port.

  • public/WebAccessibilityRole.h: Update enumeration WebAccessibilityRole to reflect newly added roles in WebCore.
  • src/AssertMatchingEnums.cpp: Added new assertions.
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r82457 r82459  
     12011-03-30  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
     6        https://bugs.webkit.org/show_bug.cgi?id=47636
     7
     8        Added new layout test to check that roles are correct in GTK.
     9
     10        * platform/gtk/accessibility/aria-roles-unignored-expected.txt: Added.
     11        * platform/gtk/accessibility/aria-roles-unignored.html: Added.
     12
    1132011-03-30  Jessie Berlin  <jberlin@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r82456 r82459  
     12011-03-30  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
     6        https://bugs.webkit.org/show_bug.cgi?id=47636
     7
     8        Define new roles in WebCore and map them to ATK accordingly.
     9
     10        Test: platform/gtk/accessibility/aria-roles-unignored.html
     11
     12        * accessibility/AccessibilityObject.h: Added new roles to
     13        represent paragraphs, labels, forms and div sections.
     14        * accessibility/AccessibilityRenderObject.cpp:
     15        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
     16        Return ParagraphRole, LabelRole, FormRole and DivRole when needed
     17        for the GTK platform only.
     18        * accessibility/gtk/AccessibilityObjectAtk.cpp:
     19        (WebCore::AccessibilityObject::allowsTextRanges): Consider the new
     20        roles now that those kind of nodes won't return true to isGroup().
     21        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     22        (atkRole): Map new WebCore roles to ATK Roles.
     23        (webkit_accessible_get_role): Remove code to define roles for
     24        paragraphs, labels, forms and divs based on node's tag name.
     25
     26        Update mappings for the Mac platform.
     27
     28        * accessibility/mac/AccessibilityObjectWrapper.mm:
     29        (createAccessibilityRoleMap): Add explicit mappings from the new
     30        roles introduced to NSAccessibilityGroupRole.
     31
    1322011-03-30  Yury Semikhatsky  <yurys@chromium.org>
    233
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r82307 r82459  
    172172    MenuListPopupRole,
    173173    MenuListOptionRole,
     174    ParagraphRole,
     175    LabelRole,
     176    DivRole,
     177    FormRole,
    174178
    175179    // ARIA Grouping roles
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r82307 r82459  
    30883088    if (m_renderer->isHR())
    30893089        return SplitterRole;
     3090
     3091    if (node && node->hasTagName(pTag))
     3092        return ParagraphRole;
     3093
     3094    if (node && node->hasTagName(labelTag))
     3095        return LabelRole;
     3096
     3097    if (node && node->hasTagName(divTag))
     3098        return DivRole;
     3099
     3100    if (node && node->hasTagName(formTag))
     3101        return FormRole;
     3102#else
     3103    if (node && node->hasTagName(labelTag))
     3104        return GroupRole;
    30903105#endif
    30913106
    3092     if (m_renderer->isBlockFlow() || (node && node->hasTagName(labelTag)))
     3107    if (m_renderer->isBlockFlow())
    30933108        return GroupRole;
    30943109   
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp

    r82296 r82459  
    9999bool AccessibilityObject::allowsTextRanges() const
    100100{
    101     return isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem();
     101    // Check type for the AccessibilityObject.
     102    if (isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem())
     103        return true;
     104
     105    // Check roles as the last fallback mechanism.
     106    AccessibilityRole role = roleValue();
     107    return role == ParagraphRole || role == LabelRole || role == DivRole || role == FormRole;
    102108}
    103109
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r82307 r82459  
    477477    case ListBoxOptionRole:
    478478        return ATK_ROLE_LIST_ITEM;
     479    case ParagraphRole:
     480        return ATK_ROLE_PARAGRAPH;
     481    case LabelRole:
     482        return ATK_ROLE_LABEL;
     483    case DivRole:
     484        return ATK_ROLE_SECTION;
     485    case FormRole:
     486        return ATK_ROLE_FORM;
    479487    default:
    480488        return ATK_ROLE_UNKNOWN;
     
    484492static AtkRole webkit_accessible_get_role(AtkObject* object)
    485493{
    486     AccessibilityObject* axObject = core(object);
    487 
    488     if (!axObject)
     494    AccessibilityObject* coreObject = core(object);
     495
     496    if (!coreObject)
    489497        return ATK_ROLE_UNKNOWN;
    490498
    491     // WebCore does not know about paragraph role, label role, or section role
    492     if (axObject->isAccessibilityRenderObject()) {
    493         Node* node = static_cast<AccessibilityRenderObject*>(axObject)->renderer()->node();
    494         if (node) {
    495             if (node->hasTagName(HTMLNames::pTag))
    496                 return ATK_ROLE_PARAGRAPH;
    497             if (node->hasTagName(HTMLNames::labelTag))
    498                 return ATK_ROLE_LABEL;
    499             if (node->hasTagName(HTMLNames::divTag))
    500                 return ATK_ROLE_SECTION;
    501             if (node->hasTagName(HTMLNames::formTag))
    502                 return ATK_ROLE_FORM;
    503         }
    504     }
    505 
    506499    // Note: Why doesn't WebCore have a password field for this
    507     if (axObject->isPasswordField())
     500    if (coreObject->isPasswordField())
    508501        return ATK_ROLE_PASSWORD_TEXT;
    509502
    510     return atkRole(axObject->roleValue());
     503    return atkRole(coreObject->roleValue());
    511504}
    512505
  • trunk/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm

    r82307 r82459  
    12881288        { TreeRole, NSAccessibilityOutlineRole },
    12891289        { TreeItemRole, NSAccessibilityRowRole },
    1290         { ListItemRole, NSAccessibilityGroupRole }
     1290        { ListItemRole, NSAccessibilityGroupRole },
     1291        { ParagraphRole, NSAccessibilityGroupRole },
     1292        { LabelRole, NSAccessibilityGroupRole },
     1293        { DivRole, NSAccessibilityGroupRole },
     1294        { FormRole, NSAccessibilityGroupRole }
    12911295    };
    12921296    AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
  • trunk/Source/WebKit/chromium/ChangeLog

    r82449 r82459  
     12011-03-30  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>
     6        https://bugs.webkit.org/show_bug.cgi?id=47636
     7
     8        Duplicate new internal WebCore roles in the Chromium port.
     9
     10        * public/WebAccessibilityRole.h: Update enumeration
     11        WebAccessibilityRole to reflect newly added roles in WebCore.
     12        * src/AssertMatchingEnums.cpp: Added new assertions.
     13
    1142011-03-30  Yury Semikhatsky  <yurys@chromium.org>
    215
  • trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h

    r82307 r82459  
    117117    WebAccessibilityRoleMenuListOption,
    118118
     119    WebAccessibilityRoleParagraph,
     120    WebAccessibilityRoleLabel,
     121    WebAccessibilityRoleDiv,
     122    WebAccessibilityRoleForm,
     123
    119124    WebAccessibilityRoleLandmarkApplication,
    120125    WebAccessibilityRoleLandmarkBanner,
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r82307 r82459  
    174174COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleEditableText, EditableTextRole);
    175175COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListItem, ListItemRole);
     176COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleParagraph, ParagraphRole);
     177COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLabel, LabelRole);
     178COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDiv, DivRole);
     179COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleForm, FormRole);
    176180COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkApplication, LandmarkApplicationRole);
    177181COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkBanner, LandmarkBannerRole);
Note: See TracChangeset for help on using the changeset viewer.