1// Copyright 2014 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.
4
5/**
6 * @fileoverview A class for walking "groups". Groups, intuitively, are logical
7 * collections of dom elements. See AbstractNodeWalker and the
8 * stopNodeDescent() method here for how groups are defined.
9 */
10
11
12goog.provide('cvox.GroupWalker');
13
14goog.require('cvox.AbstractNodeWalker');
15goog.require('cvox.BrailleUtil');
16goog.require('cvox.CursorSelection');
17goog.require('cvox.DescriptionUtil');
18goog.require('cvox.DomUtil');
19goog.require('cvox.GroupUtil');
20
21
22/**
23 * @constructor
24 * @extends {cvox.AbstractNodeWalker}
25 */
26cvox.GroupWalker = function() {
27  cvox.AbstractNodeWalker.call(this);
28};
29goog.inherits(cvox.GroupWalker, cvox.AbstractNodeWalker);
30
31
32/**
33 * @override
34 */
35cvox.GroupWalker.prototype.getDescription = function(prevSel, sel) {
36  return cvox.DescriptionUtil.getCollectionDescription(prevSel, sel);
37};
38
39
40/**
41 * @override
42 */
43cvox.GroupWalker.prototype.getBraille = function(prevSel, sel) {
44  throw 'getBraille is unsupported';
45};
46
47/**
48 * @override
49 */
50cvox.GroupWalker.prototype.getGranularityMsg = function() {
51  return cvox.ChromeVox.msgs.getMsg('group_strategy');
52};
53
54/**
55 * @override
56 */
57cvox.GroupWalker.prototype.stopNodeDescent = function(node) {
58  return cvox.GroupUtil.isLeafNode(node);
59};
60