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

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

Issue 2589273002: Add sparse accessibility attribute interface to Blink (Closed)
Patch Set: Try to fix win component build compile Created 3 years, 11 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 TextStyleUnderline = 1 << 2, 317 TextStyleUnderline = 1 << 2,
318 TextStyleLineThrough = 1 << 3 318 TextStyleLineThrough = 1 << 3
319 }; 319 };
320 320
321 enum TextUnderElementMode { 321 enum TextUnderElementMode {
322 TextUnderElementAll, 322 TextUnderElementAll,
323 TextUnderElementAny // If the text is unimportant, just whether or not it's 323 TextUnderElementAny // If the text is unimportant, just whether or not it's
324 // present 324 // present
325 }; 325 };
326 326
327 enum class AXBoolAttribute {
328 AriaModal,
329 };
330
331 enum class AXStringAttribute {
332 AriaKeyShortcuts,
333 AriaRoleDescription,
334 };
335
336 enum class AXObjectAttribute {
337 AriaActiveDescendant,
338 AriaErrorMessage,
339 };
340
341 enum class AXObjectVectorAttribute {
342 AriaControls,
343 AriaDetails,
344 AriaFlowTo,
345 };
346
347 class AXSparseAttributeMap {
348 public:
349 virtual void addBoolAttribute(AXBoolAttribute, bool) = 0;
350 virtual void addStringAttribute(AXStringAttribute, const String&) = 0;
351 virtual void addObjectAttribute(AXObjectAttribute, AXObject*) = 0;
352 virtual void addObjectVectorAttribute(AXObjectVectorAttribute,
353 HeapVector<Member<AXObject>>&) = 0;
354 };
355
327 // The source of the accessible name of an element. This is needed 356 // The source of the accessible name of an element. This is needed
328 // because on some platforms this determines how the accessible name 357 // because on some platforms this determines how the accessible name
329 // is exposed. 358 // is exposed.
330 enum AXNameFrom { 359 enum AXNameFrom {
331 AXNameFromUninitialized = -1, 360 AXNameFromUninitialized = -1,
332 AXNameFromAttribute = 0, 361 AXNameFromAttribute = 0,
333 AXNameFromCaption, 362 AXNameFromCaption,
334 AXNameFromContents, 363 AXNameFromContents,
335 AXNameFromPlaceholder, 364 AXNameFromPlaceholder,
336 AXNameFromRelatedElement, 365 AXNameFromRelatedElement,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 592
564 // The AXObjectCacheImpl that owns this object, and its unique ID within this 593 // The AXObjectCacheImpl that owns this object, and its unique ID within this
565 // cache. 594 // cache.
566 AXObjectCacheImpl& axObjectCache() const { 595 AXObjectCacheImpl& axObjectCache() const {
567 ASSERT(m_axObjectCache); 596 ASSERT(m_axObjectCache);
568 return *m_axObjectCache; 597 return *m_axObjectCache;
569 } 598 }
570 599
571 AXID axObjectID() const { return m_id; } 600 AXID axObjectID() const { return m_id; }
572 601
602 virtual void getSparseAXAttributes(AXSparseAttributeMap&) const {}
603
573 // Determine subclass type. 604 // Determine subclass type.
574 virtual bool isAXNodeObject() const { return false; } 605 virtual bool isAXNodeObject() const { return false; }
575 virtual bool isAXLayoutObject() const { return false; } 606 virtual bool isAXLayoutObject() const { return false; }
576 virtual bool isAXListBox() const { return false; } 607 virtual bool isAXListBox() const { return false; }
577 virtual bool isAXListBoxOption() const { return false; } 608 virtual bool isAXListBoxOption() const { return false; }
578 virtual bool isAXRadioInput() const { return false; } 609 virtual bool isAXRadioInput() const { return false; }
579 virtual bool isAXSVGRoot() const { return false; } 610 virtual bool isAXSVGRoot() const { return false; }
580 611
581 // Check object role or purpose. 612 // Check object role or purpose.
582 virtual AccessibilityRole roleValue() const { return m_role; } 613 virtual AccessibilityRole roleValue() const { return m_role; }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 virtual String ariaInvalidValue() const { return String(); } 848 virtual String ariaInvalidValue() const { return String(); }
818 virtual String valueDescription() const { return String(); } 849 virtual String valueDescription() const { return String(); }
819 virtual float valueForRange() const { return 0.0f; } 850 virtual float valueForRange() const { return 0.0f; }
820 virtual float maxValueForRange() const { return 0.0f; } 851 virtual float maxValueForRange() const { return 0.0f; }
821 virtual float minValueForRange() const { return 0.0f; } 852 virtual float minValueForRange() const { return 0.0f; }
822 virtual String stringValue() const { return String(); } 853 virtual String stringValue() const { return String(); }
823 854
824 // ARIA attributes. 855 // ARIA attributes.
825 virtual AXObject* activeDescendant() { return nullptr; } 856 virtual AXObject* activeDescendant() { return nullptr; }
826 virtual String ariaAutoComplete() const { return String(); } 857 virtual String ariaAutoComplete() const { return String(); }
827 virtual void ariaFlowToElements(AXObjectVector&) const {}
828 virtual void ariaControlsElements(AXObjectVector&) const {}
829 virtual void ariaOwnsElements(AXObjectVector& owns) const {} 858 virtual void ariaOwnsElements(AXObjectVector& owns) const {}
830 virtual void ariaDescribedbyElements(AXObjectVector&) const {} 859 virtual void ariaDescribedbyElements(AXObjectVector&) const {}
831 virtual void ariaLabelledbyElements(AXObjectVector&) const {} 860 virtual void ariaLabelledbyElements(AXObjectVector&) const {}
832 virtual bool ariaHasPopup() const { return false; } 861 virtual bool ariaHasPopup() const { return false; }
833 virtual bool isEditable() const { return false; } 862 virtual bool isEditable() const { return false; }
834 bool isMultiline() const; 863 bool isMultiline() const;
835 virtual bool isRichlyEditable() const { return false; } 864 virtual bool isRichlyEditable() const { return false; }
836 bool ariaPressedIsPresent() const; 865 bool ariaPressedIsPresent() const;
837 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; } 866 virtual AccessibilityRole ariaRoleAttribute() const { return UnknownRole; }
838 virtual bool ariaRoleHasPresentationalChildren() const { return false; } 867 virtual bool ariaRoleHasPresentationalChildren() const { return false; }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 static unsigned s_numberOfLiveAXObjects; 1105 static unsigned s_numberOfLiveAXObjects;
1077 }; 1106 };
1078 1107
1079 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 1108 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
1080 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ 1109 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \
1081 object.predicate) 1110 object.predicate)
1082 1111
1083 } // namespace blink 1112 } // namespace blink
1084 1113
1085 #endif // AXObject_h 1114 #endif // AXObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698