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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1713723002: Implement accessibility support for CSS-transformed iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 3b619f154c6fca9d60b09d3a99f30145ba36c663..925add19f2bcc0c691a7f607bc05d4a72fc32cec 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -76,6 +76,7 @@
#include "content/public/common/url_utils.h"
#include "ui/accessibility/ax_tree.h"
#include "ui/accessibility/ax_tree_update.h"
+#include "ui/gfx/geometry/quad_f.h"
#include "url/gurl.h"
#if defined(OS_ANDROID)
@@ -650,6 +651,21 @@ gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
return gfx::Point();
}
+void RenderFrameHostImpl::AccessibilityTransformToRootCoordSpace(
+ gfx::Rect* bounds) {
+ RenderWidgetHostViewBase* view =
+ static_cast<RenderWidgetHostViewBase*>(GetView());
+ gfx::Point p1 = view->TransformPointToRootCoordSpace(bounds->origin());
+ gfx::Point p2 = view->TransformPointToRootCoordSpace(bounds->top_right());
+ gfx::Point p3 = view->TransformPointToRootCoordSpace(bounds->bottom_right());
+ gfx::Point p4 = view->TransformPointToRootCoordSpace(bounds->bottom_left());
+ gfx::QuadF transformed_quad = gfx::QuadF(
+ gfx::PointF(p1), gfx::PointF(p2), gfx::PointF(p3), gfx::PointF(p4));
+ gfx::RectF new_bounds = transformed_quad.BoundingBox();
+ *bounds = gfx::Rect(new_bounds.x(), new_bounds.y(),
dcheng 2016/03/08 00:39:41 Unless there's something that requires us to do th
dmazzoni 2016/03/16 21:38:13 Sorry, I don't follow what you want me to do. I ne
dcheng 2016/03/16 21:48:31 Just have the function return a gfx::Rect rather t
dmazzoni 2016/03/16 21:53:34 Done.
+ new_bounds.width(), new_bounds.height());
+}
+
void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
Send(new AccessibilityMsg_HitTest(routing_id_, point));
}

Powered by Google App Engine
This is Rietveld 408576698