Commit 98c5a82f authored by Katie Dektar's avatar Katie Dektar Committed by Commit Bot

Select to Speak should not highlight staticText nodes.

staticText nodes will not work with the boundsForRange
function so it doesn't make sense to try to highlight
them.

Bug: 789211
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I958bb75e663f5cf2b073466014e7122899b892bf
Reviewed-on: https://chromium-review.googlesource.com/794517Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Katie D <katie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519924}
parent 39a10dcb
......@@ -766,11 +766,11 @@ SelectToSpeak.prototype = {
default:
if (inForeground) {
if (this.wordHighlight_ && this.currentNodeWord_ != null) {
// Only show the highlight if this is an inline text box or
// static text. Otherwise we'd be highlighting entire nodes,
// like images. Highlight should be only for text.
if (node.role == RoleType.INLINE_TEXT_BOX ||
node.role == RoleType.STATIC_TEXT) {
// Only show the highlight if this is an inline text box.
// Otherwise we'd be highlighting entire nodes, like images.
// Highlight should be only for text.
// Note that boundsForRange doesn't work on staticText.
if (node.role == RoleType.INLINE_TEXT_BOX) {
chrome.accessibilityPrivate.setHighlights(
[node.boundsForRange(
this.currentNodeWord_.start, this.currentNodeWord_.end)],
......@@ -787,8 +787,7 @@ SelectToSpeak.prototype = {
// TODO: Better test: has no siblings in the group, highlight just
// the one node. if it has siblings, highlight the parent.
if (this.currentBlockParent_ != null &&
(node.role == RoleType.STATIC_TEXT ||
node.role == RoleType.INLINE_TEXT_BOX)) {
node.role == RoleType.INLINE_TEXT_BOX) {
chrome.accessibilityPrivate.setFocusRing(
[this.currentBlockParent_.location], this.color_);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment