Changeset 221918 in webkit
- Timestamp:
- Sep 12, 2017 9:31:41 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r221915 r221918 1 2017-09-12 Chris Fleizach <cfleizach@apple.com> 2 3 AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes 4 https://bugs.webkit.org/show_bug.cgi?id=170475 5 <rdar://problem/31439222> 6 7 Reviewed by Joanmarie Diggs. 8 9 * accessibility/title-tag-on-unimportant-elements-is-help-text-expected.txt: Added. 10 * accessibility/title-tag-on-unimportant-elements-is-help-text.html: Added. 11 1 12 2017-09-12 Ms2ger <Ms2ger@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r221917 r221918 1 2017-09-12 Chris Fleizach <cfleizach@apple.com> 2 3 AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes 4 https://bugs.webkit.org/show_bug.cgi?id=170475 5 <rdar://problem/31439222> 6 7 Reviewed by Joanmarie Diggs. 8 9 Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html 10 11 * accessibility/AccessibilityNodeObject.cpp: 12 (WebCore::AccessibilityNodeObject::helpText): 13 (WebCore::AccessibilityNodeObject::accessibilityDescription): 14 (WebCore::AccessibilityNodeObject::roleIgnoresTitle): 15 * accessibility/AccessibilityNodeObject.h: 16 1 17 2017-09-12 Brent Fulgham <bfulgham@apple.com> 2 18 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r219661 r221918 1453 1453 const AtomicString& title = getAttribute(titleAttr); 1454 1454 if (!title.isEmpty()) { 1455 if (!isMeter() )1455 if (!isMeter() && !roleIgnoresTitle()) 1456 1456 textOrder.append(AccessibilityText(title, TitleTagText)); 1457 1457 else … … 1558 1558 // If this point is reached (i.e. there's no accessibilityDescription) and there's no title(), we should fallback to using the title attribute. 1559 1559 // The title attribute is normally used as help text (because it is a tooltip), but if there is nothing else available, this should be used (according to ARIA). 1560 if (title().isEmpty()) 1560 // https://bugs.webkit.org/show_bug.cgi?id=170475: An exception is when the element is semantically unimportant. In those cases, title text should remain as help text. 1561 if (title().isEmpty() && !roleIgnoresTitle()) 1561 1562 return getAttribute(titleAttr); 1562 1563 1563 1564 return String(); 1565 } 1566 1567 // Returns whether the role was not intended to play a semantically meaningful part of the 1568 // accessibility hierarchy. This applies to generic groups like <div>'s with no role value set. 1569 bool AccessibilityNodeObject::roleIgnoresTitle() const 1570 { 1571 if (ariaRoleAttribute() != UnknownRole) 1572 return false; 1573 1574 switch (roleValue()) { 1575 case DivRole: 1576 case UnknownRole: 1577 return true; 1578 default: 1579 return false; 1580 } 1564 1581 } 1565 1582 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r219075 r221918 190 190 bool computeAccessibilityIsIgnored() const override; 191 191 bool usesAltTagForTextComputation() const; 192 192 bool roleIgnoresTitle() const; 193 193 194 Node* m_node; 194 195 };
Note: See TracChangeset
for help on using the changeset viewer.