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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js

Issue 2312353002: Revert of Add support for rich output inside of content editables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@editable_nav
Patch Set: Created 4 years, 3 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: chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
index 74c6e59523fc65036cb3218f8141cd6a5eb326a8..4d988b800c8c900b622593c4226cc21756f989f1 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -21,7 +21,7 @@
var AutomationEvent = chrome.automation.AutomationEvent;
var AutomationNode = chrome.automation.AutomationNode;
var Cursor = cursors.Cursor;
-var Dir = constants.Dir;
+var Dir = AutomationUtil.Dir;
var EventType = chrome.automation.EventType;
var Range = cursors.Range;
var RoleType = chrome.automation.RoleType;
@@ -141,20 +141,6 @@
},
/** @override */
- describeLine: function(lineIndex, triggeredByUser) {
- if (!this.node_.state.richlyEditable) {
- cvox.ChromeVoxEditableTextBase.prototype.describeLine.call(
- this, lineIndex, triggeredByUser);
- return;
- }
- var line = this.getSelectedAutomationLine_();
- if (line) {
- new Output().withRichSpeech(line, null, Output.EventType.NAVIGATE)
- .go();
- }
- },
-
- /** @override */
getLineStart: function(lineIndex) {
if (!this.multiline || lineIndex == 0)
return 0;
@@ -187,42 +173,25 @@
/** @private */
outputBraille_: function() {
- // First line in a multiline field.
- var lineIndex = this.getLineIndex(this.start);
- var isFirstLine = this.multiline && lineIndex == 0;
+ var isFirstLine = false; // First line in a multiline field.
var output = new Output();
var range;
- if (this.node_.state.richlyEditable) {
- range = this.getSelectedAutomationLine_();
- } else if (this.multiline) {
- if (isFirstLine)
+ if (this.multiline) {
+ var lineIndex = this.getLineIndex(this.start);
+ if (lineIndex == 0) {
+ isFirstLine = true;
output.formatForBraille('$name', this.node_);
+ }
range = new Range(
new Cursor(this.node_, this.getLineStart(lineIndex)),
new Cursor(this.node_, this.getLineEnd(lineIndex)));
} else {
range = Range.fromNode(this.node_);
}
- if (range)
- output.withBraille(range, null, Output.EventType.NAVIGATE);
+ output.withBraille(range, null, Output.EventType.NAVIGATE);
if (isFirstLine)
output.formatForBraille('@tag_textarea');
output.go();
- },
-
- /**
- * @return {Range}
- * @private
- */
- getSelectedAutomationLine_: function() {
- if (!this.node_.root.anchorObject || !this.node_.root.focusObject)
- return null;
-
- var start = Cursor.fromNode(this.node_.root.anchorObject);
- start = start.move(Unit.LINE, Movement.BOUND, Dir.BACKWARD);
- var end = Cursor.fromNode(this.node_.root.focusObject);
- end = end.move(Unit.LINE, Movement.BOUND, Dir.FORWARD);
- return new Range(start, end);
}
};

Powered by Google App Engine
This is Rietveld 408576698