Bug 278928
Summary: | AX: AXTextOperation over multiple ranges is entirely broken | ||
---|---|---|---|
Product: | WebKit | Reporter: | Samar Sunkaria <samar.sunkaria> |
Component: | Accessibility | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | andresg_22, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 18 | ||
Hardware: | All | ||
OS: | All |
Samar Sunkaria
When performing an AXTextOperation over multiple ranges (_in descending order of their position_), typically only the first range is replaced. In a contenteditable, multiple ranges might be replaced correctly if they aren’t located within the same node.
This problem is consistently reproducible. However, it is much harder (though not impossible) to reproduce when a non-smart replacement is performed (as proposed in https://bugs.webkit.org/show_bug.cgi?id=278458).
This seems to happen whenever the replacement isn't executed using the `ReplaceSelectionCommand::performTrivialReplace` and instead takes the longer path in `ReplaceSelectionCommand::doApply`. While the initial replacement is performed correctly, subsequent replacements fail because text selection fails on the following iteration of `AccessibilityObject::performTextOperation`.
After the first replacement the SimpleRanges stored in `AccessibilityTextOperation` are orphaned, and can no longer be used for performing a selection; ever since https://bugs.webkit.org/show_bug.cgi?id=221942 was introduced. That change likely caused this bug.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/135021789>
Samar Sunkaria
In particular I am hitting the ASSERT_NOT_REACHED() for an orphaned selection in FrameSelection::setSelectionWithoutUpdatingAppearance, for the second selection range in the same node as a previous replacement.
```
if (newSelection.isOrphan()) {
ASSERT_NOT_REACHED();
clear();
return false;
}
```
Samar Sunkaria
Pull request: https://github.com/WebKit/WebKit/pull/34534
EWS
Committed 284801@main (4b8b62af6ff6): <https://commits.webkit.org/284801@main>
Reviewed commits have been landed. Closing PR #34534 and removing active labels.
EWS
Committed 283286.232@safari-7620-branch (6f342184a21d): <https://commits.webkit.org/283286.232@safari-7620-branch>
Reviewed commits have been landed. Closing PR #1992 and removing active labels.