Open
Bug 2057395
Opened 4 months ago
Updated 15 days ago
Deeply nested trees where all items are focusable cause major performance problems
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
NEW
People
(Reporter: Jamie, Unassigned, NeedInfo)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: perf, regression)
Test case:
data:text/html,
<body role="application">
<div id="tree" role="tree">
<div id="root" role="treeitem" tabindex="-1">root
<div id="rootGroup" role="group"></div>
</div>
</div>
<script>
let group = rootGroup;
for (let level = 1; level < 20; ++level) {
const item = document.createElement("div");
group.append(item);
item.role = "treeitem";
item.ariaExpanded = "true";
item.tabIndex = -1;
item.textContent = `a${level}`;
group = document.createElement("div");
item.append(group);
group.role = "group";
}
for (let l = 0; l < 4; ++l) {
const item = document.createElement("treeitem");
group.append(item);
item.role = "treeitem";
item.tabIndex = 0;
item.textContent = `l${l}`;
}
</script>
- Start NVDA or Narrator, but I think any screen reader will be impacted to some extent or another.
- Load the test case.
- Tab between the tree items.
- Expected: Firefox and the screen reader should remain responsive.
- Actual: Multi second hangs every time the focus is moved.
Profile: https://share.firefox.dev/4yDhsyR
I think we're hitting a nasty edge case with this code. That code walks the ancestors calling State() to check for the unavailable state. The problem is that in a deeply nested tree where all the items are focusable, we end up calling ImplicitState() on each ancestor, which in turn calls State() on all its ancestors, which in turn calls ImplicitState()... and so on; O(n^2).
Comment 1•4 months ago
|
||
Set release status flags based on info from the regressing bug 1899960
:eeejay, since you are the author of the regressor, bug 1899960, could you take a look?
For more information, please visit BugBot documentation.
status-firefox153:
--- → affected
status-firefox154:
--- → affected
status-firefox155:
--- → affected
status-firefox-esr140:
--- → unaffected
status-firefox-esr153:
--- → affected
Flags: needinfo?(eitan)
Updated•4 months ago
|
Comment 2•3 months ago
|
||
Set release status flags based on info from the regressing bug 1899960
status-firefox156:
--- → affected
Updated•3 months ago
|
Updated•2 months ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•