Changeset 167054 in webkit


Ignore:
Timestamp:
Apr 9, 2014 5:18:49 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

AX: Bug in AccessibilityNodeObject::helpText
https://bugs.webkit.org/show_bug.cgi?id=130386

Patch by James Craig <jcraig@apple.com> on 2014-04-09
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/help-text.html

Ancestor loop was always checking attribute of original node rather than current node.

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::helpText):

LayoutTests:

Tests accessibility help text in a variety of examples.

  • accessibility/help-text-expected.txt: Added.
  • accessibility/help-text.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167053 r167054  
     12014-04-09  James Craig  <jcraig@apple.com>
     2
     3        AX: Bug in AccessibilityNodeObject::helpText
     4        https://bugs.webkit.org/show_bug.cgi?id=130386
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Tests accessibility help text in a variety of examples.
     9
     10        * accessibility/help-text-expected.txt: Added.
     11        * accessibility/help-text.html: Added.
     12
    1132014-04-09  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r167052 r167054  
     12014-04-09  James Craig  <jcraig@apple.com>
     2
     3        AX: Bug in AccessibilityNodeObject::helpText
     4        https://bugs.webkit.org/show_bug.cgi?id=130386
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/help-text.html
     9
     10        Ancestor loop was always checking attribute of original node rather than current node.
     11
     12        * accessibility/AccessibilityNodeObject.cpp:
     13        (WebCore::AccessibilityNodeObject::helpText):
     14
    1152014-04-09  Chris Fleizach  <cfleizach@apple.com>
    216
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r166921 r167054  
    14021402    if (!describedBy.isEmpty())
    14031403        textOrder.append(AccessibilityText(describedBy, SummaryText));
    1404    
    1405     // Add help type text that is derived from ancestors.
    1406     for (Node* curr = node(); curr; curr = curr->parentNode()) {
    1407         const AtomicString& summary = getAttribute(summaryAttr);
    1408         if (!summary.isEmpty())
    1409             textOrder.append(AccessibilityText(summary, SummaryText));
    1410        
    1411         // The title attribute should be used as help text unless it is already being used as descriptive text.
    1412         const AtomicString& title = getAttribute(titleAttr);
    1413         if (!title.isEmpty())
    1414             textOrder.append(AccessibilityText(title, TitleTagText));
    1415        
    1416         // Only take help text from an ancestor element if its a group or an unknown role. If help was
    1417         // added to those kinds of elements, it is likely it was meant for a child element.
    1418         AccessibilityObject* axObj = axObjectCache()->getOrCreate(curr);
    1419         if (!axObj)
    1420             return;
    1421        
    1422         AccessibilityRole role = axObj->roleValue();
    1423         if (role != GroupRole && role != UnknownRole)
    1424             break;
    1425     }
     1404
     1405    // Summary attribute used as help text on tables.
     1406    const AtomicString& summary = getAttribute(summaryAttr);
     1407    if (!summary.isEmpty())
     1408        textOrder.append(AccessibilityText(summary, SummaryText));
     1409
     1410    // The title attribute should be used as help text unless it is already being used as descriptive text.
     1411    const AtomicString& title = getAttribute(titleAttr);
     1412    if (!title.isEmpty())
     1413        textOrder.append(AccessibilityText(title, TitleTagText));
    14261414}
    14271415
Note: See TracChangeset for help on using the changeset viewer.