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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 virtual const AtomicString& liveRegionStatus() const { return nullAtom; } | 831 virtual const AtomicString& liveRegionStatus() const { return nullAtom; } |
832 virtual const AtomicString& liveRegionRelevant() const { return nullAtom; } | 832 virtual const AtomicString& liveRegionRelevant() const { return nullAtom; } |
833 virtual bool liveRegionAtomic() const { return false; } | 833 virtual bool liveRegionAtomic() const { return false; } |
834 virtual bool liveRegionBusy() const { return false; } | 834 virtual bool liveRegionBusy() const { return false; } |
835 | 835 |
836 const AtomicString& containerLiveRegionStatus() const; | 836 const AtomicString& containerLiveRegionStatus() const; |
837 const AtomicString& containerLiveRegionRelevant() const; | 837 const AtomicString& containerLiveRegionRelevant() const; |
838 bool containerLiveRegionAtomic() const; | 838 bool containerLiveRegionAtomic() const; |
839 bool containerLiveRegionBusy() const; | 839 bool containerLiveRegionBusy() const; |
840 | 840 |
841 // Location and click point in frame-relative coordinates. DEPRECATED, to be | 841 // Every object's bounding box is returned relative to a |
842 // replaced by getRelativeBounds. | 842 // container object (which is guaranteed to be an ancestor) and |
843 virtual LayoutRect elementRect() const { return m_explicitElementRect; } | |
844 void setElementRect(LayoutRect r, AXObject* container) | |
845 { | |
846 m_explicitElementRect = r; | |
847 m_explicitContainerID = container->axObjectID(); | |
848 } | |
849 virtual void markCachedElementRectDirty() const; | |
850 virtual IntPoint clickPoint(); | |
851 | |
852 // Transformation relative to the parent frame, if local (otherwise returns
identity). | |
853 // DEPRECATED, to be replaced by getRelativeBounds. | |
854 virtual SkMatrix44 transformFromLocalParentFrame() const; | |
855 | |
856 // NEW bounds calculation interface. Every object's bounding box is returned | |
857 // relative to a container object (which is guaranteed to be an ancestor) an
d | |
858 // optionally a transformation matrix that needs to be applied too. | 843 // optionally a transformation matrix that needs to be applied too. |
859 // To compute the absolute bounding box of an element, start with its | 844 // To compute the absolute bounding box of an element, start with its |
860 // boundsInContainer and apply the transform. Then as long as its container
is | 845 // boundsInContainer and apply the transform. Then as long as its container
is |
861 // not null, walk up to its container and offset by the container's offset f
rom | 846 // not null, walk up to its container and offset by the container's offset f
rom |
862 // origin, the container's scroll position if any, and apply the container's
transform. | 847 // origin, the container's scroll position if any, and apply the container's
transform. |
863 // Do this until you reach the root of the tree. | 848 // Do this until you reach the root of the tree. |
864 virtual void getRelativeBounds(AXObject** outContainer, FloatRect& outBounds
InContainer, SkMatrix44& outContainerTransform) const; | 849 virtual void getRelativeBounds(AXObject** outContainer, FloatRect& outBounds
InContainer, SkMatrix44& outContainerTransform) const; |
865 | 850 |
| 851 // Get the bounds in frame-relative coordinates as a LayoutRect. |
| 852 LayoutRect getBoundsInFrameCoordinates() const; |
| 853 |
| 854 // Explicitly set an object's bounding rect and offset container. |
| 855 void setElementRect(LayoutRect r, AXObject* container) |
| 856 { |
| 857 m_explicitElementRect = r; |
| 858 m_explicitContainerID = container->axObjectID(); |
| 859 } |
| 860 |
866 // Hit testing. | 861 // Hit testing. |
867 // Called on the root AX object to return the deepest available element. | 862 // Called on the root AX object to return the deepest available element. |
868 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } | 863 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } |
869 // Called on the AX object after the layout tree determines which is the rig
ht AXLayoutObject. | 864 // Called on the AX object after the layout tree determines which is the rig
ht AXLayoutObject. |
870 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; | 865 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; |
871 | 866 |
872 // High-level accessibility tree access. Other modules should only use these
functions. | 867 // High-level accessibility tree access. Other modules should only use these
functions. |
873 const AXObjectVector& children(); | 868 const AXObjectVector& children(); |
874 AXObject* parentObject() const; | 869 AXObject* parentObject() const; |
875 AXObject* parentObjectIfExists() const; | 870 AXObject* parentObjectIfExists() const; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 // Text metrics. Most of these should be deprecated, needs major cleanup. | 948 // Text metrics. Most of these should be deprecated, needs major cleanup. |
954 virtual VisiblePosition visiblePositionForIndex(int) const { return VisibleP
osition(); } | 949 virtual VisiblePosition visiblePositionForIndex(int) const { return VisibleP
osition(); } |
955 int lineForPosition(const VisiblePosition&) const; | 950 int lineForPosition(const VisiblePosition&) const; |
956 virtual int index(const VisiblePosition&) const { return -1; } | 951 virtual int index(const VisiblePosition&) const { return -1; } |
957 virtual void lineBreaks(Vector<int>&) const { } | 952 virtual void lineBreaks(Vector<int>&) const { } |
958 | 953 |
959 // Static helper functions. | 954 // Static helper functions. |
960 static bool isARIAControl(AccessibilityRole); | 955 static bool isARIAControl(AccessibilityRole); |
961 static bool isARIAInput(AccessibilityRole); | 956 static bool isARIAInput(AccessibilityRole); |
962 static AccessibilityRole ariaRoleToWebCoreRole(const String&); | 957 static AccessibilityRole ariaRoleToWebCoreRole(const String&); |
963 static IntRect boundingBoxForQuads(LayoutObject*, const Vector<FloatQuad>&); | |
964 static const AtomicString& roleName(AccessibilityRole); | 958 static const AtomicString& roleName(AccessibilityRole); |
965 static const AtomicString& internalRoleName(AccessibilityRole); | 959 static const AtomicString& internalRoleName(AccessibilityRole); |
966 static bool isInsideFocusableElementOrARIAWidget(const Node&); | 960 static bool isInsideFocusableElementOrARIAWidget(const Node&); |
967 | 961 |
968 protected: | 962 protected: |
969 AXID m_id; | 963 AXID m_id; |
970 AXObjectVector m_children; | 964 AXObjectVector m_children; |
971 mutable bool m_haveChildren; | 965 mutable bool m_haveChildren; |
972 AccessibilityRole m_role; | 966 AccessibilityRole m_role; |
973 AXObjectInclusion m_lastKnownIsIgnoredValue; | 967 AXObjectInclusion m_lastKnownIsIgnoredValue; |
(...skipping 11 matching lines...) Expand all Loading... |
985 void ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) cons
t; | 979 void ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) cons
t; |
986 String textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVector* r
elatedObjects) const; | 980 String textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVector* r
elatedObjects) const; |
987 String textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const; | 981 String textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const; |
988 | 982 |
989 virtual const AXObject* inheritsPresentationalRoleFrom() const { return 0; } | 983 virtual const AXObject* inheritsPresentationalRoleFrom() const { return 0; } |
990 | 984 |
991 virtual bool nameFromContents() const; | 985 virtual bool nameFromContents() const; |
992 | 986 |
993 AccessibilityRole buttonRoleType() const; | 987 AccessibilityRole buttonRoleType() const; |
994 | 988 |
| 989 virtual LayoutObject* layoutObjectForRelativeBounds() const { return nullptr
; } |
| 990 |
995 mutable Member<AXObject> m_parent; | 991 mutable Member<AXObject> m_parent; |
996 | 992 |
997 // The following cached attribute values (the ones starting with m_cached*) | 993 // The following cached attribute values (the ones starting with m_cached*) |
998 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). | 994 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi
ficationCount(). |
999 mutable int m_lastModificationCount; | 995 mutable int m_lastModificationCount; |
1000 mutable RGBA32 m_cachedBackgroundColor; | 996 mutable RGBA32 m_cachedBackgroundColor; |
1001 mutable bool m_cachedIsIgnored : 1; | 997 mutable bool m_cachedIsIgnored : 1; |
1002 mutable bool m_cachedIsInertOrAriaHidden : 1; | 998 mutable bool m_cachedIsInertOrAriaHidden : 1; |
1003 mutable bool m_cachedIsDescendantOfLeafNode : 1; | 999 mutable bool m_cachedIsDescendantOfLeafNode : 1; |
1004 mutable bool m_cachedIsDescendantOfDisabledNode : 1; | 1000 mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
(...skipping 14 matching lines...) Expand all Loading... |
1019 | 1015 |
1020 static unsigned s_numberOfLiveAXObjects; | 1016 static unsigned s_numberOfLiveAXObjects; |
1021 }; | 1017 }; |
1022 | 1018 |
1023 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1019 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
1024 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) | 1020 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) |
1025 | 1021 |
1026 } // namespace blink | 1022 } // namespace blink |
1027 | 1023 |
1028 #endif // AXObject_h | 1024 #endif // AXObject_h |
OLD | NEW |