| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 virtual bool isMenuListOption() const { return false; } | 371 virtual bool isMenuListOption() const { return false; } |
| 372 virtual bool isMenuListPopup() const { return false; } | 372 virtual bool isMenuListPopup() const { return false; } |
| 373 bool isMenuRelated() const; | 373 bool isMenuRelated() const; |
| 374 virtual bool isMeter() const { return false; } | 374 virtual bool isMeter() const { return false; } |
| 375 virtual bool isMockObject() const { return false; } | 375 virtual bool isMockObject() const { return false; } |
| 376 virtual bool isNativeSpinButton() const { return false; } | 376 virtual bool isNativeSpinButton() const { return false; } |
| 377 virtual bool isNativeTextControl() const { return false; } // input or texta
rea | 377 virtual bool isNativeTextControl() const { return false; } // input or texta
rea |
| 378 virtual bool isNonNativeTextControl() const { return false; } // contentedit
able or role=textbox | 378 virtual bool isNonNativeTextControl() const { return false; } // contentedit
able or role=textbox |
| 379 virtual bool isPasswordField() const { return false; } | 379 virtual bool isPasswordField() const { return false; } |
| 380 virtual bool isPasswordFieldAndShouldHideValue() const; | 380 virtual bool isPasswordFieldAndShouldHideValue() const; |
| 381 bool isPresentational() const { return roleValue() == NoneRole || roleValue(
) == PresentationalRole; } |
| 381 virtual bool isProgressIndicator() const { return false; } | 382 virtual bool isProgressIndicator() const { return false; } |
| 382 bool isRadioButton() const { return roleValue() == RadioButtonRole; } | 383 bool isRadioButton() const { return roleValue() == RadioButtonRole; } |
| 383 bool isScrollbar() const { return roleValue() == ScrollBarRole; } | 384 bool isScrollbar() const { return roleValue() == ScrollBarRole; } |
| 384 virtual bool isSlider() const { return false; } | 385 virtual bool isSlider() const { return false; } |
| 385 virtual bool isSpinButton() const { return roleValue() == SpinButtonRole; } | 386 virtual bool isSpinButton() const { return roleValue() == SpinButtonRole; } |
| 386 virtual bool isSpinButtonPart() const { return false; } | 387 virtual bool isSpinButtonPart() const { return false; } |
| 387 bool isTabItem() const { return roleValue() == TabRole; } | 388 bool isTabItem() const { return roleValue() == TabRole; } |
| 388 virtual bool isTableCell() const { return false; } | 389 virtual bool isTableCell() const { return false; } |
| 389 virtual bool isTableRow() const { return false; } | 390 virtual bool isTableRow() const { return false; } |
| 390 virtual bool isTableCol() const { return false; } | 391 virtual bool isTableCol() const { return false; } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 virtual void lineBreaks(Vector<int>&) const { } | 615 virtual void lineBreaks(Vector<int>&) const { } |
| 615 | 616 |
| 616 // Static helper functions. | 617 // Static helper functions. |
| 617 static bool isARIAControl(AccessibilityRole); | 618 static bool isARIAControl(AccessibilityRole); |
| 618 static bool isARIAInput(AccessibilityRole); | 619 static bool isARIAInput(AccessibilityRole); |
| 619 static AccessibilityRole ariaRoleToWebCoreRole(const String&); | 620 static AccessibilityRole ariaRoleToWebCoreRole(const String&); |
| 620 static IntRect boundingBoxForQuads(LayoutObject*, const Vector<FloatQuad>&); | 621 static IntRect boundingBoxForQuads(LayoutObject*, const Vector<FloatQuad>&); |
| 621 static const AtomicString& roleName(AccessibilityRole); | 622 static const AtomicString& roleName(AccessibilityRole); |
| 622 static bool isInsideFocusableElementOrARIAWidget(const Node&); | 623 static bool isInsideFocusableElementOrARIAWidget(const Node&); |
| 623 | 624 |
| 625 bool hasInheritedPresentationalRole() const { return m_cachedHasInheritedPre
sentationalRole; } |
| 626 |
| 624 protected: | 627 protected: |
| 625 AXID m_id; | 628 AXID m_id; |
| 626 AccessibilityChildrenVector m_children; | 629 AccessibilityChildrenVector m_children; |
| 627 mutable bool m_haveChildren; | 630 mutable bool m_haveChildren; |
| 628 AccessibilityRole m_role; | 631 AccessibilityRole m_role; |
| 629 AXObjectInclusion m_lastKnownIsIgnoredValue; | 632 AXObjectInclusion m_lastKnownIsIgnoredValue; |
| 630 LayoutRect m_explicitElementRect; | 633 LayoutRect m_explicitElementRect; |
| 631 | 634 |
| 632 virtual bool computeAccessibilityIsIgnored() const { return true; } | 635 virtual bool computeAccessibilityIsIgnored() const { return true; } |
| 636 virtual bool computeHasInheritedPresentationalRole() const { return false; } |
| 633 | 637 |
| 634 // If this object itself scrolls, return its ScrollableArea. | 638 // If this object itself scrolls, return its ScrollableArea. |
| 635 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } | 639 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } |
| 636 virtual void scrollTo(const IntPoint&) const { } | 640 virtual void scrollTo(const IntPoint&) const { } |
| 637 | 641 |
| 638 AccessibilityRole buttonRoleType() const; | 642 AccessibilityRole buttonRoleType() const; |
| 639 | 643 |
| 640 bool allowsTextRanges() const { return isTextControl(); } | 644 bool allowsTextRanges() const { return isTextControl(); } |
| 641 unsigned getLengthForTextRange() const { return text().length(); } | 645 unsigned getLengthForTextRange() const { return text().length(); } |
| 642 | 646 |
| 643 bool m_detached; | 647 bool m_detached; |
| 644 | 648 |
| 645 mutable AXObject* m_parent; | 649 mutable AXObject* m_parent; |
| 646 | 650 |
| 647 // The following cached attribute values (the ones starting with m_cached*) | 651 // The following cached attribute values (the ones starting with m_cached*) |
| 648 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). | 652 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). |
| 649 mutable int m_lastModificationCount; | 653 mutable int m_lastModificationCount; |
| 650 mutable bool m_cachedIsIgnored : 1; | 654 mutable bool m_cachedIsIgnored : 1; |
| 651 mutable bool m_cachedIsInertOrAriaHidden : 1; | 655 mutable bool m_cachedIsInertOrAriaHidden : 1; |
| 652 mutable bool m_cachedIsDescendantOfBarrenParent : 1; | 656 mutable bool m_cachedIsDescendantOfBarrenParent : 1; |
| 653 mutable bool m_cachedIsDescendantOfDisabledNode : 1; | 657 mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
| 658 mutable bool m_cachedHasInheritedPresentationalRole : 1; |
| 654 mutable const AXObject* m_cachedLiveRegionRoot; | 659 mutable const AXObject* m_cachedLiveRegionRoot; |
| 655 | 660 |
| 656 AXObjectCacheImpl* m_axObjectCache; | 661 AXObjectCacheImpl* m_axObjectCache; |
| 657 | 662 |
| 658 // 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, |
| 659 // 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. |
| 660 void updateCachedAttributeValuesIfNeeded() const; | 665 void updateCachedAttributeValuesIfNeeded() const; |
| 661 | 666 |
| 662 private: | 667 private: |
| 663 static bool includesARIAWidgetRole(const String&); | 668 static bool includesARIAWidgetRole(const String&); |
| 664 static bool hasInteractiveARIAAttribute(const Element&); | 669 static bool hasInteractiveARIAAttribute(const Element&); |
| 665 }; | 670 }; |
| 666 | 671 |
| 667 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 672 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 668 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) | 673 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) |
| 669 | 674 |
| 670 } // namespace blink | 675 } // namespace blink |
| 671 | 676 |
| 672 #endif // AXObject_h | 677 #endif // AXObject_h |
| OLD | NEW |