Changeset 50054 in webkit


Ignore:
Timestamp:
Oct 26, 2009 4:42:42 AM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-26 Joanmarie Diggs <joanmarie.diggs@gmail.com>

Reviewed by Xan Lopez.

https://bugs.webkit.org/show_bug.cgi?id=25679
[Gtk] Improve accessibility of focusable lists

Fixes the issues with the Atk states exposed for ListBoxOption

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (setAtkStateSetFromCoreObject):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50053 r50054  
     12009-10-26  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25679
     6        [Gtk] Improve accessibility of focusable lists
     7
     8        Fixes the issues with the Atk states exposed for ListBoxOption
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (setAtkStateSetFromCoreObject):
     12
    1132009-10-26  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
    214
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r49958 r50054  
    371371static void setAtkStateSetFromCoreObject(AccessibilityObject* coreObject, AtkStateSet* stateSet)
    372372{
     373    AccessibilityObject* parent = coreObject->parentObject();
     374    bool isListBoxOption = parent && parent->isListBox();
     375
    373376    // Please keep the state list in alphabetical order
    374 
    375377    if (coreObject->isChecked())
    376378        atk_state_set_add_state(stateSet, ATK_STATE_CHECKED);
    377379
    378380    // FIXME: isReadOnly does not seem to do the right thing for
    379     // controls, so check explicitly for them
    380     if (!coreObject->isReadOnly() ||
    381         (coreObject->isControl() && coreObject->canSetValueAttribute()))
     381    // controls, so check explicitly for them. In addition, because
     382    // isReadOnly is false for listBoxOptions, we need to add one
     383    // more check so that we do not present them as being "editable".
     384    if ((!coreObject->isReadOnly() ||
     385        (coreObject->isControl() && coreObject->canSetValueAttribute())) &&
     386        !isListBoxOption)
    382387        atk_state_set_add_state(stateSet, ATK_STATE_EDITABLE);
    383388
     
    409414    // TODO: ATK_STATE_SELECTABLE_TEXT
    410415
    411     if (coreObject->isSelected())
     416    if (coreObject->canSetSelectedAttribute()) {
     417        atk_state_set_add_state(stateSet, ATK_STATE_SELECTABLE);
     418        // Items in focusable lists in Gtk have both STATE_SELECT{ABLE,ED}
     419        // and STATE_FOCUS{ABLE,ED}. We'll fake the latter based on the
     420        // former.
     421        if (isListBoxOption)
     422            atk_state_set_add_state(stateSet, ATK_STATE_FOCUSABLE);
     423    }
     424
     425    if (coreObject->isSelected()) {
    412426        atk_state_set_add_state(stateSet, ATK_STATE_SELECTED);
     427        // Items in focusable lists in Gtk have both STATE_SELECT{ABLE,ED}
     428        // and STATE_FOCUS{ABLE,ED}. We'll fake the latter based on the
     429        // former.
     430        if (isListBoxOption)
     431            atk_state_set_add_state(stateSet, ATK_STATE_FOCUSED);
     432    }
    413433
    414434    // FIXME: Group both SHOWING and VISIBLE here for now
Note: See TracChangeset for help on using the changeset viewer.