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

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 issue with ariaTextAlternative 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..3160dea93fb9b172dd56b90fd56d7cf1dfe9c412 100644
--- a/components/test_runner/web_ax_object_proxy.cc
+++ b/components/test_runner/web_ax_object_proxy.cc
@@ -299,9 +299,7 @@ std::string GetLanguage(const blink::WebAXObject& object) {
}
std::string GetAttributes(const blink::WebAXObject& object) {
- blink::WebAXNameFrom nameFrom;
- blink::WebVector<blink::WebAXObject> nameObjects;
- std::string attributes(object.name(nameFrom, nameObjects).utf8());
+ std::string attributes(object.name().utf8());
attributes.append("\n");
attributes.append(GetRole(object));
return attributes;
@@ -315,7 +313,8 @@ 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::WebString name = inline_text_box.name();
+ end += name.length();
if (characterIndex < start || characterIndex >= end)
continue;
blink::WebRect inline_text_box_rect = inline_text_box.boundingBoxRect();
@@ -323,7 +322,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 +392,8 @@ 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::WebString name = inline_text_box.name();
+ end += name.length();
if (end <= character_index)
continue;
int localIndex = character_index - start;
@@ -1299,9 +1299,7 @@ v8::Local<v8::Object> WebAXObjectProxy::PreviousOnLine() {
std::string WebAXObjectProxy::Name() {
accessibility_object_.updateLayoutAndCheckValidity();
- blink::WebAXNameFrom nameFrom;
- blink::WebVector<blink::WebAXObject> nameObjects;
- return accessibility_object_.name(nameFrom, nameObjects).utf8();
+ return accessibility_object_.name().utf8();
}
std::string WebAXObjectProxy::NameFrom() {
« no previous file with comments | « components/html_viewer/ax_provider_impl.cc ('k') | content/browser/accessibility/accessibility_tree_formatter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698