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

Unified Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2948513002: Forward BrowserAccessibility::accHitTest to AXPlatformNode. (Closed)
Patch Set: spelling Created 3 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: ui/accessibility/platform/ax_platform_node_win.cc
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
index 5cb972b0b43322fdd3638b7c531f0cee1e105880..774e6e76460c53c097c0e4c1cd4a3a7535328dbd 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -278,6 +278,14 @@ int AXPlatformNodeWin::GetIndexInParent() {
STDMETHODIMP AXPlatformNodeWin::accHitTest(
LONG x_left, LONG y_top, VARIANT* child) {
COM_OBJECT_VALIDATE_1_ARG(child);
+
+ gfx::Point point(x_left, y_top);
+ if (!delegate_->GetScreenBoundsRect().Contains(point)) {
+ // Return S_FALSE and VT_EMPTY when outside the object's boundaries.
+ child->vt = VT_EMPTY;
+ return S_FALSE;
+ }
+
gfx::NativeViewAccessible hit_child = delegate_->HitTestSync(x_left, y_top);
if (!hit_child) {
child->vt = VT_EMPTY;

Powered by Google App Engine
This is Rietveld 408576698