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

Unified Diff: ui/accessibility/ax_tree_data.cc

Issue 2191833003: Use text affinity to return correct accessible line boundaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug in browser_accessibility_win.cc Created 4 years, 5 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
« no previous file with comments | « ui/accessibility/ax_tree_data.h ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_tree_data.cc
diff --git a/ui/accessibility/ax_tree_data.cc b/ui/accessibility/ax_tree_data.cc
index 4e434dba306c8140e1092ebc68cafef09ab271ea..0d15d52b39b159a4fd0b4266d0eb2b9956d73dc7 100644
--- a/ui/accessibility/ax_tree_data.cc
+++ b/ui/accessibility/ax_tree_data.cc
@@ -25,8 +25,10 @@ AXTreeData::AXTreeData()
focus_id(-1),
sel_anchor_object_id(-1),
sel_anchor_offset(-1),
+ sel_anchor_affinity(AX_TEXT_AFFINITY_UPSTREAM),
sel_focus_object_id(-1),
- sel_focus_offset(-1) {
+ sel_focus_offset(-1),
+ sel_focus_affinity(AX_TEXT_AFFINITY_DOWNSTREAM) {
}
AXTreeData::AXTreeData(const AXTreeData& other) = default;
@@ -65,10 +67,12 @@ std::string AXTreeData::ToString() const {
if (sel_anchor_object_id != -1) {
result += " sel_anchor_object_id=" + IntToString(sel_anchor_object_id);
result += " sel_anchor_offset=" + IntToString(sel_anchor_offset);
+ result += " sel_anchor_affinity=" + ui::ToString(sel_anchor_affinity);
}
if (sel_focus_object_id != -1) {
result += " sel_focus_object_id=" + IntToString(sel_focus_object_id);
result += " sel_focus_offset=" + IntToString(sel_focus_offset);
+ result += " sel_focus_affinity=" + ui::ToString(sel_focus_affinity);
}
return result;
@@ -84,8 +88,10 @@ bool operator==(const AXTreeData& lhs, const AXTreeData& rhs) {
lhs.url == rhs.url && lhs.focus_id == rhs.focus_id &&
lhs.sel_anchor_object_id == rhs.sel_anchor_object_id &&
lhs.sel_anchor_offset == rhs.sel_anchor_offset &&
+ lhs.sel_anchor_affinity == rhs.sel_anchor_affinity &&
lhs.sel_focus_object_id == rhs.sel_focus_object_id &&
- lhs.sel_focus_offset == rhs.sel_focus_offset);
+ lhs.sel_focus_offset == rhs.sel_focus_offset &&
+ lhs.sel_focus_affinity == rhs.sel_focus_affinity);
}
bool operator!=(const AXTreeData& lhs, const AXTreeData& rhs) {
« no previous file with comments | « ui/accessibility/ax_tree_data.h ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698