+ // Generate a unique function name based on the arguments, and
+ // memoize the result of the internal visibility computation so that
+ // within the same call stack, we don't need to recompute the visibility
+ // of the same node.
+ var fname = 'isVisible-' + checkAncestors + '-' + checkDescendants;
+ return /** @type {boolean} */ (cvox.Memoize.memoize(
+ cvox.DomUtil.computeIsVisible_.bind(
+ this, node, checkAncestors, checkDescendants), fname, node));
+};
+
+/**
+ * Implementation of |cvox.DomUtil.isVisible|.
+ * @param {Node} node The node to determine as visible or not.
+ * @param {boolean} checkAncestors True if we should check the ancestor chain
+ * for forced invisibility traits of descendants.
+ * @param {boolean} checkDescendants True if we should consider descendants of
+ * the given node for visible elements.
+ * @return {boolean} True if the node is visible.
+ * @private
+ */
+cvox.DomUtil.computeIsVisible_ = function(
+ node, checkAncestors, checkDescendants) {