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

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

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

Powered by Google App Engine
This is Rietveld 408576698