| 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 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 const AXObject* ariaHiddenRoot() const; | 641 const AXObject* ariaHiddenRoot() const; |
| 642 bool computeIsInertOrAriaHidden(IgnoredReasons* = nullptr) const; | 642 bool computeIsInertOrAriaHidden(IgnoredReasons* = nullptr) const; |
| 643 bool isDescendantOfLeafNode() const; | 643 bool isDescendantOfLeafNode() const; |
| 644 AXObject* leafNodeAncestor() const; | 644 AXObject* leafNodeAncestor() const; |
| 645 bool isDescendantOfDisabledNode() const; | 645 bool isDescendantOfDisabledNode() const; |
| 646 const AXObject* disabledAncestor() const; | 646 const AXObject* disabledAncestor() const; |
| 647 bool lastKnownIsIgnoredValue(); | 647 bool lastKnownIsIgnoredValue(); |
| 648 void setLastKnownIsIgnoredValue(bool); | 648 void setLastKnownIsIgnoredValue(bool); |
| 649 bool hasInheritedPresentationalRole() const; | 649 bool hasInheritedPresentationalRole() const; |
| 650 bool isPresentationalChild() const; | 650 bool isPresentationalChild() const; |
| 651 bool ancestorExposesActiveDescendant() const; |
| 652 bool computeAncestorExposesActiveDescendant() const; |
| 651 | 653 |
| 652 // | 654 // |
| 653 // Accessible name calculation | 655 // Accessible name calculation |
| 654 // | 656 // |
| 655 | 657 |
| 656 // Retrieves the accessible name of the object, an enum indicating where the
name | 658 // Retrieves the accessible name of the object, an enum indicating where the
name |
| 657 // was derived from, and a list of objects that were used to derive the name
, if any. | 659 // was derived from, and a list of objects that were used to derive the name
, if any. |
| 658 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const; | 660 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const; |
| 659 | 661 |
| 660 typedef HeapVector<NameSource> NameSources; | 662 typedef HeapVector<NameSource> NameSources; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 virtual InvalidState getInvalidState() const { return InvalidStateUndefined;
} | 737 virtual InvalidState getInvalidState() const { return InvalidStateUndefined;
} |
| 736 // Only used when invalidState() returns InvalidStateOther. | 738 // Only used when invalidState() returns InvalidStateOther. |
| 737 virtual String ariaInvalidValue() const { return String(); } | 739 virtual String ariaInvalidValue() const { return String(); } |
| 738 virtual String valueDescription() const { return String(); } | 740 virtual String valueDescription() const { return String(); } |
| 739 virtual float valueForRange() const { return 0.0f; } | 741 virtual float valueForRange() const { return 0.0f; } |
| 740 virtual float maxValueForRange() const { return 0.0f; } | 742 virtual float maxValueForRange() const { return 0.0f; } |
| 741 virtual float minValueForRange() const { return 0.0f; } | 743 virtual float minValueForRange() const { return 0.0f; } |
| 742 virtual String stringValue() const { return String(); } | 744 virtual String stringValue() const { return String(); } |
| 743 | 745 |
| 744 // ARIA attributes. | 746 // ARIA attributes. |
| 745 virtual AXObject* activeDescendant() const { return 0; } | 747 virtual AXObject* activeDescendant() const { return nullptr; } |
| 746 virtual String ariaAutoComplete() const { return String(); } | 748 virtual String ariaAutoComplete() const { return String(); } |
| 747 virtual String ariaDescribedByAttribute() const { return String(); } | 749 virtual String ariaDescribedByAttribute() const { return String(); } |
| 748 virtual void ariaFlowToElements(AXObjectVector&) const { } | 750 virtual void ariaFlowToElements(AXObjectVector&) const { } |
| 749 virtual void ariaControlsElements(AXObjectVector&) const { } | 751 virtual void ariaControlsElements(AXObjectVector&) const { } |
| 750 virtual void ariaOwnsElements(AXObjectVector& owns) const { } | 752 virtual void ariaOwnsElements(AXObjectVector& owns) const { } |
| 751 virtual void ariaDescribedbyElements(AXObjectVector&) const { } | 753 virtual void ariaDescribedbyElements(AXObjectVector&) const { } |
| 752 virtual void ariaLabelledbyElements(AXObjectVector&) const { } | 754 virtual void ariaLabelledbyElements(AXObjectVector&) const { } |
| 753 virtual bool ariaHasPopup() const { return false; } | 755 virtual bool ariaHasPopup() const { return false; } |
| 754 virtual bool isEditable() const { return false; } | 756 virtual bool isEditable() const { return false; } |
| 755 bool isMultiline() const; | 757 bool isMultiline() const; |
| 756 virtual bool isRichlyEditable() const { return false; } | 758 virtual bool isRichlyEditable() const { return false; } |
| 757 virtual String ariaLabelledbyAttribute() const { return String(); } | 759 virtual String ariaLabelledbyAttribute() const { return String(); } |
| 758 bool ariaPressedIsPresent() const; | 760 bool ariaPressedIsPresent() const; |
| 759 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } | 761 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } |
| 760 virtual bool ariaRoleHasPresentationalChildren() const { return false; } | 762 virtual bool ariaRoleHasPresentationalChildren() const { return false; } |
| 761 virtual AXObject* ancestorForWhichThisIsAPresentationalChild() const { retur
n 0; } | 763 virtual AXObject* ancestorForWhichThisIsAPresentationalChild() const { retur
n 0; } |
| 762 virtual bool shouldFocusActiveDescendant() const { return false; } | 764 bool supportsActiveDescendant() const; |
| 763 bool supportsARIAAttributes() const; | 765 bool supportsARIAAttributes() const; |
| 764 virtual bool supportsARIADragging() const { return false; } | 766 virtual bool supportsARIADragging() const { return false; } |
| 765 virtual bool supportsARIADropping() const { return false; } | 767 virtual bool supportsARIADropping() const { return false; } |
| 766 virtual bool supportsARIAFlowTo() const { return false; } | 768 virtual bool supportsARIAFlowTo() const { return false; } |
| 767 virtual bool supportsARIAOwns() const { return false; } | 769 virtual bool supportsARIAOwns() const { return false; } |
| 768 bool supportsRangeValue() const; | 770 bool supportsRangeValue() const; |
| 769 virtual SortDirection getSortDirection() const { return SortDirectionUndefin
ed; } | 771 virtual SortDirection getSortDirection() const { return SortDirectionUndefin
ed; } |
| 770 | 772 |
| 771 // Returns 0-based index. | 773 // Returns 0-based index. |
| 772 int indexInParent() const; | 774 int indexInParent() const; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 | 932 |
| 931 // The following cached attribute values (the ones starting with m_cached*) | 933 // The following cached attribute values (the ones starting with m_cached*) |
| 932 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). | 934 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). |
| 933 mutable int m_lastModificationCount; | 935 mutable int m_lastModificationCount; |
| 934 mutable bool m_cachedIsIgnored : 1; | 936 mutable bool m_cachedIsIgnored : 1; |
| 935 mutable bool m_cachedIsInertOrAriaHidden : 1; | 937 mutable bool m_cachedIsInertOrAriaHidden : 1; |
| 936 mutable bool m_cachedIsDescendantOfLeafNode : 1; | 938 mutable bool m_cachedIsDescendantOfLeafNode : 1; |
| 937 mutable bool m_cachedIsDescendantOfDisabledNode : 1; | 939 mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
| 938 mutable bool m_cachedHasInheritedPresentationalRole : 1; | 940 mutable bool m_cachedHasInheritedPresentationalRole : 1; |
| 939 mutable bool m_cachedIsPresentationalChild : 1; | 941 mutable bool m_cachedIsPresentationalChild : 1; |
| 942 mutable bool m_cachedAncestorExposesActiveDescendant : 1; |
| 940 mutable Member<const AXObject> m_cachedLiveRegionRoot; | 943 mutable Member<const AXObject> m_cachedLiveRegionRoot; |
| 941 | 944 |
| 942 Member<AXObjectCacheImpl> m_axObjectCache; | 945 Member<AXObjectCacheImpl> m_axObjectCache; |
| 943 | 946 |
| 944 // Updates the cached attribute values. This may be recursive, so to prevent
deadlocks, | 947 // Updates the cached attribute values. This may be recursive, so to prevent
deadlocks, |
| 945 // functions called here may only search up the tree (ancestors), not down. | 948 // functions called here may only search up the tree (ancestors), not down. |
| 946 void updateCachedAttributeValuesIfNeeded() const; | 949 void updateCachedAttributeValuesIfNeeded() const; |
| 947 | 950 |
| 948 private: | 951 private: |
| 949 static bool includesARIAWidgetRole(const String&); | 952 static bool includesARIAWidgetRole(const String&); |
| 950 static bool hasInteractiveARIAAttribute(const Element&); | 953 static bool hasInteractiveARIAAttribute(const Element&); |
| 951 | 954 |
| 952 static unsigned s_numberOfLiveAXObjects; | 955 static unsigned s_numberOfLiveAXObjects; |
| 953 }; | 956 }; |
| 954 | 957 |
| 955 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 958 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 956 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) | 959 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) |
| 957 | 960 |
| 958 } // namespace blink | 961 } // namespace blink |
| 959 | 962 |
| 960 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::IgnoredReason); | 963 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::IgnoredReason); |
| 961 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::NameSource); | 964 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::NameSource); |
| 962 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::DescriptionSource); | 965 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::DescriptionSource); |
| 963 | 966 |
| 964 #endif // AXObject_h | 967 #endif // AXObject_h |
| OLD | NEW |