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.
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.
12 goog
.provide('cvox.GroupWalker');
14 goog
.require('cvox.AbstractNodeWalker');
15 goog
.require('cvox.BrailleUtil');
16 goog
.require('cvox.CursorSelection');
17 goog
.require('cvox.DescriptionUtil');
18 goog
.require('cvox.DomUtil');
19 goog
.require('cvox.GroupUtil');
24 * @extends {cvox.AbstractNodeWalker}
26 cvox
.GroupWalker = function() {
27 cvox
.AbstractNodeWalker
.call(this);
29 goog
.inherits(cvox
.GroupWalker
, cvox
.AbstractNodeWalker
);
35 cvox
.GroupWalker
.prototype.getDescription = function(prevSel
, sel
) {
36 return cvox
.DescriptionUtil
.getCollectionDescription(prevSel
, sel
);
43 cvox
.GroupWalker
.prototype.getBraille = function(prevSel
, sel
) {
44 throw 'getBraille is unsupported';
50 cvox
.GroupWalker
.prototype.getGranularityMsg = function() {
51 return cvox
.ChromeVox
.msgs
.getMsg('group_strategy');
57 cvox
.GroupWalker
.prototype.stopNodeDescent = function(node
) {
58 return cvox
.GroupUtil
.isLeafNode(node
);