cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / chromevox / braille / spans.js
blob39ffea6ce8da2a0a5be4fb88d2e3c35392a333e0
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
3 // found in the LICENSE file.
5 /**
6 * @fileoverview Objects used in spannables as annotations for ARIA values
7 * and selections.
8 */
10 goog.provide('cvox.ExtraCellsSpan');
11 goog.provide('cvox.ValueSelectionSpan');
12 goog.provide('cvox.ValueSpan');
14 goog.require('cvox.Spannable');
16 /**
17 * Attached to the value region of a braille spannable.
18 * @param {number} offset The offset of the span into the value.
19 * @constructor
21 cvox.ValueSpan = function(offset) {
22 /**
23 * The offset of the span into the value.
24 * @type {number}
26 this.offset = offset;
30 /**
31 * Creates a value span from a json serializable object.
32 * @param {!Object} obj The json serializable object to convert.
33 * @return {!cvox.ValueSpan} The value span.
35 cvox.ValueSpan.fromJson = function(obj) {
36 return new cvox.ValueSpan(obj.offset);
40 /**
41 * Converts this object to a json serializable object.
42 * @return {!Object} The JSON representation.
44 cvox.ValueSpan.prototype.toJson = function() {
45 return this;
49 cvox.Spannable.registerSerializableSpan(
50 cvox.ValueSpan,
51 'cvox.ValueSpan',
52 cvox.ValueSpan.fromJson,
53 cvox.ValueSpan.prototype.toJson);
56 /**
57 * Attached to the selected text within a value.
58 * @constructor
60 cvox.ValueSelectionSpan = function() {
64 cvox.Spannable.registerStatelessSerializableSpan(
65 cvox.ValueSelectionSpan,
66 'cvox.ValueSelectionSpan');
69 /**
70 * Causes raw cells to be added when translating from text to braille.
71 * This is supported by the {@code cvox.ExpandingBrailleTranslator}
72 * class.
73 * @constructor
75 cvox.ExtraCellsSpan = function() {
76 /** @type {ArrayBuffer} */
77 this.cells = new Uint8Array(0).buffer;