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

Unified Diff: components/test_runner/web_ax_object_proxy.cc

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeVox and Automation API tests Created 5 years, 1 month 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: components/test_runner/web_ax_object_proxy.cc
diff --git a/components/test_runner/web_ax_object_proxy.cc b/components/test_runner/web_ax_object_proxy.cc
index 1c3b8d787347fac88729068e0d473f6d50c3e664..a5cb5e40f062f307985338b4350e10a6ab68f159 100644
--- a/components/test_runner/web_ax_object_proxy.cc
+++ b/components/test_runner/web_ax_object_proxy.cc
@@ -315,7 +315,10 @@ blink::WebRect BoundsForCharacter(const blink::WebAXObject& object,
blink::WebAXObject inline_text_box = object.childAt(i);
DCHECK_EQ(inline_text_box.role(), blink::WebAXRoleInlineTextBox);
int start = end;
- end += inline_text_box.stringValue().length();
+ blink::WebAXNameFrom nameFrom;
+ blink::WebVector<blink::WebAXObject> nameObjects;
+ blink::WebString name = inline_text_box.name(nameFrom, nameObjects);
+ end += name.length();
if (characterIndex < start || characterIndex >= end)
continue;
blink::WebRect inline_text_box_rect = inline_text_box.boundingBoxRect();
@@ -323,7 +326,7 @@ blink::WebRect BoundsForCharacter(const blink::WebAXObject& object,
blink::WebVector<int> character_offsets;
inline_text_box.characterOffsets(character_offsets);
DCHECK(character_offsets.size() > 0 &&
- character_offsets.size() == inline_text_box.stringValue().length());
+ character_offsets.size() == name.length());
switch (inline_text_box.textDirection()) {
case blink::WebAXTextDirectionLR: {
if (localIndex) {
@@ -393,7 +396,10 @@ void GetBoundariesForOneWord(const blink::WebAXObject& object,
blink::WebAXObject inline_text_box = object.childAt(i);
DCHECK_EQ(inline_text_box.role(), blink::WebAXRoleInlineTextBox);
int start = end;
- end += inline_text_box.stringValue().length();
+ blink::WebAXNameFrom nameFrom;
+ blink::WebVector<blink::WebAXObject> nameObjects;
+ blink::WebString name = inline_text_box.name(nameFrom, nameObjects);
+ end += name.length();
if (end <= character_index)
continue;
int localIndex = character_index - start;

Powered by Google App Engine
This is Rietveld 408576698