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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 virtual void lineBreaks(Vector<int>&) const { } | 615 virtual void lineBreaks(Vector<int>&) const { } |
616 | 616 |
617 // Static helper functions. | 617 // Static helper functions. |
618 static bool isARIAControl(AccessibilityRole); | 618 static bool isARIAControl(AccessibilityRole); |
619 static bool isARIAInput(AccessibilityRole); | 619 static bool isARIAInput(AccessibilityRole); |
620 static AccessibilityRole ariaRoleToWebCoreRole(const String&); | 620 static AccessibilityRole ariaRoleToWebCoreRole(const String&); |
621 static IntRect boundingBoxForQuads(LayoutObject*, const Vector<FloatQuad>&); | 621 static IntRect boundingBoxForQuads(LayoutObject*, const Vector<FloatQuad>&); |
622 static const AtomicString& roleName(AccessibilityRole); | 622 static const AtomicString& roleName(AccessibilityRole); |
623 static bool isInsideFocusableElementOrARIAWidget(const Node&); | 623 static bool isInsideFocusableElementOrARIAWidget(const Node&); |
624 | 624 |
| 625 bool hasInheritedPresentationRole() const { return m_cachedHasInheritedPrese
ntationRole; } |
| 626 |
625 protected: | 627 protected: |
626 AXID m_id; | 628 AXID m_id; |
627 AccessibilityChildrenVector m_children; | 629 AccessibilityChildrenVector m_children; |
628 mutable bool m_haveChildren; | 630 mutable bool m_haveChildren; |
629 AccessibilityRole m_role; | 631 AccessibilityRole m_role; |
630 AXObjectInclusion m_lastKnownIsIgnoredValue; | 632 AXObjectInclusion m_lastKnownIsIgnoredValue; |
631 LayoutRect m_explicitElementRect; | 633 LayoutRect m_explicitElementRect; |
632 | 634 |
633 virtual bool computeAccessibilityIsIgnored() const { return true; } | 635 virtual bool computeAccessibilityIsIgnored() const { return true; } |
| 636 virtual bool computeHasInheritedPresentationRole() const { return false; } |
634 | 637 |
635 // If this object itself scrolls, return its ScrollableArea. | 638 // If this object itself scrolls, return its ScrollableArea. |
636 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } | 639 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } |
637 virtual void scrollTo(const IntPoint&) const { } | 640 virtual void scrollTo(const IntPoint&) const { } |
638 | 641 |
639 AccessibilityRole buttonRoleType() const; | 642 AccessibilityRole buttonRoleType() const; |
640 | 643 |
641 bool allowsTextRanges() const { return isTextControl(); } | 644 bool allowsTextRanges() const { return isTextControl(); } |
642 unsigned getLengthForTextRange() const { return text().length(); } | 645 unsigned getLengthForTextRange() const { return text().length(); } |
643 | 646 |
644 bool m_detached; | 647 bool m_detached; |
645 | 648 |
646 mutable AXObject* m_parent; | 649 mutable AXObject* m_parent; |
647 | 650 |
648 // The following cached attribute values (the ones starting with m_cached*) | 651 // The following cached attribute values (the ones starting with m_cached*) |
649 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). | 652 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). |
650 mutable int m_lastModificationCount; | 653 mutable int m_lastModificationCount; |
651 mutable bool m_cachedIsIgnored : 1; | 654 mutable bool m_cachedIsIgnored : 1; |
652 mutable bool m_cachedIsInertOrAriaHidden : 1; | 655 mutable bool m_cachedIsInertOrAriaHidden : 1; |
653 mutable bool m_cachedIsDescendantOfBarrenParent : 1; | 656 mutable bool m_cachedIsDescendantOfBarrenParent : 1; |
654 mutable bool m_cachedIsDescendantOfDisabledNode : 1; | 657 mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
| 658 mutable bool m_cachedHasInheritedPresentationRole : 1; |
655 mutable const AXObject* m_cachedLiveRegionRoot; | 659 mutable const AXObject* m_cachedLiveRegionRoot; |
656 | 660 |
657 AXObjectCacheImpl* m_axObjectCache; | 661 AXObjectCacheImpl* m_axObjectCache; |
658 | 662 |
659 // Updates the cached attribute values. This may be recursive, so to prevent
deadlocks, | 663 // Updates the cached attribute values. This may be recursive, so to prevent
deadlocks, |
660 // functions called here may only search up the tree (ancestors), not down. | 664 // functions called here may only search up the tree (ancestors), not down. |
661 void updateCachedAttributeValuesIfNeeded() const; | 665 void updateCachedAttributeValuesIfNeeded() const; |
662 | 666 |
663 private: | 667 private: |
664 static bool includesARIAWidgetRole(const String&); | 668 static bool includesARIAWidgetRole(const String&); |
665 static bool hasInteractiveARIAAttribute(const Element&); | 669 static bool hasInteractiveARIAAttribute(const Element&); |
666 }; | 670 }; |
667 | 671 |
668 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 672 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
669 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) | 673 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) |
670 | 674 |
671 } // namespace blink | 675 } // namespace blink |
672 | 676 |
673 #endif // AXObject_h | 677 #endif // AXObject_h |
OLD | NEW |