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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObject.h

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
Index: third_party/WebKit/Source/modules/accessibility/AXObject.h
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h
index 8008f4c785812fca57202b268c6e4a4ef4b3a387..59ea1c14d6632dde697eed9958985e844996ffc6 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h
@@ -493,33 +493,48 @@ public:
// The number of characters and child objects in the anchor object
// before the range starts.
int anchorOffset;
+ // When the same character offset could correspond to two possible
+ // cursor positions, upstream means it's on the previous line rather
+ // than the next line.
+ TextAffinity anchorAffinity;
+
// The deepest descendant in which the range ends.
// (nullptr means the current object.)
Persistent<AXObject> focusObject;
// The number of characters and child objects in the focus object
// before the range ends.
int focusOffset;
+ // When the same character offset could correspond to two possible
+ // cursor positions, upstream means it's on the previous line rather
+ // than the next line.
+ TextAffinity focusAffinity;
AXRange()
: anchorObject(nullptr)
, anchorOffset(-1)
+ , anchorAffinity(TextAffinity::Upstream)
, focusObject(nullptr)
, focusOffset(-1)
+ , focusAffinity(TextAffinity::Downstream)
{ }
AXRange(int startOffset, int endOffset)
: anchorObject(nullptr)
, anchorOffset(startOffset)
+ , anchorAffinity(TextAffinity::Upstream)
, focusObject(nullptr)
, focusOffset(endOffset)
+ , focusAffinity(TextAffinity::Downstream)
{ }
- AXRange(AXObject* anchorObject, int anchorOffset,
- AXObject* focusObject, int focusOffset)
+ AXRange(AXObject* anchorObject, int anchorOffset, TextAffinity anchorAffinity,
+ AXObject* focusObject, int focusOffset, TextAffinity focusAffinity)
: anchorObject(anchorObject)
, anchorOffset(anchorOffset)
+ , anchorAffinity(anchorAffinity)
, focusObject(focusObject)
, focusOffset(focusOffset)
+ , focusAffinity(focusAffinity)
{ }
bool isValid() const

Powered by Google App Engine
This is Rietveld 408576698