0

Ensure RootView has correct kClassName set.

crrev.com/c/6001295 populated ViewAccessibility's kClassName when being
added to widget. It causes RootView not having any class name set up,
causing regressions on accessibility tree.

This CL calls ViewAccessibility::OnViewAddedToWidget() after RootView is
initialized, as it is being added into a Widget, the root of the
Widget's view. It should provides correct class name for the view.

CQ_INCLUDE_TRYBOTS=luci.chrome.try:chromeos-betty-chrome

Bug: 383962455
Change-Id: I0ff4adbbb0f61c33ea6807d382c537e59d70708b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6091054
Auto-Submit: Qijiang Fan <fqj@chromium.org>
Reviewed-by: Yichen Zhou <yichenz@chromium.org>
Reviewed-by: Andrea Orru <andreaorru@chromium.org>
Owners-Override: Andrea Orru <andreaorru@chromium.org>
Commit-Queue: Qijiang Fan <fqj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395835}
This commit is contained in:
Qijiang Fan
2024-12-13 02:03:32 -08:00
committed by Chromium LUCI CQ
parent 3a87375254
commit b79265d948

@ -480,6 +480,10 @@ void Widget::Init(InitParams params) {
// views.
root_view_->GetViewAccessibility().CompleteCacheInitialization();
// The root view must always be initialized as it is being added to widget,
// like setting kClassName correctly.
root_view_->GetViewAccessibility().OnViewAddedToWidget();
// Once the root view is added to the widget, it should be marked as ready to
// send accessible event notifications. From that point on, any view that is
// connected to the RootView will be able to send accessible events.