New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 875344 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 20
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Performance issue with accessibility and very large TextArea

Project Member Reported by dmazz...@chromium.org, Aug 17

Issue description

I'm moving this issue reported by george.pirlea@gmail.com from  crbug.com/868830  because that bug discussion thread conflated two different issues.

This issue is not a recent regression so it's not a release blocker, we should aim to fix it on trunk.

1. Turn on Chrome's accessbility support by going to chrome://accessibility and ticking 'Native accessibility API support' and 'Web accessibility'

2. On the same page, tick 'Text metrics'. (This is turned on by default when a screen reader, e.g. NVDA, is used.)

3. Open a page with a large <textarea> (10,000 lines)

4. The page is instantly unreponsive & hangs. No input events are executed -- all time out (see trace).


This triggers specifically when 'text metrics' is on. It seems there's some sort of infinite loop. See the attached GIF and trace from chrome://tracing.

 
test10k.html
165 bytes View Download
Status: Started (was: Assigned)
I have a fix:
https://chromium-review.googlesource.com/c/chromium/src/+/1180647

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d7a75fec4724d736176f4b918544900d4f3ccc7d

commit d7a75fec4724d736176f4b918544900d4f3ccc7d
Author: Dominic Mazzoni <dmazzoni@chromium.org>
Date: Mon Aug 20 19:26:19 2018

Speed up computation of inline text box bounding boxes.

In the layout tree, a LayoutText corresponds to a static text node in
HTML, which can span more than one line. Each line of text is represented
by an InlineTextBox.

In the accessibility tree, we have an AXLayoutObject for the LayoutText,
and an AXInlineTextBox for the InlineTextBox.

The coordinates of the AXInlineTextBox need to be expressed relative to
its parent object, just like everything in the accessibility tree. It turns
out that we need the local bounding box of the parent object (the LayoutText)
to compute this.

However, this leads to an inefficiency, because when you have a very large
LayoutText (as an example, a TEXTAREA element with thousands of lines of
text), each AXInlineTextBox keeps querying its parent LayoutText for its
bounds, but the LayoutText iterates over all of its InlineTextBox children
to compute its bounds! This leads to n^2 complexity where n is the number
of lines in the LayoutText.

The solution is just to cache the bounds of the LayoutText, so it only
needs to be computed once.

Bug:  875344 
Change-Id: I97578ec0eadc597f962b142fb074e6929e834802
Reviewed-on: https://chromium-review.googlesource.com/1180647
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584528}
[modify] https://crrev.com/d7a75fec4724d736176f4b918544900d4f3ccc7d/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc
[modify] https://crrev.com/d7a75fec4724d736176f4b918544900d4f3ccc7d/third_party/blink/renderer/modules/accessibility/ax_object.cc
[modify] https://crrev.com/d7a75fec4724d736176f4b918544900d4f3ccc7d/third_party/blink/renderer/modules/accessibility/ax_object.h

Status: Fixed (was: Started)
I can confirm I no longer see the issue on the latest build. Thank you, Dominic & everyone involved!
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad3eaa784018e9c780e3a2eda84cb6d49173a83f

commit ad3eaa784018e9c780e3a2eda84cb6d49173a83f
Author: Dominic Mazzoni <dmazzoni@chromium.org>
Date: Wed Aug 29 18:24:12 2018

Add blink_perf accessibility test for large textareas.

Bug:  875344 ,  877669 
Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi
Change-Id: I15bbd8c9f64d999f0d987af9d0b8d2b2785165be
Reviewed-on: https://chromium-review.googlesource.com/1188777
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#587201}
[modify] https://crrev.com/ad3eaa784018e9c780e3a2eda84cb6d49173a83f/docs/speed/benchmark/benchmark_ownership.md
[add] https://crrev.com/ad3eaa784018e9c780e3a2eda84cb6d49173a83f/third_party/blink/perf_tests/accessibility/textarea-append.html
[modify] https://crrev.com/ad3eaa784018e9c780e3a2eda84cb6d49173a83f/tools/perf/benchmarks/blink_perf.py
[modify] https://crrev.com/ad3eaa784018e9c780e3a2eda84cb6d49173a83f/tools/perf/core/perf_data_generator.py

Sign in to add a comment