Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/dom_util.js

Issue 813303002: Fix crash in Chromevox event handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 * @param {Node} root The root of the subtree to check. 223 * @param {Node} root The root of the subtree to check.
224 * @param {boolean} recursive Whether or not to check beyond the root of the 224 * @param {boolean} recursive Whether or not to check beyond the root of the
225 * subtree for visible nodes. This option exists for performance tuning. 225 * subtree for visible nodes. This option exists for performance tuning.
226 * Sometimes we already have information about the descendants, and we do 226 * Sometimes we already have information about the descendants, and we do
227 * not need to check them again. 227 * not need to check them again.
228 * @return {boolean} True if the subtree contains a visible node. 228 * @return {boolean} True if the subtree contains a visible node.
229 * @private 229 * @private
230 */ 230 */
231 cvox.DomUtil.hasVisibleNodeSubtree_ = function(root, recursive) { 231 cvox.DomUtil.hasVisibleNodeSubtree_ = function(root, recursive) {
232 if (!(root instanceof Element)) { 232 if (!(root instanceof Element)) {
233 if (!root.parentElement) {
234 return false;
235 }
233 var parentStyle = document.defaultView 236 var parentStyle = document.defaultView
234 .getComputedStyle(root.parentElement, null); 237 .getComputedStyle(root.parentElement, null);
235 var isVisibleParent = !cvox.DomUtil.isInvisibleStyle(parentStyle); 238 var isVisibleParent = !cvox.DomUtil.isInvisibleStyle(parentStyle);
236 return isVisibleParent; 239 return isVisibleParent;
237 } 240 }
238 241
239 var rootStyle = document.defaultView.getComputedStyle(root, null); 242 var rootStyle = document.defaultView.getComputedStyle(root, null);
240 var isRootVisible = !cvox.DomUtil.isInvisibleStyle(rootStyle); 243 var isRootVisible = !cvox.DomUtil.isInvisibleStyle(rootStyle);
241 if (isRootVisible) { 244 if (isRootVisible) {
242 return true; 245 return true;
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2597 var describedNode = document.getElementById(describedById); 2600 var describedNode = document.getElementById(describedById);
2598 if (describedNode) { 2601 if (describedNode) {
2599 desc += ' ' + cvox.DomUtil.getName( 2602 desc += ' ' + cvox.DomUtil.getName(
2600 describedNode, true, true, true); 2603 describedNode, true, true, true);
2601 } 2604 }
2602 } 2605 }
2603 } 2606 }
2604 } 2607 }
2605 return desc; 2608 return desc;
2606 }; 2609 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698