Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObject.h

Issue 1841333002: Various fixes for aria-activedescendant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed latest comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 const AXObject* ariaHiddenRoot() const; 639 const AXObject* ariaHiddenRoot() const;
640 bool computeIsInertOrAriaHidden(IgnoredReasons* = nullptr) const; 640 bool computeIsInertOrAriaHidden(IgnoredReasons* = nullptr) const;
641 bool isDescendantOfLeafNode() const; 641 bool isDescendantOfLeafNode() const;
642 AXObject* leafNodeAncestor() const; 642 AXObject* leafNodeAncestor() const;
643 bool isDescendantOfDisabledNode() const; 643 bool isDescendantOfDisabledNode() const;
644 const AXObject* disabledAncestor() const; 644 const AXObject* disabledAncestor() const;
645 bool lastKnownIsIgnoredValue(); 645 bool lastKnownIsIgnoredValue();
646 void setLastKnownIsIgnoredValue(bool); 646 void setLastKnownIsIgnoredValue(bool);
647 bool hasInheritedPresentationalRole() const; 647 bool hasInheritedPresentationalRole() const;
648 bool isPresentationalChild() const; 648 bool isPresentationalChild() const;
649 bool ancestorExposesActiveDescendant() const;
650 bool computeAncestorExposesActiveDescendant() const;
649 651
650 // 652 //
651 // Accessible name calculation 653 // Accessible name calculation
652 // 654 //
653 655
654 // Retrieves the accessible name of the object, an enum indicating where the name 656 // Retrieves the accessible name of the object, an enum indicating where the name
655 // was derived from, and a list of objects that were used to derive the name , if any. 657 // was derived from, and a list of objects that were used to derive the name , if any.
656 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const; 658 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const;
657 659
658 typedef HeapVector<NameSource> NameSources; 660 typedef HeapVector<NameSource> NameSources;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 virtual InvalidState getInvalidState() const { return InvalidStateUndefined; } 735 virtual InvalidState getInvalidState() const { return InvalidStateUndefined; }
734 // Only used when invalidState() returns InvalidStateOther. 736 // Only used when invalidState() returns InvalidStateOther.
735 virtual String ariaInvalidValue() const { return String(); } 737 virtual String ariaInvalidValue() const { return String(); }
736 virtual String valueDescription() const { return String(); } 738 virtual String valueDescription() const { return String(); }
737 virtual float valueForRange() const { return 0.0f; } 739 virtual float valueForRange() const { return 0.0f; }
738 virtual float maxValueForRange() const { return 0.0f; } 740 virtual float maxValueForRange() const { return 0.0f; }
739 virtual float minValueForRange() const { return 0.0f; } 741 virtual float minValueForRange() const { return 0.0f; }
740 virtual String stringValue() const { return String(); } 742 virtual String stringValue() const { return String(); }
741 743
742 // ARIA attributes. 744 // ARIA attributes.
743 virtual AXObject* activeDescendant() const { return 0; } 745 virtual AXObject* activeDescendant() const { return nullptr; }
744 virtual String ariaAutoComplete() const { return String(); } 746 virtual String ariaAutoComplete() const { return String(); }
745 virtual String ariaDescribedByAttribute() const { return String(); } 747 virtual String ariaDescribedByAttribute() const { return String(); }
746 virtual void ariaFlowToElements(AXObjectVector&) const { } 748 virtual void ariaFlowToElements(AXObjectVector&) const { }
747 virtual void ariaControlsElements(AXObjectVector&) const { } 749 virtual void ariaControlsElements(AXObjectVector&) const { }
748 virtual void ariaOwnsElements(AXObjectVector& owns) const { } 750 virtual void ariaOwnsElements(AXObjectVector& owns) const { }
749 virtual void ariaDescribedbyElements(AXObjectVector&) const { } 751 virtual void ariaDescribedbyElements(AXObjectVector&) const { }
750 virtual void ariaLabelledbyElements(AXObjectVector&) const { } 752 virtual void ariaLabelledbyElements(AXObjectVector&) const { }
751 virtual bool ariaHasPopup() const { return false; } 753 virtual bool ariaHasPopup() const { return false; }
752 virtual bool isEditable() const { return false; } 754 virtual bool isEditable() const { return false; }
753 bool isMultiline() const; 755 bool isMultiline() const;
754 virtual bool isRichlyEditable() const { return false; } 756 virtual bool isRichlyEditable() const { return false; }
755 virtual String ariaLabelledbyAttribute() const { return String(); } 757 virtual String ariaLabelledbyAttribute() const { return String(); }
756 bool ariaPressedIsPresent() const; 758 bool ariaPressedIsPresent() const;
757 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } 759 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; }
758 virtual bool ariaRoleHasPresentationalChildren() const { return false; } 760 virtual bool ariaRoleHasPresentationalChildren() const { return false; }
759 virtual AXObject* ancestorForWhichThisIsAPresentationalChild() const { retur n 0; } 761 virtual AXObject* ancestorForWhichThisIsAPresentationalChild() const { retur n 0; }
760 virtual bool shouldFocusActiveDescendant() const { return false; } 762 bool supportsActiveDescendant() const;
761 bool supportsARIAAttributes() const; 763 bool supportsARIAAttributes() const;
762 virtual bool supportsARIADragging() const { return false; } 764 virtual bool supportsARIADragging() const { return false; }
763 virtual bool supportsARIADropping() const { return false; } 765 virtual bool supportsARIADropping() const { return false; }
764 virtual bool supportsARIAFlowTo() const { return false; } 766 virtual bool supportsARIAFlowTo() const { return false; }
765 virtual bool supportsARIAOwns() const { return false; } 767 virtual bool supportsARIAOwns() const { return false; }
766 bool supportsRangeValue() const; 768 bool supportsRangeValue() const;
767 virtual SortDirection getSortDirection() const { return SortDirectionUndefin ed; } 769 virtual SortDirection getSortDirection() const { return SortDirectionUndefin ed; }
768 770
769 // Returns 0-based index. 771 // Returns 0-based index.
770 int indexInParent() const; 772 int indexInParent() const;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 927
926 // The following cached attribute values (the ones starting with m_cached*) 928 // The following cached attribute values (the ones starting with m_cached*)
927 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount(). 929 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount().
928 mutable int m_lastModificationCount; 930 mutable int m_lastModificationCount;
929 mutable bool m_cachedIsIgnored : 1; 931 mutable bool m_cachedIsIgnored : 1;
930 mutable bool m_cachedIsInertOrAriaHidden : 1; 932 mutable bool m_cachedIsInertOrAriaHidden : 1;
931 mutable bool m_cachedIsDescendantOfLeafNode : 1; 933 mutable bool m_cachedIsDescendantOfLeafNode : 1;
932 mutable bool m_cachedIsDescendantOfDisabledNode : 1; 934 mutable bool m_cachedIsDescendantOfDisabledNode : 1;
933 mutable bool m_cachedHasInheritedPresentationalRole : 1; 935 mutable bool m_cachedHasInheritedPresentationalRole : 1;
934 mutable bool m_cachedIsPresentationalChild : 1; 936 mutable bool m_cachedIsPresentationalChild : 1;
937 mutable bool m_cachedAncestorExposesActiveDescendant : 1;
935 mutable Member<const AXObject> m_cachedLiveRegionRoot; 938 mutable Member<const AXObject> m_cachedLiveRegionRoot;
936 939
937 Member<AXObjectCacheImpl> m_axObjectCache; 940 Member<AXObjectCacheImpl> m_axObjectCache;
938 941
939 // Updates the cached attribute values. This may be recursive, so to prevent deadlocks, 942 // Updates the cached attribute values. This may be recursive, so to prevent deadlocks,
940 // functions called here may only search up the tree (ancestors), not down. 943 // functions called here may only search up the tree (ancestors), not down.
941 void updateCachedAttributeValuesIfNeeded() const; 944 void updateCachedAttributeValuesIfNeeded() const;
942 945
943 private: 946 private:
944 static bool includesARIAWidgetRole(const String&); 947 static bool includesARIAWidgetRole(const String&);
945 static bool hasInteractiveARIAAttribute(const Element&); 948 static bool hasInteractiveARIAAttribute(const Element&);
946 949
947 static unsigned s_numberOfLiveAXObjects; 950 static unsigned s_numberOfLiveAXObjects;
948 }; 951 };
949 952
950 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 953 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
951 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate) 954 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate)
952 955
953 } // namespace blink 956 } // namespace blink
954 957
955 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::IgnoredReason); 958 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::IgnoredReason);
956 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::NameSource); 959 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::NameSource);
957 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::DescriptionSource); 960 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::DescriptionSource);
958 961
959 #endif // AXObject_h 962 #endif // AXObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698