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

Unified Diff: chrome/third_party/chromevox/chromeVoxChromePageScript.js

Issue 302063005: Fix crash when calling getMsg with no options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « chrome/browser/resources/chromeos/chromevox/common/braille_util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/third_party/chromevox/chromeVoxChromePageScript.js
diff --git a/chrome/third_party/chromevox/chromeVoxChromePageScript.js b/chrome/third_party/chromevox/chromeVoxChromePageScript.js
index 46662136282e05ebc913fe5e3f01e0554fb22272..cf5289d14c08aa9dec0aad78e02f25e6bd0baca6 100644
--- a/chrome/third_party/chromevox/chromeVoxChromePageScript.js
+++ b/chrome/third_party/chromevox/chromeVoxChromePageScript.js
@@ -1037,7 +1037,7 @@ cvox.PageSelection.prototype.extend=function(a){this.sel_.directedBefore(a)?this
cvox.BrailleUtil.TEMPLATE={base:"c n v r s",aria_role_alert:"r: n",aria_role_button:"[n]",aria_role_textbox:"n: v r",input_type_button:"[n]",input_type_checkbox:"n (s)",input_type_email:"n: v r",input_type_number:"n: v r",input_type_password:"n: v r",input_type_search:"n: v r",input_type_submit:"[n]",input_type_text:"n: v r",input_type_tel:"n: v r",input_type_url:"n: v r",tag_button:"[n]",tag_textarea:"n: v r"};cvox.BrailleUtil.ValueSpan=function(a){this.offset=a};
cvox.BrailleUtil.ValueSpan.fromJson=function(a){return new cvox.BrailleUtil.ValueSpan(a.offset)};cvox.BrailleUtil.ValueSpan.prototype.toJson=function(){return this};cvox.Spannable.registerSerializableSpan(cvox.BrailleUtil.ValueSpan,"cvox.BrailleUtil.ValueSpan",cvox.BrailleUtil.ValueSpan.fromJson,cvox.BrailleUtil.ValueSpan.prototype.toJson);cvox.BrailleUtil.ValueSelectionSpan=function(){};cvox.Spannable.registerStatelessSerializableSpan(cvox.BrailleUtil.ValueSelectionSpan,"cvox.BrailleUtil.ValueSelectionSpan");
cvox.BrailleUtil.getName=function(a){return a?cvox.DomUtil.getName(a).trim():""};cvox.BrailleUtil.getRoleMsg=function(a){if(!a)return"";(a=cvox.DomUtil.getRoleMsg(a,cvox.VERBOSITY_VERBOSE))&&(a=cvox.DomUtil.collapseWhitespace(a));a&&0<a.length&&cvox.ChromeVox.msgs.getMsg(a+"_brl")&&(a+="_brl");return a};cvox.BrailleUtil.getRole=function(a){return a?(a=cvox.BrailleUtil.getRoleMsg(a))?cvox.ChromeVox.msgs.getMsg(a):"":""};
-cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){cvox.ChromeVox.msgs.getMsg(a[0]+"_brl")&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
+cvox.BrailleUtil.getState=function(a){return a?cvox.NodeStateUtil.expand(cvox.DomUtil.getStateMsgs(a,!0).map(function(a){var c=["dummy","dummy","dummy"];cvox.ChromeVox.msgs.getMsg(a[0]+"_brl",c)&&(a[0]+="_brl");return a})):""};cvox.BrailleUtil.getContainer=function(a,b){if(!a||!b)return"";for(var c=cvox.DomUtil.getUniqueAncestors(a,b),d=0,e;e=c[d];d++)if((e=cvox.BrailleUtil.getRoleMsg(e))&&-1!=cvox.BrailleUtil.CONTAINER.indexOf(e))return cvox.ChromeVox.msgs.getMsg(e);return""};
cvox.BrailleUtil.getValue=function(a){if(!a)return new cvox.Spannable;var b=new cvox.BrailleUtil.ValueSpan(0);if(cvox.DomUtil.isInputTypeText(a)){var c=a.value;"password"===a.type&&(c=c.replace(/./g,"*"));b=new cvox.Spannable(c,b);if(a===document.activeElement&&cvox.DomUtil.doesInputSupportSelection(a)){var d=goog.math.clamp(a.selectionStart,0,b.getLength());a=goog.math.clamp(a.selectionEnd,0,b.getLength());b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a))}return b}if(a instanceof
HTMLTextAreaElement){d=new cvox.EditableTextAreaShadow;d.update(a);var e=d.getLineIndex(a.selectionEnd),c=d.getLineStart(e),d=d.getLineEnd(e),d=a.value.substring(c,d);b.offset=c;b=new cvox.Spannable(d,b);a===document.activeElement&&(d=goog.math.clamp(a.selectionStart-c,0,b.getLength()),a=goog.math.clamp(a.selectionEnd-c,0,b.getLength()),b.setSpan(new cvox.BrailleUtil.ValueSelectionSpan,Math.min(d,a),Math.max(d,a)));return b}return new cvox.Spannable(cvox.DomUtil.getValue(a),b)};
cvox.BrailleUtil.getTemplated=function(a,b,c){c=c?c:{};var d=c.roleMsg||(b?cvox.DomUtil.getRoleMsg(b,cvox.VERBOSITY_VERBOSE):""),e=c.role;!e&&c.roleMsg&&(e=cvox.ChromeVox.msgs.getMsg(c.roleMsg+"_brl")||cvox.ChromeVox.msgs.getMsg(c.roleMsg));for(var e=e||cvox.BrailleUtil.getRole(b),d=cvox.BrailleUtil.TEMPLATE[d]||cvox.BrailleUtil.TEMPLATE.base,f=new cvox.Spannable,g=function(d){switch(d){case "n":return c.name||cvox.BrailleUtil.getName(b);case "r":return e;case "s":return c.state||cvox.BrailleUtil.getState(b);
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/common/braille_util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698