Commit 3c444fd7 authored by Filip Gorski's avatar Filip Gorski Committed by Commit Bot

[GAR4] Fixing Talk Back/Switch Access order of Find in Page controls

The issue observed with Find in Page is that when there is nothing yet
to search for (no input) the Talk Back order of visited controls is
incorrect: Text entry field is followed by web contents and its
elements that can be jumped to, and not by the remaining Find in Page
toolbar controls (previous, next and close buttons).

The problem happens because the search results counter field, while
visible with no input, carries no focusable content. That makes the
accessibility API fail and jump to web contents.

This patch ensures that the field is gone, when there is no content
for it to hold, and makes it visible as soon as there is content.

Bug: 1093480
Change-Id: I158114b8b07f7defa12671ab900736ea728401e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421293Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808930}
parent 8eadbd2d
......@@ -16,6 +16,7 @@ import android.provider.Settings;
import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.ActionMode;
......@@ -335,6 +336,7 @@ public class FindToolbar extends LinearLayout {
});
mFindStatus = (TextView) findViewById(R.id.find_status);
setStatus("", false);
mFindPrevButton = findViewById(R.id.find_prev_button);
mFindPrevButton.setOnClickListener(new OnClickListener() {
......@@ -769,6 +771,7 @@ public class FindToolbar extends LinearLayout {
mFindStatus.setText(text);
mFindStatus.setContentDescription(null);
mFindStatus.setTextColor(getStatusColor(failed, isIncognito()));
mFindStatus.setVisibility(TextUtils.isEmpty(text) ? GONE : VISIBLE);
}
/**
......
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