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

Unified Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 1731903003: Added cursor navigation support for standard text fields and changed selection notifications so tha… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GetTextForRange to handle text fields. Created 4 years, 10 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 | « no previous file | content/browser/accessibility/browser_accessibility_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_cocoa.mm
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 84415e1785bf7386e20290f7178d57c1dd5d4550..947575e6f7cd3bbb3c4b7745c01dcda39a98edad 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -1775,15 +1775,15 @@ bool InitializeAccessibilityTreeSearch(
return nil;
DCHECK(object);
- if (object->IsTextOnlyObject() &&
+ if ((object->IsSimpleTextControl() || object->IsTextOnlyObject()) &&
offset < static_cast<int>(object->GetText().length())) {
++offset;
} else {
- offset = 0;
- while (object &&
- !(object->IsTextOnlyObject() && object->GetText().length() == 0)) {
+ do {
object = BrowserAccessibilityManager::NextTextOnlyObject(object);
- }
+ } while (
+ object &&
+ !(object->IsTextOnlyObject() && object->GetText().length() == 0));
if (!object)
return nil;
@@ -1800,13 +1800,15 @@ bool InitializeAccessibilityTreeSearch(
return nil;
DCHECK(object);
- if (object->IsTextOnlyObject() && offset > 0) {
+ if ((object->IsSimpleTextControl() || object->IsTextOnlyObject()) &&
+ offset > 0) {
--offset;
} else {
- while (object &&
- !(object->IsTextOnlyObject() && object->GetText().length() == 0)) {
+ do {
object = BrowserAccessibilityManager::PreviousTextOnlyObject(object);
- }
+ } while (
+ object &&
+ !(object->IsTextOnlyObject() && object->GetText().length() == 0));
if (!object)
return nil;
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698