Commit 57e54f55 authored by donnd's avatar donnd Committed by Commit bot

[Contextual Search] Add more node checks before triggering.

Now showUnhandledTapUIIfNeeded makes an additional check to see if it is appropriate to trigger: if the tapped node is an ARIA widget or not, according to the accessibility code in Blink.

This CL is dependent on a Blink CL: 885163002

BUG=451096

Review URL: https://codereview.chromium.org/868933002

Cr-Commit-Position: refs/heads/master@{#318275}
parent 683d3ba7
......@@ -2181,7 +2181,8 @@ void RenderWidget::showUnhandledTapUIIfNeeded(
bool page_changed) {
DCHECK(handling_input_event_);
bool should_trigger = !page_changed && tapped_node.isTextNode() &&
!tapped_node.isContentEditable();
!tapped_node.isContentEditable() &&
!tapped_node.isInsideFocusableElementOrARIAWidget();
if (should_trigger) {
Send(new ViewHostMsg_ShowUnhandledTapUIIfNeeded(routing_id_,
tapped_position.x, tapped_position.y));
......
......@@ -193,6 +193,8 @@ class CONTENT_EXPORT RenderWidget
#if defined(OS_ANDROID)
// Notifies that a tap was not consumed, so showing a UI for the unhandled
// tap may be needed.
// Performs various checks on the given WebNode to apply heuristics to
// determine if triggering is appropriate.
virtual void showUnhandledTapUIIfNeeded(
const blink::WebPoint& tapped_position,
const blink::WebNode& tapped_node,
......
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