OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview A collection of JavaScript utilities used to simplify working | 6 * @fileoverview A collection of JavaScript utilities used to simplify working |
7 * with the DOM. | 7 * with the DOM. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 while (leftmost && leftmost.firstChild) { | 739 while (leftmost && leftmost.firstChild) { |
740 leftmost = leftmost.firstChild; | 740 leftmost = leftmost.firstChild; |
741 } | 741 } |
742 | 742 |
743 // Do nothing if we're not at the leftmost leaf. | 743 // Do nothing if we're not at the leftmost leaf. |
744 if (firstListitem && | 744 if (firstListitem && |
745 firstListitem.parentNode && | 745 firstListitem.parentNode && |
746 opt_index == 0 && | 746 opt_index == 0 && |
747 firstListitem.parentNode.tagName == 'OL' && | 747 firstListitem.parentNode.tagName == 'OL' && |
748 node == leftmost && | 748 node == leftmost && |
749 document.defaultView.getComputedStyle(firstListitem.parentNode) | 749 document.defaultView.getComputedStyle(firstListitem.parentElement) |
750 .listStyleType != 'none') { | 750 .listStyleType != 'none') { |
751 var items = cvox.DomUtil.toArray(firstListitem.parentNode.children).filter( | 751 var items = cvox.DomUtil.toArray(firstListitem.parentNode.children).filter( |
752 function(li) { return li.tagName == 'LI'; }); | 752 function(li) { return li.tagName == 'LI'; }); |
753 var position = items.indexOf(firstListitem) + 1; | 753 var position = items.indexOf(firstListitem) + 1; |
754 // TODO(dtseng): Support all list style types. | 754 // TODO(dtseng): Support all list style types. |
755 if (document.defaultView.getComputedStyle( | 755 if (document.defaultView.getComputedStyle( |
756 firstListitem.parentNode).listStyleType.indexOf('latin') != -1) { | 756 firstListitem.parentElement).listStyleType.indexOf('latin') != -1) { |
757 position--; | 757 position--; |
758 prefix = String.fromCharCode('A'.charCodeAt(0) + position % 26); | 758 prefix = String.fromCharCode('A'.charCodeAt(0) + position % 26); |
759 } else { | 759 } else { |
760 prefix = position; | 760 prefix = position; |
761 } | 761 } |
762 prefix += '. '; | 762 prefix += '. '; |
763 } | 763 } |
764 return prefix; | 764 return prefix; |
765 }; | 765 }; |
766 | 766 |
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 var describedNode = document.getElementById(describedById); | 2601 var describedNode = document.getElementById(describedById); |
2602 if (describedNode) { | 2602 if (describedNode) { |
2603 desc += ' ' + cvox.DomUtil.getName( | 2603 desc += ' ' + cvox.DomUtil.getName( |
2604 describedNode, true, true, true); | 2604 describedNode, true, true, true); |
2605 } | 2605 } |
2606 } | 2606 } |
2607 } | 2607 } |
2608 } | 2608 } |
2609 return desc; | 2609 return desc; |
2610 }; | 2610 }; |
OLD | NEW |