Changeset 155601 in webkit
- Timestamp:
- Sep 12, 2013 2:51:25 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r155599 r155601 1 2013-09-12 Samuel White <samuel_white@apple.com> 2 3 AX: Self-referencing aria-labelledby only uses contents. 4 https://bugs.webkit.org/show_bug.cgi?id=120814 5 6 Reviewed by Mario Sanchez Prada. 7 8 Test to verify that self-referencing aria-labelledby behavior works as expected. 9 10 * accessibility/self-referencing-aria-labelledby-expected.txt: Added. 11 * accessibility/self-referencing-aria-labelledby.html: Added. 12 1 13 2013-09-12 Denis Nomiyama <d.nomiyama@samsung.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r155600 r155601 1 2013-09-12 Samuel White <samuel_white@apple.com> 2 3 AX: Self-referencing aria-labelledby only uses contents. 4 https://bugs.webkit.org/show_bug.cgi?id=120814 5 6 Reviewed by Mario Sanchez Prada. 7 8 Implemented additional 'Text Alternative Computation' steps documented at: 9 http://www.w3.org/WAI/PF/aria/complete#textalternativecomputation. This allows us to remove 10 our raw text node iteration that was previously forcing us to do our computation incorrectly. 11 Element content is now sourced using textUnderElement (step 2C of the computation). 12 13 Test: accessibility/self-referencing-aria-labelledby.html 14 15 * accessibility/AccessibilityNodeObject.cpp: 16 (WebCore::accessibleNameForNode): 17 (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements): 18 1 19 2013-09-12 Commit Queue <commit-queue@webkit.org> 2 20 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r155543 r155601 1753 1753 static String accessibleNameForNode(Node* node) 1754 1754 { 1755 if (node->isTextNode()) 1756 return toText(node)->data(); 1757 1755 if (!node->isHTMLElement()) 1756 return String(); 1757 1758 HTMLElement* element = toHTMLElement(node); 1759 1760 const AtomicString& ariaLabel = element->fastGetAttribute(aria_labelAttr); 1761 if (!ariaLabel.isEmpty()) 1762 return ariaLabel; 1763 1764 const AtomicString& alt = element->fastGetAttribute(altAttr); 1765 if (!alt.isEmpty()) 1766 return alt; 1767 1758 1768 if (isHTMLInputElement(node)) 1759 1769 return toHTMLInputElement(node)->value(); 1760 1761 if (node->isHTMLElement()) { 1762 const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr); 1763 if (!alt.isEmpty()) 1764 return alt; 1765 } 1766 1770 1771 String text = node->document().axObjectCache()->getOrCreate(node)->textUnderElement(); 1772 if (!text.isEmpty()) 1773 return text; 1774 1775 const AtomicString& title = element->fastGetAttribute(titleAttr); 1776 if (!title.isEmpty()) 1777 return title; 1778 1767 1779 return String(); 1768 1780 } … … 1773 1785 unsigned size = elements.size(); 1774 1786 for (unsigned i = 0; i < size; ++i) { 1775 Element* idElement = elements[i]; 1776 1777 builder.append(accessibleNameForNode(idElement)); 1778 for (Node* n = idElement->firstChild(); n; n = NodeTraversal::next(n, idElement)) 1779 builder.append(accessibleNameForNode(n)); 1780 1781 if (i != size - 1) 1787 if (i) 1782 1788 builder.append(' '); 1789 1790 builder.append(accessibleNameForNode(elements[i])); 1783 1791 } 1784 1792 return builder.toString();
Note: See TracChangeset
for help on using the changeset viewer.