Changeset 126941 in webkit


Ignore:
Timestamp:
Aug 28, 2012 4:47:10 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
https://bugs.webkit.org/show_bug.cgi?id=95185

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-08-28
Reviewed by Chris Fleizach.

Tools:

  • DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:

(AccessibilityUIElement::titleUIElement): Implemented
Gets the ATK_RELATION_LABELLED_BY target.
(AccessibilityUIElement::stringValue): Implemented for all roles but ATK_ROLE_PANEL.
Gets the string from atk_text_get_text(). Will implement for ATK_ROLE_PANEL after
bug 95180 is fixed.

LayoutTests:

Updated layout test expected results. In all three cases below:
1) Remove objects from the tree representation which did not belong,
but were included as a side effect of AccessibilityUIElement::stringValue()
not having been implemented.
2) Add the stringValue() return value to the tree representation.
Note that the implementation of AccessibilityUIElement::titleUIElement()
will be tested by the existing legend.html layout text. See bug 84137.

  • platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Updated.
  • platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
  • platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt: Updated.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126934 r126941  
     12012-08-28  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
     4        https://bugs.webkit.org/show_bug.cgi?id=95185
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Updated layout test expected results. In all three cases below:
     9        1) Remove objects from the tree representation which did not belong,
     10        but were included as a side effect of AccessibilityUIElement::stringValue()
     11        not having been implemented.
     12        2) Add the stringValue() return value to the tree representation.
     13        Note that the implementation of AccessibilityUIElement::titleUIElement()
     14        will be tested by the existing legend.html layout text. See bug 84137.
     15
     16        * platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Updated.
     17        * platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
     18        * platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt: Updated.
     19
    1202012-08-28  Julien Chaffraix  <jchaffraix@webkit.org>
    221
  • trunk/LayoutTests/platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt

    r95008 r126941  
    99
    1010AXRole: document frame
    11     AXRole: section
    12     AXRole: section
    13     AXRole: paragraph
    14     AXRole: paragraph
     11    AXRole: section AXValue: y
     12    AXRole: section AXValue: End of test
    1513PASS successfullyParsed is true
    1614
  • trunk/LayoutTests/platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt

    r96922 r126941  
    1414AXRole: scroll pane
    1515    AXRole: document frame
    16         AXRole: paragraph
     16        AXRole: paragraph AXValue: Before
    1717        AXRole: panel
    1818            AXRole: scroll pane
     
    2020                    AXRole: panel
    2121                        AXRole: push button
    22         AXRole: paragraph
    23         AXRole: paragraph
    24         AXRole: paragraph
    25         AXRole: paragraph
    26         AXRole: section
     22        AXRole: paragraph AXValue: After
     23        AXRole: paragraph AXValue: End of test
    2724
    2825After:
    2926AXRole: scroll pane
    3027    AXRole: document frame
    31         AXRole: paragraph
     28        AXRole: paragraph AXValue: Before
    3229        AXRole: panel
    33         AXRole: paragraph
    34         AXRole: paragraph
    35         AXRole: paragraph
    36         AXRole: paragraph
    37         AXRole: section
     30        AXRole: paragraph AXValue: After
     31        AXRole: paragraph AXValue: End of test
    3832
    3933PASS frameBodyRole == frameBody.role is false
  • trunk/LayoutTests/platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt

    r95008 r126941  
    22Before:
    33AXRole: document frame
    4     AXRole: link
    5     AXRole: section
    6     AXRole: panel
    7     AXRole: paragraph
    8     AXRole: paragraph
     4    AXRole: link AXValue:
     5    AXRole: section AXValue: End of test
    96After:
    107AXRole: document frame
    11     AXRole: section
    12     AXRole: panel
    13     AXRole: paragraph
    14     AXRole: paragraph
     8    AXRole: section AXValue: End of test
    159This can cause a crash.
    1610
  • trunk/Tools/ChangeLog

    r126932 r126941  
     12012-08-28  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
     4        https://bugs.webkit.org/show_bug.cgi?id=95185
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
     9        (AccessibilityUIElement::titleUIElement): Implemented
     10        Gets the ATK_RELATION_LABELLED_BY target.
     11        (AccessibilityUIElement::stringValue): Implemented for all roles but ATK_ROLE_PANEL.
     12        Gets the string from atk_text_get_text(). Will implement for ATK_ROLE_PANEL after
     13        bug 95180 is fixed.
     14
    1152012-08-28  Dominic Mazzoni  <dmazzoni@google.com>
    216
  • trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp

    r126309 r126941  
    177177AccessibilityUIElement AccessibilityUIElement::titleUIElement()
    178178{
    179     // FIXME: implement
    180     return 0;
    181 }
    182 
    183 AccessibilityUIElement AccessibilityUIElement::parentElement()
    184 {
     179
    185180    if (!m_element)
    186181        return 0;
    187182
     183    AtkRelationSet* set = atk_object_ref_relation_set(ATK_OBJECT(m_element));
     184    if (!set)
     185        return 0;
     186
     187    AtkObject* target = 0;
     188    int count = atk_relation_set_get_n_relations(set);
     189    for (int i = 0; i < count; i++) {
     190        AtkRelation* relation = atk_relation_set_get_relation(set, i);
     191        if (atk_relation_get_relation_type(relation) == ATK_RELATION_LABELLED_BY) {
     192            GPtrArray* targetList = atk_relation_get_target(relation);
     193            if (targetList->len)
     194                target = static_cast<AtkObject*>(g_ptr_array_index(targetList, 0));
     195        }
     196        g_object_unref(set);
     197    }
     198
     199    return target ? AccessibilityUIElement(target) : 0;
     200}
     201
     202AccessibilityUIElement AccessibilityUIElement::parentElement()
     203{
     204    if (!m_element)
     205        return 0;
     206
    188207    ASSERT(ATK_IS_OBJECT(m_element));
    189208
     
    253272JSStringRef AccessibilityUIElement::stringValue()
    254273{
    255     // FIXME: implement
    256     return JSStringCreateWithCharacters(0, 0);
     274    if (!m_element || !ATK_IS_TEXT(m_element))
     275        return JSStringCreateWithCharacters(0, 0);
     276
     277    // FIXME: implement properly for ATK_ROLE_PANEL. Prior to doing so, we need
     278    // to fix bug 95180 as well as determine which panels we wish to keep in the
     279    // accessible hierarchy. See, for instance, bug 72811.
     280    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
     281    if (role == ATK_ROLE_PANEL)
     282        return JSStringCreateWithCharacters(0, 0);
     283
     284    gchar* text =text = atk_text_get_text(ATK_TEXT(m_element), 0, -1);
     285    GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", text));
     286    g_free(text);
     287
     288    return JSStringCreateWithUTF8CString(axValue.get());
    257289}
    258290
Note: See TracChangeset for help on using the changeset viewer.