Commit beebf6b8 authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Accessibility: Notify WCAX of frame info update last

In certain cases, WebContentsAccessibilityImpl.notifyFrameInfoInitialized
needs to refocus an already focused element, and for this to work it
needs GestureListenerManager to receive the updated frame info first,
otherwise an an accessibility focus event can't be created.

This occasionally caused focusing the activated WebContents after
a portal activation to fail.

Bug: 1064084
Change-Id: I9fdf60a108621334399938895717598678459b48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122911Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754553}
parent fea88e2e
......@@ -441,10 +441,6 @@ void RenderWidgetHostViewAndroid::OnRenderFrameMetadataChangedBeforeActivation(
top_shown_pix);
}
auto* wcax = GetWebContentsAccessibilityAndroid();
if (wcax)
wcax->UpdateFrameInfo(metadata.page_scale_factor);
if (!gesture_listener_manager_)
return;
......@@ -482,6 +478,11 @@ void RenderWidgetHostViewAndroid::OnRenderFrameMetadataChangedBeforeActivation(
metadata.min_page_scale_factor, metadata.max_page_scale_factor,
root_layer_size_dip, scrollable_viewport_size_dip, top_content_offset_dip,
top_shown_pix, controls_changed);
// This needs to be called after GestureListenerManager::UpdateScrollInfo, as
// it depends on frame info being updated during the UpdateScrollInfo call.
auto* wcax = GetWebContentsAccessibilityAndroid();
if (wcax)
wcax->UpdateFrameInfo(metadata.page_scale_factor);
page_scale_ = metadata.page_scale_factor;
min_page_scale_ = metadata.min_page_scale_factor;
......
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