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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObject.h

Issue 2047873002: Add interface to get relative bounding box rect of AX objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from aboxhall, add aria-owns test Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXObject.h
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h
index 272f1f21c69bafc57022094e5006907e2f105e37..3493cfab9c89cfb0bca1df0b50bb7236c29b86ab 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h
@@ -820,15 +820,27 @@ public:
bool containerLiveRegionAtomic() const;
bool containerLiveRegionBusy() const;
- // Location and click point in frame-relative coordinates.
+ // Location and click point in frame-relative coordinates. DEPRECATED, to be
+ // replaced by getRelativeBounds.
virtual LayoutRect elementRect() const { return m_explicitElementRect; }
void setElementRect(LayoutRect r) { m_explicitElementRect = r; }
virtual void markCachedElementRectDirty() const;
virtual IntPoint clickPoint();
// Transformation relative to the parent frame, if local (otherwise returns identity).
+ // DEPRECATED, to be replaced by getRelativeBounds.
virtual SkMatrix44 transformFromLocalParentFrame() const;
+ // NEW bounds calculation interface. Every object's bounding box is returned
+ // relative to a container object (which is guaranteed to be an ancestor) and
+ // optionally a transformation matrix that needs to be applied too.
+ // To compute the absolute bounding box of an element, start with its
+ // boundsInContainer and apply the transform. Then as long as its container is
+ // not null, walk up to its container and offset by the container's offset from
+ // origin, the container's scroll position if any, and apply the container's transform.
+ // Do this until you reach the root of the tree.
+ virtual void getRelativeBounds(AXObject** container, FloatRect& boundsInContainer, SkMatrix44& containerTransform) const;
+
// Hit testing.
// Called on the root AX object to return the deepest available element.
virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; }

Powered by Google App Engine
This is Rietveld 408576698