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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 TextStyleUnderline = 1 << 2, | 319 TextStyleUnderline = 1 << 2, |
320 TextStyleLineThrough = 1 << 3 | 320 TextStyleLineThrough = 1 << 3 |
321 }; | 321 }; |
322 | 322 |
323 enum TextUnderElementMode { | 323 enum TextUnderElementMode { |
324 TextUnderElementAll, | 324 TextUnderElementAll, |
325 TextUnderElementAny // If the text is unimportant, just whether or not it's | 325 TextUnderElementAny // If the text is unimportant, just whether or not it's |
326 // present | 326 // present |
327 }; | 327 }; |
328 | 328 |
| 329 enum class AXBoolAttribute {}; |
| 330 |
| 331 enum class AXStringAttribute {}; |
| 332 |
| 333 enum class AXObjectAttribute { |
| 334 AriaActiveDescendant, |
| 335 }; |
| 336 |
| 337 enum class AXObjectVectorAttribute { |
| 338 AriaControls, |
| 339 AriaFlowTo, |
| 340 }; |
| 341 |
| 342 class AXSparseAttributeClient { |
| 343 public: |
| 344 virtual void addBoolAttribute(AXBoolAttribute, bool) = 0; |
| 345 virtual void addStringAttribute(AXStringAttribute, const String&) = 0; |
| 346 virtual void addObjectAttribute(AXObjectAttribute, AXObject&) = 0; |
| 347 virtual void addObjectVectorAttribute(AXObjectVectorAttribute, |
| 348 HeapVector<Member<AXObject>>&) = 0; |
| 349 }; |
| 350 |
329 // The source of the accessible name of an element. This is needed | 351 // The source of the accessible name of an element. This is needed |
330 // because on some platforms this determines how the accessible name | 352 // because on some platforms this determines how the accessible name |
331 // is exposed. | 353 // is exposed. |
332 enum AXNameFrom { | 354 enum AXNameFrom { |
333 AXNameFromUninitialized = -1, | 355 AXNameFromUninitialized = -1, |
334 AXNameFromAttribute = 0, | 356 AXNameFromAttribute = 0, |
335 AXNameFromCaption, | 357 AXNameFromCaption, |
336 AXNameFromContents, | 358 AXNameFromContents, |
337 AXNameFromPlaceholder, | 359 AXNameFromPlaceholder, |
338 AXNameFromRelatedElement, | 360 AXNameFromRelatedElement, |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 587 |
566 // The AXObjectCacheImpl that owns this object, and its unique ID within this | 588 // The AXObjectCacheImpl that owns this object, and its unique ID within this |
567 // cache. | 589 // cache. |
568 AXObjectCacheImpl& axObjectCache() const { | 590 AXObjectCacheImpl& axObjectCache() const { |
569 ASSERT(m_axObjectCache); | 591 ASSERT(m_axObjectCache); |
570 return *m_axObjectCache; | 592 return *m_axObjectCache; |
571 } | 593 } |
572 | 594 |
573 AXID axObjectID() const { return m_id; } | 595 AXID axObjectID() const { return m_id; } |
574 | 596 |
| 597 virtual void getSparseAXAttributes(AXSparseAttributeClient&) const {} |
| 598 |
575 // Determine subclass type. | 599 // Determine subclass type. |
576 virtual bool isAXNodeObject() const { return false; } | 600 virtual bool isAXNodeObject() const { return false; } |
577 virtual bool isAXLayoutObject() const { return false; } | 601 virtual bool isAXLayoutObject() const { return false; } |
578 virtual bool isAXListBox() const { return false; } | 602 virtual bool isAXListBox() const { return false; } |
579 virtual bool isAXListBoxOption() const { return false; } | 603 virtual bool isAXListBoxOption() const { return false; } |
580 virtual bool isAXRadioInput() const { return false; } | 604 virtual bool isAXRadioInput() const { return false; } |
581 virtual bool isAXSVGRoot() const { return false; } | 605 virtual bool isAXSVGRoot() const { return false; } |
582 | 606 |
583 // Check object role or purpose. | 607 // Check object role or purpose. |
584 virtual AccessibilityRole roleValue() const { return m_role; } | 608 virtual AccessibilityRole roleValue() const { return m_role; } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 virtual String ariaInvalidValue() const { return String(); } | 843 virtual String ariaInvalidValue() const { return String(); } |
820 virtual String valueDescription() const { return String(); } | 844 virtual String valueDescription() const { return String(); } |
821 virtual float valueForRange() const { return 0.0f; } | 845 virtual float valueForRange() const { return 0.0f; } |
822 virtual float maxValueForRange() const { return 0.0f; } | 846 virtual float maxValueForRange() const { return 0.0f; } |
823 virtual float minValueForRange() const { return 0.0f; } | 847 virtual float minValueForRange() const { return 0.0f; } |
824 virtual String stringValue() const { return String(); } | 848 virtual String stringValue() const { return String(); } |
825 | 849 |
826 // ARIA attributes. | 850 // ARIA attributes. |
827 virtual AXObject* activeDescendant() { return nullptr; } | 851 virtual AXObject* activeDescendant() { return nullptr; } |
828 virtual String ariaAutoComplete() const { return String(); } | 852 virtual String ariaAutoComplete() const { return String(); } |
829 virtual void ariaFlowToElements(AXObjectVector&) const {} | |
830 virtual void ariaControlsElements(AXObjectVector&) const {} | |
831 virtual void ariaOwnsElements(AXObjectVector& owns) const {} | 853 virtual void ariaOwnsElements(AXObjectVector& owns) const {} |
832 virtual void ariaDescribedbyElements(AXObjectVector&) const {} | 854 virtual void ariaDescribedbyElements(AXObjectVector&) const {} |
833 virtual void ariaLabelledbyElements(AXObjectVector&) const {} | 855 virtual void ariaLabelledbyElements(AXObjectVector&) const {} |
834 virtual bool ariaHasPopup() const { return false; } | 856 virtual bool ariaHasPopup() const { return false; } |
835 virtual bool isEditable() const { return false; } | 857 virtual bool isEditable() const { return false; } |
836 bool isMultiline() const; | 858 bool isMultiline() const; |
837 virtual bool isRichlyEditable() const { return false; } | 859 virtual bool isRichlyEditable() const { return false; } |
838 bool ariaPressedIsPresent() const; | 860 bool ariaPressedIsPresent() const; |
839 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } | 861 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } |
840 virtual bool ariaRoleHasPresentationalChildren() const { return false; } | 862 virtual bool ariaRoleHasPresentationalChildren() const { return false; } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 static unsigned s_numberOfLiveAXObjects; | 1100 static unsigned s_numberOfLiveAXObjects; |
1079 }; | 1101 }; |
1080 | 1102 |
1081 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1103 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
1082 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ | 1104 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ |
1083 object.predicate) | 1105 object.predicate) |
1084 | 1106 |
1085 } // namespace blink | 1107 } // namespace blink |
1086 | 1108 |
1087 #endif // AXObject_h | 1109 #endif // AXObject_h |
OLD | NEW |