Changeset 52233 in webkit


Ignore:
Timestamp:
Dec 16, 2009 9:58:00 PM (14 years ago)
Author:
jhoneycutt@apple.com
Message:

2009-12-16 Jon Honeycutt <jhoneycutt@apple.com>

MSAA: Accessibility role of text nodes is wrong

https://bugs.webkit.org/show_bug.cgi?id=32631
<rdar://problem/7369084>

Reviewed by Alice Liu.

Test: platform/win/accessibility/text-role.html

WebCore/:

  • accessibility/AccessibilityObject.h: (WebCore::): Add a new role to the enum. (WebCore::AccessibilityObject::roleValueForMSAA): Declare a function to return the accessibility role for MSAA; the base implementation returns the old role value.
  • accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::AccessibilityRenderObject): Initialize m_roleForMSAA. (WebCore::AccessibilityRenderObject::roleValueForMSAA): If m_roleForMSAA has been set, return it. If the renderer is a RenderText, set the role to EditableTextRole to match IE and Firefox. Otherwise, set the role for MSAA to the old role value.
  • accessibility/AccessibilityRenderObject.h: Add a member to hold the role for MSAA, and declare an override of roleValueForMSAA().

WebKit/win/:

  • AccessibleBase.cpp: (MSAARole): If the role is WebCore::EditableTextRole, return ROLE_SYSTEM_TEXT. (AccessibleBase::role): Call roleValueForMSAA().

LayoutTests/:

  • platform/win/accessibility/text-role-expected.txt: Added.
  • platform/win/accessibility/text-role.html: Added. Check that the role of the text node that is the first child of the <a> tag has the "editable text" role.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52230 r52233  
     12009-12-16  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        MSAA: Accessibility role of text nodes is wrong
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32631
     6        <rdar://problem/7369084>
     7
     8        Reviewed by Alice Liu.
     9
     10        * platform/win/accessibility/text-role-expected.txt: Added.
     11        * platform/win/accessibility/text-role.html: Added.
     12        Check that the role of the text node that is the first child of the
     13        <a> tag has the "editable text" role.
     14
    1152009-12-16  Fumitoshi Ukai  <ukai@chromium.org>
    216
  • trunk/WebCore/ChangeLog

    r52229 r52233  
     12009-12-16  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        MSAA: Accessibility role of text nodes is wrong
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32631
     6        <rdar://problem/7369084>
     7
     8        Reviewed by Alice Liu.
     9
     10        Test: platform/win/accessibility/text-role.html
     11
     12        * accessibility/AccessibilityObject.h:
     13        (WebCore::):
     14        Add a new role to the enum.
     15        (WebCore::AccessibilityObject::roleValueForMSAA):
     16        Declare a function to return the accessibility role for MSAA; the base
     17        implementation returns the old role value.
     18
     19        * accessibility/AccessibilityRenderObject.cpp:
     20        (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
     21        Initialize m_roleForMSAA.
     22        (WebCore::AccessibilityRenderObject::roleValueForMSAA):
     23        If m_roleForMSAA has been set, return it. If the renderer is a
     24        RenderText, set the role to EditableTextRole to match IE and Firefox.
     25        Otherwise, set the role for MSAA to the old role value.
     26
     27        * accessibility/AccessibilityRenderObject.h:
     28        Add a member to hold the role for MSAA, and declare an override of
     29        roleValueForMSAA().
     30
    1312009-12-16  Eric Seidel  <eric@webkit.org>
    232
  • trunk/WebCore/accessibility/AccessibilityObject.h

    r52159 r52233  
    169169    TreeItemRole,
    170170    DirectoryRole,
     171    EditableTextRole,
    171172   
    172173    // ARIA Grouping roles
     
    490491    virtual String nameForMSAA() const { return String(); }
    491492    virtual String descriptionForMSAA() const { return String(); }
    492    
     493    virtual AccessibilityRole roleValueForMSAA() const { return m_role; }
     494
    493495    // Used by an ARIA tree to get all its rows.
    494496    void ariaTreeRows(AccessibilityChildrenVector&);
  • trunk/WebCore/accessibility/AccessibilityRenderObject.cpp

    r52159 r52233  
    8686    , m_ariaRole(UnknownRole)
    8787    , m_childrenDirty(false)
     88    , m_roleForMSAA(UnknownRole)
    8889{
    8990    updateAccessibilityRole();
     
    31143115}
    31153116
     3117AccessibilityRole AccessibilityRenderObject::roleValueForMSAA() const
     3118{
     3119    if (m_roleForMSAA != UnknownRole)
     3120        return m_roleForMSAA;
     3121
     3122    if (m_renderer && m_renderer->isText())
     3123        m_roleForMSAA = EditableTextRole;
     3124    else
     3125        m_roleForMSAA = m_role;
     3126
     3127    return m_roleForMSAA;
     3128}
     3129
    31163130} // namespace WebCore
  • trunk/WebCore/accessibility/AccessibilityRenderObject.h

    r52159 r52233  
    249249    virtual String nameForMSAA() const;
    250250    virtual String descriptionForMSAA() const;
     251    virtual AccessibilityRole roleValueForMSAA() const;
    251252
    252253protected:
     
    290291   
    291292    void markChildrenDirty() const { m_childrenDirty = true; }
     293
     294    mutable AccessibilityRole m_roleForMSAA;
    292295};
    293296   
  • trunk/WebKit/win/AccessibleBase.cpp

    r50354 r52233  
    544544        case WebCore::TextAreaRole:
    545545        case WebCore::ListMarkerRole:
     546        case WebCore::EditableTextRole:
    546547            return ROLE_SYSTEM_TEXT;
    547548        case WebCore::StaticTextRole:
     
    573574long AccessibleBase::role() const
    574575{
    575     return MSAARole(m_object->roleValue());
     576    return MSAARole(m_object->roleValueForMSAA());
    576577}
    577578
  • trunk/WebKit/win/ChangeLog

    r52121 r52233  
     12009-12-16  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        MSAA: Accessibility role of text nodes is wrong
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32631
     6        <rdar://problem/7369084>
     7
     8        Reviewed by Alice Liu.
     9
     10        * AccessibleBase.cpp:
     11        (MSAARole):
     12        If the role is WebCore::EditableTextRole, return ROLE_SYSTEM_TEXT.
     13        (AccessibleBase::role):
     14        Call roleValueForMSAA().
     15
    1162009-12-14  Brent Fulgham  <bfulgham@webkit.org>
    217
Note: See TracChangeset for help on using the changeset viewer.