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

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 1195223006: Reports the position of the caret and current selection in content editables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 607
608 bool BrowserAccessibility::IsEditableText() const { 608 bool BrowserAccessibility::IsEditableText() const {
609 // These roles don't have readonly set, but they're not editable text. 609 // These roles don't have readonly set, but they're not editable text.
610 if (GetRole() == ui::AX_ROLE_SCROLL_AREA || 610 if (GetRole() == ui::AX_ROLE_SCROLL_AREA ||
611 GetRole() == ui::AX_ROLE_COLUMN || 611 GetRole() == ui::AX_ROLE_COLUMN ||
612 GetRole() == ui::AX_ROLE_TABLE_HEADER_CONTAINER) { 612 GetRole() == ui::AX_ROLE_TABLE_HEADER_CONTAINER) {
613 return false; 613 return false;
614 } 614 }
615 615
616 // Note: WebAXStateReadonly being false means it's either a text control, 616 // Note: WebAXStateReadonly being false means it's either a text control,
617 // or contenteditable. We also check for editable text roles to cover 617 // or contenteditable. We also check for the text field role to cover
618 // another element that has role=textbox set on it. 618 // elements that have role=textbox set on it.
619 return (!HasState(ui::AX_STATE_READ_ONLY) || 619 return (!HasState(ui::AX_STATE_READ_ONLY) ||
620 GetRole() == ui::AX_ROLE_TEXT_FIELD); 620 GetRole() == ui::AX_ROLE_TEXT_FIELD);
621 } 621 }
622 622
623 bool BrowserAccessibility::IsWebAreaForPresentationalIframe() const { 623 bool BrowserAccessibility::IsWebAreaForPresentationalIframe() const {
624 if (GetRole() != ui::AX_ROLE_WEB_AREA && 624 if (GetRole() != ui::AX_ROLE_WEB_AREA &&
625 GetRole() != ui::AX_ROLE_ROOT_WEB_AREA) { 625 GetRole() != ui::AX_ROLE_ROOT_WEB_AREA) {
626 return false; 626 return false;
627 } 627 }
628 628
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 } 729 }
730 need_to_offset_web_area = true; 730 need_to_offset_web_area = true;
731 } 731 }
732 parent = parent->GetParentForBoundsCalculation(); 732 parent = parent->GetParentForBoundsCalculation();
733 } 733 }
734 734
735 return bounds; 735 return bounds;
736 } 736 }
737 737
738 } // namespace content 738 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698