| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/geometry/FloatQuad.h" | 38 #include "platform/geometry/FloatQuad.h" |
| 39 #include "platform/geometry/LayoutRect.h" | 39 #include "platform/geometry/LayoutRect.h" |
| 40 #include "platform/graphics/Color.h" | 40 #include "platform/graphics/Color.h" |
| 41 #include "platform/wtf/Forward.h" | 41 #include "platform/wtf/Forward.h" |
| 42 #include "platform/wtf/Vector.h" | 42 #include "platform/wtf/Vector.h" |
| 43 | 43 |
| 44 class SkMatrix44; | 44 class SkMatrix44; |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class AccessibleNodeList; |
| 48 class AXObject; | 49 class AXObject; |
| 49 class AXObjectCacheImpl; | 50 class AXObjectCacheImpl; |
| 50 class Element; | 51 class Element; |
| 51 class IntPoint; | 52 class IntPoint; |
| 52 class LayoutObject; | 53 class LayoutObject; |
| 53 class LocalFrameView; | 54 class LocalFrameView; |
| 54 class Node; | 55 class Node; |
| 55 class ScrollableArea; | 56 class ScrollableArea; |
| 56 | 57 |
| 57 enum class AOMBooleanProperty; | 58 enum class AOMBooleanProperty; |
| 58 enum class AOMStringProperty; | 59 enum class AOMStringProperty; |
| 59 enum class AOMUIntProperty; | 60 enum class AOMUIntProperty; |
| 60 enum class AOMIntProperty; | 61 enum class AOMIntProperty; |
| 61 enum class AOMFloatProperty; | 62 enum class AOMFloatProperty; |
| 62 enum class AOMRelationProperty; | 63 enum class AOMRelationProperty; |
| 64 enum class AOMRelationListProperty; |
| 63 | 65 |
| 64 typedef unsigned AXID; | 66 typedef unsigned AXID; |
| 65 | 67 |
| 66 enum AccessibilityTextSource { | 68 enum AccessibilityTextSource { |
| 67 kAlternativeText, | 69 kAlternativeText, |
| 68 kChildrenText, | 70 kChildrenText, |
| 69 kSummaryText, | 71 kSummaryText, |
| 70 kHelpText, | 72 kHelpText, |
| 71 kVisibleText, | 73 kVisibleText, |
| 72 kTitleTagText, | 74 kTitleTagText, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 DCHECK(ax_object_cache_); | 349 DCHECK(ax_object_cache_); |
| 348 return *ax_object_cache_; | 350 return *ax_object_cache_; |
| 349 } | 351 } |
| 350 | 352 |
| 351 AXID AxObjectID() const { return id_; } | 353 AXID AxObjectID() const { return id_; } |
| 352 | 354 |
| 353 // Wrappers that retrieve either an Accessibility Object Model property, | 355 // Wrappers that retrieve either an Accessibility Object Model property, |
| 354 // or the equivalent ARIA attribute, in that order. | 356 // or the equivalent ARIA attribute, in that order. |
| 355 const AtomicString& GetAOMPropertyOrARIAAttribute(AOMStringProperty) const; | 357 const AtomicString& GetAOMPropertyOrARIAAttribute(AOMStringProperty) const; |
| 356 Element* GetAOMPropertyOrARIAAttribute(AOMRelationProperty) const; | 358 Element* GetAOMPropertyOrARIAAttribute(AOMRelationProperty) const; |
| 359 bool HasAOMProperty(AOMRelationListProperty, |
| 360 HeapVector<Member<Element>>& result) const; |
| 361 bool HasAOMPropertyOrARIAAttribute(AOMRelationListProperty, |
| 362 HeapVector<Member<Element>>& result) const; |
| 357 bool HasAOMPropertyOrARIAAttribute(AOMBooleanProperty, bool& result) const; | 363 bool HasAOMPropertyOrARIAAttribute(AOMBooleanProperty, bool& result) const; |
| 358 bool AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty) const; | 364 bool AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty) const; |
| 359 bool AOMPropertyOrARIAAttributeIsFalse(AOMBooleanProperty) const; | 365 bool AOMPropertyOrARIAAttributeIsFalse(AOMBooleanProperty) const; |
| 360 bool HasAOMPropertyOrARIAAttribute(AOMUIntProperty, uint32_t& result) const; | 366 bool HasAOMPropertyOrARIAAttribute(AOMUIntProperty, uint32_t& result) const; |
| 361 bool HasAOMPropertyOrARIAAttribute(AOMIntProperty, int32_t& result) const; | 367 bool HasAOMPropertyOrARIAAttribute(AOMIntProperty, int32_t& result) const; |
| 362 bool HasAOMPropertyOrARIAAttribute(AOMFloatProperty, float& result) const; | 368 bool HasAOMPropertyOrARIAAttribute(AOMFloatProperty, float& result) const; |
| 363 | 369 |
| 364 virtual void GetSparseAXAttributes(AXSparseAttributeClient&) const {} | 370 virtual void GetSparseAXAttributes(AXSparseAttributeClient&) const {} |
| 365 | 371 |
| 366 // Determine subclass type. | 372 // Determine subclass type. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 int LineForPosition(const VisiblePosition&) const; | 806 int LineForPosition(const VisiblePosition&) const; |
| 801 virtual int Index(const VisiblePosition&) const { return -1; } | 807 virtual int Index(const VisiblePosition&) const { return -1; } |
| 802 virtual void LineBreaks(Vector<int>&) const {} | 808 virtual void LineBreaks(Vector<int>&) const {} |
| 803 | 809 |
| 804 // Static helper functions. | 810 // Static helper functions. |
| 805 static bool IsARIAControl(AccessibilityRole); | 811 static bool IsARIAControl(AccessibilityRole); |
| 806 static bool IsARIAInput(AccessibilityRole); | 812 static bool IsARIAInput(AccessibilityRole); |
| 807 static AccessibilityRole AriaRoleToWebCoreRole(const String&); | 813 static AccessibilityRole AriaRoleToWebCoreRole(const String&); |
| 808 static const AtomicString& RoleName(AccessibilityRole); | 814 static const AtomicString& RoleName(AccessibilityRole); |
| 809 static const AtomicString& InternalRoleName(AccessibilityRole); | 815 static const AtomicString& InternalRoleName(AccessibilityRole); |
| 816 static void AccessibleNodeListToElementVector(const AccessibleNodeList&, |
| 817 HeapVector<Member<Element>>&); |
| 810 | 818 |
| 811 protected: | 819 protected: |
| 812 AXID id_; | 820 AXID id_; |
| 813 AXObjectVector children_; | 821 AXObjectVector children_; |
| 814 mutable bool have_children_; | 822 mutable bool have_children_; |
| 815 AccessibilityRole role_; | 823 AccessibilityRole role_; |
| 816 AXObjectInclusion last_known_is_ignored_value_; | 824 AXObjectInclusion last_known_is_ignored_value_; |
| 817 LayoutRect explicit_element_rect_; | 825 LayoutRect explicit_element_rect_; |
| 818 AXID explicit_container_id_; | 826 AXID explicit_container_id_; |
| 819 | 827 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 834 AXObjectSet& visited, | 842 AXObjectSet& visited, |
| 835 HeapVector<Member<Element>>& elements, | 843 HeapVector<Member<Element>>& elements, |
| 836 AXRelatedObjectVector* related_objects) const; | 844 AXRelatedObjectVector* related_objects) const; |
| 837 void TokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; | 845 void TokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; |
| 838 void ElementsFromAttribute(HeapVector<Member<Element>>& elements, | 846 void ElementsFromAttribute(HeapVector<Member<Element>>& elements, |
| 839 const QualifiedName&) const; | 847 const QualifiedName&) const; |
| 840 void AriaLabelledbyElementVector(HeapVector<Member<Element>>& elements) const; | 848 void AriaLabelledbyElementVector(HeapVector<Member<Element>>& elements) const; |
| 841 String TextFromAriaLabelledby(AXObjectSet& visited, | 849 String TextFromAriaLabelledby(AXObjectSet& visited, |
| 842 AXRelatedObjectVector* related_objects) const; | 850 AXRelatedObjectVector* related_objects) const; |
| 843 String TextFromAriaDescribedby(AXRelatedObjectVector* related_objects) const; | 851 String TextFromAriaDescribedby(AXRelatedObjectVector* related_objects) const; |
| 844 | |
| 845 virtual const AXObject* InheritsPresentationalRoleFrom() const { return 0; } | 852 virtual const AXObject* InheritsPresentationalRoleFrom() const { return 0; } |
| 846 | 853 |
| 847 bool CanReceiveAccessibilityFocus() const; | 854 bool CanReceiveAccessibilityFocus() const; |
| 848 bool NameFromContents(bool recursive) const; | 855 bool NameFromContents(bool recursive) const; |
| 849 | 856 |
| 850 AccessibilityRole ButtonRoleType() const; | 857 AccessibilityRole ButtonRoleType() const; |
| 851 | 858 |
| 852 virtual LayoutObject* LayoutObjectForRelativeBounds() const { | 859 virtual LayoutObject* LayoutObjectForRelativeBounds() const { |
| 853 return nullptr; | 860 return nullptr; |
| 854 } | 861 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 static unsigned number_of_live_ax_objects_; | 894 static unsigned number_of_live_ax_objects_; |
| 888 }; | 895 }; |
| 889 | 896 |
| 890 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 897 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 891 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ | 898 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ |
| 892 object.predicate) | 899 object.predicate) |
| 893 | 900 |
| 894 } // namespace blink | 901 } // namespace blink |
| 895 | 902 |
| 896 #endif // AXObject_h | 903 #endif // AXObject_h |
| OLD | NEW |