Revert "Reland: [A11y] Stable ids for AXObjects with DOM nodes"

This reverts commit 01466963a42b3bd5fdbe5bc5ac17bff6304b058d.

Reason for revert:
- Performance regressions in crbug.com/1408341
- TAST test inputs.VirtualKeyboardAccent still fails sometimes

Original change's description:
> Reland: [A11y] Stable ids for AXObjects with DOM nodes
>
> Reland of CL:4027071. The revert was caused because of the breaking
> of a TAST test. Basically, some code in AXTreeSerializer that deleted subtrees of old child ids is not triggered as often, because if the DOM node doesn't change, the child ID doesn't. That's a good thing usually, but if the node is reattached with new style, we need to make sure its children are reconsidered. The fix is that in the specific case where
> a node is reattached, call ChildrenChanged() instead of just marking it dirty -- in AXObjectCacheImpl::UpdateCacheAfterNodeIsAttached().
>
> ----
>
> Use the DOM node for the AXID for any AXObject with a DOM node. Other AXObjects will still generate their AXID, but in their own numerical namespace. For now, any AXID < 0 will be a generated ID.
>
> Role changes and alerts required some new browser-side code, because rather than the object being destroyed and created with a new id, the ID now stays the same.
>
> In some cases, test results have improved, e.g. rather than an object being destroyed and created with a different ID, it retains the same ID and a change event is fired for it.
>
> Benefits:
> - Removes over 100 lines of implementation code
> - Use less memory: removes ids_in_use_ (set) and node_object_mapping_ (map).
> - Reduce map lookups when an AXObject is removed -- based on the ID value, we can determine whether it has a DOM node and if it doesn't, we already know it cannot be in some of the maps
> - Make it easier for screen readers to maintain the user's point of regard within content, even when the layout or role changes. Users sometimes lose their place, as the screen reader may move the user to the top. A hope is that this will reduce the occurrences of that happening. It may even be possible for screen readers to keep their place in tabs where the AX tree is released from memory and later regenerated, which could open up possibilities to using less memory.
> - Enable the follow-ups listed below.
>
> Follow-up work:
> - Refactor content-visibility: auto change handling in a11y (crbug.com/1380449).
> - See if the dom_node_id field in AXNodeData is needed anymore now that any id >0 is the same as the dom node id.
> - Look at simplifying or removing reparenting computations in AXTreeSerializer. Maybe we can get rid of expensive AnyDescendantIsReparented().
> - Merge GetAXID() and GetExistingAXID() -- see TODO.
>
> Bug: none
> Change-Id: If6af6cb7e0330e8ab28d7a00bcf5bdfe10fbc9aa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4131180
> Reviewed-by: David Tseng <dtseng@chromium.org>
> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1093648}

Bug: none
Change-Id: I93adace41a3407118eb49fc71e94b15d747985b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4178414
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Owners-Override: Austin Sullivan <asully@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093932}
59 files changed
tree: c7129194e86cfb9b6966d585dacf5e69609d101b
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. courgette/
  16. crypto/
  17. dbus/
  18. device/
  19. docs/
  20. extensions/
  21. fuchsia_web/
  22. gin/
  23. google_apis/
  24. google_update/
  25. gpu/
  26. headless/
  27. infra/
  28. ios/
  29. ipc/
  30. media/
  31. mojo/
  32. native_client_sdk/
  33. net/
  34. pdf/
  35. ppapi/
  36. printing/
  37. remoting/
  38. rlz/
  39. sandbox/
  40. services/
  41. skia/
  42. sql/
  43. storage/
  44. styleguide/
  45. testing/
  46. third_party/
  47. tools/
  48. ui/
  49. url/
  50. weblayer/
  51. .clang-format
  52. .clang-tidy
  53. .eslintrc.js
  54. .git-blame-ignore-revs
  55. .gitattributes
  56. .gitignore
  57. .gn
  58. .mailmap
  59. .rustfmt.toml
  60. .vpython3
  61. .yapfignore
  62. ATL_OWNERS
  63. AUTHORS
  64. BUILD.gn
  65. CODE_OF_CONDUCT.md
  66. codereview.settings
  67. DEPS
  68. DIR_METADATA
  69. LICENSE
  70. LICENSE.chromium_os
  71. OWNERS
  72. PRESUBMIT.py
  73. PRESUBMIT_test.py
  74. PRESUBMIT_test_mocks.py
  75. README.md
  76. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.