Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 return !getAttribute(aria_pressedAttr).isEmpty(); | 700 return !getAttribute(aria_pressedAttr).isEmpty(); |
| 701 } | 701 } |
| 702 | 702 |
| 703 bool AXObject::supportsARIAAttributes() const | 703 bool AXObject::supportsARIAAttributes() const |
| 704 { | 704 { |
| 705 return isLiveRegion() | 705 return isLiveRegion() |
| 706 || supportsARIADragging() | 706 || supportsARIADragging() |
| 707 || supportsARIADropping() | 707 || supportsARIADropping() |
| 708 || supportsARIAFlowTo() | 708 || supportsARIAFlowTo() |
| 709 || supportsARIAOwns() | 709 || supportsARIAOwns() |
| 710 || hasAttribute(aria_labelAttr); | 710 || hasAttribute(aria_atomicAttr) |
|
dmazzoni
2015/04/09 06:21:41
Calling hasAttribute so many times in a row couldn
| |
| 711 || hasAttribute(aria_busyAttr) | |
| 712 || hasAttribute(aria_controlsAttr) | |
| 713 || hasAttribute(aria_describedbyAttr) | |
| 714 || hasAttribute(aria_disabledAttr) | |
| 715 || hasAttribute(aria_haspopupAttr) | |
| 716 || hasAttribute(aria_invalidAttr) | |
| 717 || hasAttribute(aria_labelAttr) | |
| 718 || hasAttribute(aria_labelledbyAttr) | |
| 719 || hasAttribute(aria_relevantAttr); | |
| 711 } | 720 } |
| 712 | 721 |
| 713 bool AXObject::supportsRangeValue() const | 722 bool AXObject::supportsRangeValue() const |
| 714 { | 723 { |
| 715 return isProgressIndicator() | 724 return isProgressIndicator() |
| 716 || isMeter() | 725 || isMeter() |
| 717 || isSlider() | 726 || isSlider() |
| 718 || isScrollbar() | 727 || isScrollbar() |
| 719 || isSpinButton(); | 728 || isSpinButton(); |
| 720 } | 729 } |
| 721 | 730 |
| 722 void AXObject::ariaTreeRows(AccessibilityChildrenVector& result) | 731 void AXObject::ariaTreeRows(AccessibilityChildrenVector& result) |
| 723 { | 732 { |
| 724 for (const auto& child : children()) { | 733 for (const auto& child : children()) { |
| 725 // Add tree items as the rows. | 734 // Add tree items as the rows. |
| 726 if (child->roleValue() == TreeItemRole) | 735 if (child->roleValue() == TreeItemRole) |
| 727 result.append(child); | 736 result.append(child); |
| 728 | 737 |
| 729 // Now see if this item also has rows hiding inside of it. | 738 // Now see if this item also has rows hiding inside of it. |
| 730 child->ariaTreeRows(result); | 739 child->ariaTreeRows(result); |
| 731 } | 740 } |
| 732 } | 741 } |
| 733 | 742 |
| 743 int AXObject::ariaPosInSet() const | |
| 744 { | |
| 745 return getAttribute(aria_posinsetAttr).toInt(); | |
| 746 } | |
| 747 | |
| 748 int AXObject::ariaSetSize() const | |
| 749 { | |
| 750 return getAttribute(aria_setsizeAttr).toInt(); | |
| 751 } | |
| 752 | |
| 734 bool AXObject::isLiveRegion() const | 753 bool AXObject::isLiveRegion() const |
| 735 { | 754 { |
| 736 const AtomicString& liveRegion = liveRegionStatus(); | 755 const AtomicString& liveRegion = liveRegionStatus(); |
| 737 return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegi on, "assertive"); | 756 return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegi on, "assertive"); |
| 738 } | 757 } |
| 739 | 758 |
| 740 const AXObject* AXObject::liveRegionRoot() const | 759 const AXObject* AXObject::liveRegionRoot() const |
| 741 { | 760 { |
| 742 updateCachedAttributeValuesIfNeeded(); | 761 updateCachedAttributeValuesIfNeeded(); |
| 743 return m_cachedLiveRegionRoot; | 762 return m_cachedLiveRegionRoot; |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1300 } | 1319 } |
| 1301 | 1320 |
| 1302 const AtomicString& AXObject::internalRoleName(AccessibilityRole role) | 1321 const AtomicString& AXObject::internalRoleName(AccessibilityRole role) |
| 1303 { | 1322 { |
| 1304 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector(); | 1323 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector(); |
| 1305 | 1324 |
| 1306 return internalRoleNameVector->at(role); | 1325 return internalRoleNameVector->at(role); |
| 1307 } | 1326 } |
| 1308 | 1327 |
| 1309 } // namespace blink | 1328 } // namespace blink |
| OLD | NEW |