| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 virtual bool liveRegionBusy() const { return false; } | 816 virtual bool liveRegionBusy() const { return false; } |
| 817 | 817 |
| 818 const AtomicString& containerLiveRegionStatus() const; | 818 const AtomicString& containerLiveRegionStatus() const; |
| 819 const AtomicString& containerLiveRegionRelevant() const; | 819 const AtomicString& containerLiveRegionRelevant() const; |
| 820 bool containerLiveRegionAtomic() const; | 820 bool containerLiveRegionAtomic() const; |
| 821 bool containerLiveRegionBusy() const; | 821 bool containerLiveRegionBusy() const; |
| 822 | 822 |
| 823 // Location and click point in frame-relative coordinates. DEPRECATED, to be | 823 // Location and click point in frame-relative coordinates. DEPRECATED, to be |
| 824 // replaced by getRelativeBounds. | 824 // replaced by getRelativeBounds. |
| 825 virtual LayoutRect elementRect() const { return m_explicitElementRect; } | 825 virtual LayoutRect elementRect() const { return m_explicitElementRect; } |
| 826 void setElementRect(LayoutRect r) { m_explicitElementRect = r; } | 826 void setElementRect(LayoutRect r, AXObject* container) |
| 827 { |
| 828 m_explicitElementRect = r; |
| 829 m_explicitContainerID = container->axObjectID(); |
| 830 } |
| 827 virtual void markCachedElementRectDirty() const; | 831 virtual void markCachedElementRectDirty() const; |
| 828 virtual IntPoint clickPoint(); | 832 virtual IntPoint clickPoint(); |
| 829 | 833 |
| 830 // Transformation relative to the parent frame, if local (otherwise returns
identity). | 834 // Transformation relative to the parent frame, if local (otherwise returns
identity). |
| 831 // DEPRECATED, to be replaced by getRelativeBounds. | 835 // DEPRECATED, to be replaced by getRelativeBounds. |
| 832 virtual SkMatrix44 transformFromLocalParentFrame() const; | 836 virtual SkMatrix44 transformFromLocalParentFrame() const; |
| 833 | 837 |
| 834 // NEW bounds calculation interface. Every object's bounding box is returned | 838 // NEW bounds calculation interface. Every object's bounding box is returned |
| 835 // relative to a container object (which is guaranteed to be an ancestor) an
d | 839 // relative to a container object (which is guaranteed to be an ancestor) an
d |
| 836 // optionally a transformation matrix that needs to be applied too. | 840 // optionally a transformation matrix that needs to be applied too. |
| 837 // To compute the absolute bounding box of an element, start with its | 841 // To compute the absolute bounding box of an element, start with its |
| 838 // boundsInContainer and apply the transform. Then as long as its container
is | 842 // boundsInContainer and apply the transform. Then as long as its container
is |
| 839 // not null, walk up to its container and offset by the container's offset f
rom | 843 // not null, walk up to its container and offset by the container's offset f
rom |
| 840 // origin, the container's scroll position if any, and apply the container's
transform. | 844 // origin, the container's scroll position if any, and apply the container's
transform. |
| 841 // Do this until you reach the root of the tree. | 845 // Do this until you reach the root of the tree. |
| 842 virtual void getRelativeBounds(AXObject** container, FloatRect& boundsInCont
ainer, SkMatrix44& containerTransform) const; | 846 virtual void getRelativeBounds(AXObject** outContainer, FloatRect& outBounds
InContainer, SkMatrix44& outContainerTransform) const; |
| 843 | 847 |
| 844 // Hit testing. | 848 // Hit testing. |
| 845 // Called on the root AX object to return the deepest available element. | 849 // Called on the root AX object to return the deepest available element. |
| 846 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } | 850 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } |
| 847 // Called on the AX object after the layout tree determines which is the rig
ht AXLayoutObject. | 851 // Called on the AX object after the layout tree determines which is the rig
ht AXLayoutObject. |
| 848 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; | 852 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; |
| 849 | 853 |
| 850 // High-level accessibility tree access. Other modules should only use these
functions. | 854 // High-level accessibility tree access. Other modules should only use these
functions. |
| 851 const AXObjectVector& children(); | 855 const AXObjectVector& children(); |
| 852 AXObject* parentObject() const; | 856 AXObject* parentObject() const; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 static const AtomicString& internalRoleName(AccessibilityRole); | 947 static const AtomicString& internalRoleName(AccessibilityRole); |
| 944 static bool isInsideFocusableElementOrARIAWidget(const Node&); | 948 static bool isInsideFocusableElementOrARIAWidget(const Node&); |
| 945 | 949 |
| 946 protected: | 950 protected: |
| 947 AXID m_id; | 951 AXID m_id; |
| 948 AXObjectVector m_children; | 952 AXObjectVector m_children; |
| 949 mutable bool m_haveChildren; | 953 mutable bool m_haveChildren; |
| 950 AccessibilityRole m_role; | 954 AccessibilityRole m_role; |
| 951 AXObjectInclusion m_lastKnownIsIgnoredValue; | 955 AXObjectInclusion m_lastKnownIsIgnoredValue; |
| 952 LayoutRect m_explicitElementRect; | 956 LayoutRect m_explicitElementRect; |
| 957 AXID m_explicitContainerID; |
| 953 | 958 |
| 954 // Used only inside textAlternative(): | 959 // Used only inside textAlternative(): |
| 955 static String collapseWhitespace(const String&); | 960 static String collapseWhitespace(const String&); |
| 956 static String recursiveTextAlternative(const AXObject&, bool inAriaLabelledB
yTraversal, AXObjectSet& visited); | 961 static String recursiveTextAlternative(const AXObject&, bool inAriaLabelledB
yTraversal, AXObjectSet& visited); |
| 957 bool isHiddenForTextAlternativeCalculation() const; | 962 bool isHiddenForTextAlternativeCalculation() const; |
| 958 String ariaTextAlternative(bool recursive, bool inAriaLabelledByTraversal, A
XObjectSet& visited, AXNameFrom&, AXRelatedObjectVector*, NameSources*, bool* fo
undTextAlternative) const; | 963 String ariaTextAlternative(bool recursive, bool inAriaLabelledByTraversal, A
XObjectSet& visited, AXNameFrom&, AXRelatedObjectVector*, NameSources*, bool* fo
undTextAlternative) const; |
| 959 String textFromElements(bool inAriaLabelledByTraversal, AXObjectSet& visited
, HeapVector<Member<Element>>& elements, AXRelatedObjectVector* relatedObjects)
const; | 964 String textFromElements(bool inAriaLabelledByTraversal, AXObjectSet& visited
, HeapVector<Member<Element>>& elements, AXRelatedObjectVector* relatedObjects)
const; |
| 960 void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; | 965 void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; |
| 961 void elementsFromAttribute(HeapVector<Member<Element>>& elements, const Qual
ifiedName&) const; | 966 void elementsFromAttribute(HeapVector<Member<Element>>& elements, const Qual
ifiedName&) const; |
| 962 void ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) cons
t; | 967 void ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements) cons
t; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 | 1001 |
| 997 static unsigned s_numberOfLiveAXObjects; | 1002 static unsigned s_numberOfLiveAXObjects; |
| 998 }; | 1003 }; |
| 999 | 1004 |
| 1000 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1005 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 1001 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) | 1006 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred
icate) |
| 1002 | 1007 |
| 1003 } // namespace blink | 1008 } // namespace blink |
| 1004 | 1009 |
| 1005 #endif // AXObject_h | 1010 #endif // AXObject_h |
| OLD | NEW |