-
Fabian Henneke authored
In BrowserAccessibilityAndroid, the function HasFocusableNonOptionChild is used to determine whether an accessibility node can be treated as a leaf in IsLeaf. This function can be very costly (on the order of a few milliseconds) since it traverses the tree. IsLeaf is eventually called by both RetargetForEvent and CanFireEvents, which in turn are called in every run of the loop over all events in BrowserAccessibilityManager::OnAccessibilityEvents. For pages with a complicated tree (e.g. cs.chromium.org), this can cause complete unresponsiveness for periods of 10s and more. This change moves the call to HasFocusableNonOptionChild behind the individual checks for special situations in which the lack of focusable children would allow to prune the accessibility tree. This results in far less calls to the function while preserving the structure of the tree. Bug: 1014945 Change-Id: Idfde20271847425996d1f370e0fa1d8b964aa3f3 AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2580802Reviewed-by:
Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#836650}
e49a7454