Commit f6b72e6c authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Reland: Marks the document object as busy while it is still loading

Changes in the reland compared to the original patch:
Switched to using GetRoot instead of Root() which might prevent the use of an uninitialized root object.

Original description:
Screen readers want to have a reliable way to know whether a document is still loading so as to ignore events coming from it.
The current change can be made irrespective to whether we will mark the document as loaded when HTML parsing has started or when the "interactive" readyState has been entered.

R=dmazzoni@chromium.org, aleventhal@chromium.org

Bug: 897177, 903402
Change-Id: I681883999918ffdd32fc11d2f691b659c7e91149
Reviewed-on: https://chromium-review.googlesource.com/c/1327745
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607017}
parent 3683a1b8
...@@ -207,8 +207,7 @@ void BrowserAccessibilityManager::FireFocusEventsIfNeeded() { ...@@ -207,8 +207,7 @@ void BrowserAccessibilityManager::FireFocusEventsIfNeeded() {
// or for the document to actually finish loading. // or for the document to actually finish loading.
if (focus && focus == focus->manager()->GetRoot() && if (focus && focus == focus->manager()->GetRoot() &&
focus->PlatformChildCount() == 0 && focus->PlatformChildCount() == 0 &&
!focus->GetBoolAttribute(ax::mojom::BoolAttribute::kBusy) && focus->GetBoolAttribute(ax::mojom::BoolAttribute::kBusy)) {
!focus->manager()->GetTreeData().loaded) {
focus = nullptr; focus = nullptr;
} }
......
...@@ -443,6 +443,9 @@ void BlinkAXTreeSource::SerializeNode(WebAXObject src, ...@@ -443,6 +443,9 @@ void BlinkAXTreeSource::SerializeNode(WebAXObject src,
TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role", TRACE_EVENT1("accessibility", "BlinkAXTreeSource::SerializeNode", "role",
ui::ToString(dst->role)); ui::ToString(dst->role));
if (src.Equals(GetRoot()) && !GetRoot().IsLoaded())
dst->AddBoolAttribute(ax::mojom::BoolAttribute::kBusy, true);
WebAXObject offset_container; WebAXObject offset_container;
WebFloatRect bounds_in_container; WebFloatRect bounds_in_container;
SkMatrix44 container_transform; SkMatrix44 container_transform;
...@@ -451,7 +454,7 @@ void BlinkAXTreeSource::SerializeNode(WebAXObject src, ...@@ -451,7 +454,7 @@ void BlinkAXTreeSource::SerializeNode(WebAXObject src,
container_transform, &clips_children); container_transform, &clips_children);
dst->location = bounds_in_container; dst->location = bounds_in_container;
#if !defined(OS_ANDROID) && !defined(OS_MACOSX) #if !defined(OS_ANDROID) && !defined(OS_MACOSX)
if (src.Equals(root())) { if (src.Equals(GetRoot())) {
WebView* web_view = render_frame_->GetRenderView()->GetWebView(); WebView* web_view = render_frame_->GetRenderView()->GetWebView();
std::unique_ptr<gfx::Transform> container_transform_gfx = std::unique_ptr<gfx::Transform> container_transform_gfx =
std::make_unique<gfx::Transform>(container_transform); std::make_unique<gfx::Transform>(container_transform);
......
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