Commit 7952ae45 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Revert "Defer location change events and processing during page load"

This reverts commit 047c361c.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Defer location change events and processing during page load
> 
> Improves speed of page load stress test from 146 seconds to 43 seconds.
> 
> Also add logging for accessibility page load speed.
> 
> Bug: 976849
> Change-Id: I51d2833366b7b54b2abb9fde40811d29ef287aef
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1675917
> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> Commit-Queue: Nektarios Paisios <nektar@chromium.org>
> Reviewed-by: Nektarios Paisios <nektar@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#672315}

TBR=nektar@chromium.org,aleventhal@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 976849
Change-Id: I0ef892affa0f6c9a2888307262f12bc720c55148
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761715Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689150}
parent e9a09361
...@@ -191,7 +191,6 @@ void RenderAccessibilityImpl::DidCreateNewDocument() { ...@@ -191,7 +191,6 @@ void RenderAccessibilityImpl::DidCreateNewDocument() {
void RenderAccessibilityImpl::DidCommitProvisionalLoad( void RenderAccessibilityImpl::DidCommitProvisionalLoad(
bool is_same_document_navigation, bool is_same_document_navigation,
ui::PageTransition transition) { ui::PageTransition transition) {
is_initial_load_processed_ = false;
has_injected_stylesheet_ = false; has_injected_stylesheet_ = false;
// Remove the image annotator if the page is loading and it was added for // Remove the image annotator if the page is loading and it was added for
// the one-shot image annotation (i.e. AXMode for image annotation is not // the one-shot image annotation (i.e. AXMode for image annotation is not
...@@ -643,8 +642,6 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() { ...@@ -643,8 +642,6 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() {
// ids to locations. // ids to locations.
for (size_t j = 0; j < update.nodes.size(); ++j) { for (size_t j = 0; j < update.nodes.size(); ++j) {
ui::AXNodeData& src = update.nodes[j]; ui::AXNodeData& src = update.nodes[j];
// TODO(accessibility) What if location hasn't been set yet?
// Get cached location for this node or create a new entry if none exists.
ui::AXRelativeBounds& dst = locations_[update.nodes[j].id]; ui::AXRelativeBounds& dst = locations_[update.nodes[j].id];
dst = src.relative_bounds; dst = src.relative_bounds;
} }
...@@ -664,13 +661,11 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() { ...@@ -664,13 +661,11 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() {
ack_token_)); ack_token_));
reset_token_ = 0; reset_token_ = 0;
if (had_layout_complete_messages && is_initial_load_processed_) if (had_layout_complete_messages)
SendLocationChanges(); SendLocationChanges();
if (had_load_complete_messages) { if (had_load_complete_messages)
has_injected_stylesheet_ = false; has_injected_stylesheet_ = false;
is_initial_load_processed_ = true;
}
if (image_annotation_debugging_) if (image_annotation_debugging_)
AddImageAnnotationDebuggingAttributes(bundle.updates); AddImageAnnotationDebuggingAttributes(bundle.updates);
......
...@@ -242,9 +242,6 @@ class CONTENT_EXPORT RenderAccessibilityImpl ...@@ -242,9 +242,6 @@ class CONTENT_EXPORT RenderAccessibilityImpl
// for debugging. // for debugging.
bool image_annotation_debugging_ = false; bool image_annotation_debugging_ = false;
// Has all data related to the initial page load been processed.
bool is_initial_load_processed_ = false;
// So we can queue up tasks to be executed later. // So we can queue up tasks to be executed later.
base::WeakPtrFactory<RenderAccessibilityImpl> weak_factory_{this}; base::WeakPtrFactory<RenderAccessibilityImpl> weak_factory_{this};
......
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