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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/editable_text_base.js

Issue 2399673005: Normalize non-breaking spaces into spaces (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/common/editable_text_test.unitjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 goog.provide('cvox.ChromeVoxEditableTextBase'); 5 goog.provide('cvox.ChromeVoxEditableTextBase');
6 goog.provide('cvox.TextChangeEvent'); 6 goog.provide('cvox.TextChangeEvent');
7 goog.provide('cvox.TypingEcho'); 7 goog.provide('cvox.TypingEcho');
8 8
9 goog.require('cvox.AbstractTts'); 9 goog.require('cvox.AbstractTts');
10 goog.require('cvox.ChromeVox'); 10 goog.require('cvox.ChromeVox');
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 }; 304 };
305 305
306 306
307 /** 307 /**
308 * Update the state of the text and selection and describe any changes as 308 * Update the state of the text and selection and describe any changes as
309 * appropriate. 309 * appropriate.
310 * 310 *
311 * @param {cvox.TextChangeEvent} evt The text change event. 311 * @param {cvox.TextChangeEvent} evt The text change event.
312 */ 312 */
313 cvox.ChromeVoxEditableTextBase.prototype.changed = function(evt) { 313 cvox.ChromeVoxEditableTextBase.prototype.changed = function(evt) {
314 // Normalize space characters.
315 evt.value = evt.value.replace('\u00a0', ' ');
314 if (!this.shouldDescribeChange(evt)) { 316 if (!this.shouldDescribeChange(evt)) {
315 this.lastChangeDescribed = false; 317 this.lastChangeDescribed = false;
316 return; 318 return;
317 } 319 }
318 320
319 if (evt.value == this.value) { 321 if (evt.value == this.value) {
320 this.describeSelectionChanged(evt); 322 this.describeSelectionChanged(evt);
321 } else { 323 } else {
322 this.describeTextChanged(evt); 324 this.describeTextChanged(evt);
323 } 325 }
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 718
717 /** 719 /**
718 * Moves the cursor backward by one paragraph. 720 * Moves the cursor backward by one paragraph.
719 * @return {boolean} True if the action was handled. 721 * @return {boolean} True if the action was handled.
720 */ 722 */
721 cvox.ChromeVoxEditableTextBase.prototype.moveCursorToPreviousParagraph = 723 cvox.ChromeVoxEditableTextBase.prototype.moveCursorToPreviousParagraph =
722 function() { return false; }; 724 function() { return false; };
723 725
724 726
725 /******************************************/ 727 /******************************************/
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/common/editable_text_test.unitjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698