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

Unified Diff: content/browser/accessibility/accessibility_tree_formatter_blink.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/accessibility/accessibility_tree_formatter_blink.cc
diff --git a/content/browser/accessibility/accessibility_tree_formatter_blink.cc b/content/browser/accessibility/accessibility_tree_formatter_blink.cc
index b74fb1d91b6c2072ff36062ebd5acfb84a6c7540..6796770f2a565e2e9cd8693f6a164a23c70af898 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_blink.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter_blink.cc
@@ -7,6 +7,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
+#include "ui/gfx/transform.h"
namespace content {
@@ -41,10 +42,21 @@ void AccessibilityTreeFormatterBlink::AddProperties(
dict->SetString("internalRole", ui::ToString(node.GetData().role));
- dict->SetInteger("boundsX", node.GetData().location.x());
- dict->SetInteger("boundsY", node.GetData().location.y());
- dict->SetInteger("boundsWidth", node.GetData().location.width());
- dict->SetInteger("boundsHeight", node.GetData().location.height());
+ gfx::Rect bounds = node.GetData().location;
+ dict->SetInteger("boundsX", bounds.x());
+ dict->SetInteger("boundsY", bounds.y());
+ dict->SetInteger("boundsWidth", bounds.width());
+ dict->SetInteger("boundsHeight", bounds.height());
+
+ gfx::Rect page_bounds = node.GetLocalBoundsRect();
+ dict->SetInteger("pageBoundsX", page_bounds.x());
+ dict->SetInteger("pageBoundsY", page_bounds.y());
+ dict->SetInteger("pageBoundsWidth", page_bounds.width());
+ dict->SetInteger("pageBoundsHeight", page_bounds.height());
+
+ dict->SetBoolean("transform",
+ node.GetData().transform &&
+ !node.GetData().transform->IsIdentity());
for (int state_index = ui::AX_STATE_NONE;
state_index <= ui::AX_STATE_LAST;
@@ -133,6 +145,19 @@ base::string16 AccessibilityTreeFormatterBlink::ToString(
FormatCoordinates("size", "boundsWidth", "boundsHeight", dict),
&line);
+ WriteAttribute(false,
+ FormatCoordinates("pageLocation",
+ "pageBoundsX", "pageBoundsY", dict),
+ &line);
+ WriteAttribute(false,
+ FormatCoordinates("pageSize",
+ "pageBoundsWidth", "pageBoundsHeight", dict),
+ &line);
+
+ bool transform;
+ if (dict.GetBoolean("transform", &transform) && transform)
+ WriteAttribute(false, "transform", &line);
+
for (int attr_index = ui::AX_STRING_ATTRIBUTE_NONE;
attr_index <= ui::AX_STRING_ATTRIBUTE_LAST;
++attr_index) {

Powered by Google App Engine
This is Rietveld 408576698