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

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

Issue 2544203004: Display images in multiline Braille
Patch Set: Rebased back onto Master Created 4 years 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/output.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index d2599e1f2934c41044e31ca0d5707ee712a343c2..03a9ee9732ed469b63f455501a5cf33444f78315 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -94,6 +94,12 @@ Output = function() {
* @private
*/
this.outputContextFirst_ = false;
+
+ /**
+ * @type {string}
+ * @private
+ */
+ this.imageDataUrl_ = '';
};
/**
@@ -941,13 +947,16 @@ Output.prototype = {
buff.setSpan(new cvox.ValueSelectionSpan(), startIndex, endIndex);
}
- var output = new cvox.NavBraille({
- text: buff,
- startIndex: startIndex,
- endIndex: endIndex
- });
-
- cvox.ChromeVox.braille.write(output);
+ if (this.imageDataUrl_) {
+ cvox.ChromeVox.braille.writeRawImage(this.imageDataUrl_);
+ } else {
+ var output = new cvox.NavBraille({
+ text: buff,
+ startIndex: startIndex,
+ endIndex: endIndex
+ });
+ cvox.ChromeVox.braille.write(output);
+ }
}
// Display.
@@ -1003,6 +1012,14 @@ Output.prototype = {
var tokens = [];
var args = null;
+ if (node != null &&
+ (node.role == RoleType.canvas || node.role == RoleType.image)) {
+ if (node.imageDataUrl)
+ this.imageDataUrl_ = node.imageDataUrl;
+ else
+ node.getImageData(0, 0);
David Tseng 2016/12/08 17:09:21 This is going to be pretty strange in terms of fee
+ }
+
// Hacky way to support args.
if (typeof(format) == 'string') {
format = format.replace(/([,:])\W/g, '$1');

Powered by Google App Engine
This is Rietveld 408576698