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

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

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Test checkbox attribute in automation API, fix whitespace, remove change to third party code Created 3 years, 9 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 virtual bool isAXSVGRoot() const { return false; } 610 virtual bool isAXSVGRoot() const { return false; }
611 611
612 // Check object role or purpose. 612 // Check object role or purpose.
613 virtual AccessibilityRole roleValue() const { return m_role; } 613 virtual AccessibilityRole roleValue() const { return m_role; }
614 bool isARIATextControl() const; 614 bool isARIATextControl() const;
615 virtual bool isARIATreeGridRow() const { return false; } 615 virtual bool isARIATreeGridRow() const { return false; }
616 virtual bool isAXTable() const { return false; } 616 virtual bool isAXTable() const { return false; }
617 virtual bool isAnchor() const { return false; } 617 virtual bool isAnchor() const { return false; }
618 bool isButton() const; 618 bool isButton() const;
619 bool isCanvas() const { return roleValue() == CanvasRole; } 619 bool isCanvas() const { return roleValue() == CanvasRole; }
620 bool isCheckable() const;
620 bool isCheckbox() const { return roleValue() == CheckBoxRole; } 621 bool isCheckbox() const { return roleValue() == CheckBoxRole; }
621 bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); } 622 bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); }
622 bool isColorWell() const { return roleValue() == ColorWellRole; } 623 bool isColorWell() const { return roleValue() == ColorWellRole; }
623 bool isComboBox() const { return roleValue() == ComboBoxRole; } 624 bool isComboBox() const { return roleValue() == ComboBoxRole; }
624 virtual bool isControl() const { return false; } 625 virtual bool isControl() const { return false; }
625 virtual bool isDataTable() const { return false; } 626 virtual bool isDataTable() const { return false; }
626 virtual bool isEmbeddedObject() const { return false; } 627 virtual bool isEmbeddedObject() const { return false; }
627 virtual bool isFieldset() const { return false; } 628 virtual bool isFieldset() const { return false; }
628 virtual bool isHeading() const { return false; } 629 virtual bool isHeading() const { return false; }
629 virtual bool isImage() const { return false; } 630 virtual bool isImage() const { return false; }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 virtual bool isSpinButtonPart() const { return false; } 667 virtual bool isSpinButtonPart() const { return false; }
667 bool isTabItem() const { return roleValue() == TabRole; } 668 bool isTabItem() const { return roleValue() == TabRole; }
668 virtual bool isTableCell() const { return false; } 669 virtual bool isTableCell() const { return false; }
669 virtual bool isTableRow() const { return false; } 670 virtual bool isTableRow() const { return false; }
670 virtual bool isTextControl() const { return false; } 671 virtual bool isTextControl() const { return false; }
671 virtual bool isTableCol() const { return false; } 672 virtual bool isTableCol() const { return false; }
672 bool isTree() const { return roleValue() == TreeRole; } 673 bool isTree() const { return roleValue() == TreeRole; }
673 bool isWebArea() const { return roleValue() == WebAreaRole; } 674 bool isWebArea() const { return roleValue() == WebAreaRole; }
674 675
675 // Check object state. 676 // Check object state.
676 virtual bool isChecked() const { return false; }
677 virtual bool isClickable() const; 677 virtual bool isClickable() const;
678 virtual bool isCollapsed() const { return false; } 678 virtual bool isCollapsed() const { return false; }
679 virtual bool isEnabled() const { return false; } 679 virtual bool isEnabled() const { return false; }
680 virtual AccessibilityExpanded isExpanded() const { return ExpandedUndefined; } 680 virtual AccessibilityExpanded isExpanded() const { return ExpandedUndefined; }
681 virtual bool isFocused() const { return false; } 681 virtual bool isFocused() const { return false; }
682 virtual bool isHovered() const { return false; } 682 virtual bool isHovered() const { return false; }
683 virtual bool isLinked() const { return false; } 683 virtual bool isLinked() const { return false; }
684 virtual bool isLoaded() const { return false; } 684 virtual bool isLoaded() const { return false; }
685 virtual bool isModal() const { return false; } 685 virtual bool isModal() const { return false; }
686 virtual bool isMultiSelectable() const { return false; } 686 virtual bool isMultiSelectable() const { return false; }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 Vector<AXRange>&) const {} 833 Vector<AXRange>&) const {}
834 // For an inline text box. 834 // For an inline text box.
835 // The integer horizontal pixel offset of each character in the string; 835 // The integer horizontal pixel offset of each character in the string;
836 // negative values for RTL. 836 // negative values for RTL.
837 virtual void textCharacterOffsets(Vector<int>&) const {} 837 virtual void textCharacterOffsets(Vector<int>&) const {}
838 // The start and end character offset of each word in the object's text. 838 // The start and end character offset of each word in the object's text.
839 virtual void wordBoundaries(Vector<AXRange>&) const {} 839 virtual void wordBoundaries(Vector<AXRange>&) const {}
840 840
841 // Properties of interactive elements. 841 // Properties of interactive elements.
842 AXSupportedAction action() const; 842 AXSupportedAction action() const;
843 virtual AccessibilityButtonState checkboxOrRadioValue() const; 843 AccessibilityButtonState checkedState() const;
844 virtual AriaCurrentState ariaCurrentState() const { 844 virtual AriaCurrentState ariaCurrentState() const {
845 return AriaCurrentStateUndefined; 845 return AriaCurrentStateUndefined;
846 } 846 }
847 virtual InvalidState getInvalidState() const { return InvalidStateUndefined; } 847 virtual InvalidState getInvalidState() const { return InvalidStateUndefined; }
848 // Only used when invalidState() returns InvalidStateOther. 848 // Only used when invalidState() returns InvalidStateOther.
849 virtual String ariaInvalidValue() const { return String(); } 849 virtual String ariaInvalidValue() const { return String(); }
850 virtual String valueDescription() const { return String(); } 850 virtual String valueDescription() const { return String(); }
851 virtual float valueForRange() const { return 0.0f; } 851 virtual float valueForRange() const { return 0.0f; }
852 virtual float maxValueForRange() const { return 0.0f; } 852 virtual float maxValueForRange() const { return 0.0f; }
853 virtual float minValueForRange() const { return 0.0f; } 853 virtual float minValueForRange() const { return 0.0f; }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 mutable Member<AXObject> m_cachedLiveRegionRoot; 1093 mutable Member<AXObject> m_cachedLiveRegionRoot;
1094 1094
1095 Member<AXObjectCacheImpl> m_axObjectCache; 1095 Member<AXObjectCacheImpl> m_axObjectCache;
1096 1096
1097 // Updates the cached attribute values. This may be recursive, so to prevent 1097 // Updates the cached attribute values. This may be recursive, so to prevent
1098 // deadlocks, 1098 // deadlocks,
1099 // functions called here may only search up the tree (ancestors), not down. 1099 // functions called here may only search up the tree (ancestors), not down.
1100 void updateCachedAttributeValuesIfNeeded() const; 1100 void updateCachedAttributeValuesIfNeeded() const;
1101 1101
1102 private: 1102 private:
1103 static bool isNativeInputInMixedState(const Node*);
1104
1103 static bool includesARIAWidgetRole(const String&); 1105 static bool includesARIAWidgetRole(const String&);
1104 static bool hasInteractiveARIAAttribute(const Element&); 1106 static bool hasInteractiveARIAAttribute(const Element&);
1105 1107
1106 static unsigned s_numberOfLiveAXObjects; 1108 static unsigned s_numberOfLiveAXObjects;
1107 }; 1109 };
1108 1110
1109 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 1111 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
1110 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ 1112 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \
1111 object.predicate) 1113 object.predicate)
1112 1114
1113 } // namespace blink 1115 } // namespace blink
1114 1116
1115 #endif // AXObject_h 1117 #endif // AXObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698