Index: chrome/browser/resources/chromeos/chromevox/braille/spans.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/spans.js b/chrome/browser/resources/chromeos/chromevox/braille/spans.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..63349c9ad5673cd2814a071e48de88324445a110 |
--- /dev/null |
+++ b/chrome/browser/resources/chromeos/chromevox/braille/spans.js |
@@ -0,0 +1,65 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
David Tseng
2015/01/29 18:48:38
nit: 2015
Also, I tried this a while ago and ran i
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/** |
+ * @fileoverview Objects used in spannables as annotations for ARIA values |
+ * and selections. |
+ */ |
+ |
+goog.provide('cvox.ValueSelectionSpan'); |
+goog.provide('cvox.ValueSpan'); |
+ |
+goog.require('cvox.Spannable'); |
+ |
+/** |
+ * Attached to the value region of a braille spannable. |
+ * @param {number} offset The offset of the span into the value. |
+ * @constructor |
+ */ |
+cvox.ValueSpan = function(offset) { |
+ /** |
+ * The offset of the span into the value. |
+ * @type {number} |
+ */ |
+ this.offset = offset; |
+}; |
+ |
+ |
+/** |
+ * Creates a value span from a json serializable object. |
+ * @param {!Object} obj The json serializable object to convert. |
+ * @return {!cvox.ValueSpan} The value span. |
+ */ |
+cvox.ValueSpan.fromJson = function(obj) { |
+ return new cvox.ValueSpan(obj.offset); |
+}; |
+ |
+ |
+/** |
+ * Converts this object to a json serializable object. |
+ * @return {!Object} The JSON representation. |
+ */ |
+cvox.ValueSpan.prototype.toJson = function() { |
+ return this; |
+}; |
+ |
+ |
+cvox.Spannable.registerSerializableSpan( |
+ cvox.ValueSpan, |
+ 'cvox.ValueSpan', |
+ cvox.ValueSpan.fromJson, |
+ cvox.ValueSpan.prototype.toJson); |
+ |
+ |
+/** |
+ * Attached to the selected text within a value. |
+ * @constructor |
+ */ |
+cvox.ValueSelectionSpan = function() { |
+}; |
+ |
+ |
+cvox.Spannable.registerStatelessSerializableSpan( |
+ cvox.ValueSelectionSpan, |
+ 'cvox.ValueSelectionSpan'); |